This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Display map in HTML Using Addresses in JavaScript

0

Is there an example of how to use JavaScript to send an address to display a map in a HTML webpage?

asked 27 Jun '21, 22:03

QJasper's gravatar image

QJasper
11112
accept rate: 0%


One Answer:

1

You can display a map in a html page using the LeafletJS library and show the address with a marker.

See https://leafletjs.com/examples/quick-start/ for an example about integrating the map and displaying a marker.

If you don't have the coordinates for an address, you would have to geocode those first. Nominatim will help you in forward geocoding (getting coordinates for addresses), see https://nominatim.org for more information on geocoding).

answered 28 Jun '21, 09:38

Spiekerooger's gravatar image

Spiekerooger
3.1k22356
accept rate: 16%

edited 28 Jun '21, 09:40

Thanks for the information!!!

(28 Jun '21, 16:53) QJasper

Source code available on GitHub .