BackgroundOne of the most common reasons for forward geocoding (converting from an address or placename to coordinates) is to then display those results as points on a map.
Displaying geocoding results on a map
Mapping software needs precise coordinates like those returned by our geocoder to know exactly where to position pins on a map. Basically, the process is
- You have an address
- You geocode the address to turn it into coordinates
- You pass those coordinates to a mapping library to display a pin on a map
Which maps can you use to display geocoding results?
Some geocoding services, for example Google, restrict where you can display the results their geocoder returns. They require that you only display results on their maps, or that you purchase an expensive license if you'd like to display the map behind a firewall, or that you can only store the geocoding results for a limited timeperiod or while you remain a customer. Because we use open data you are free to display results on any mapping software you like. This is one of the many benefits of using open data.
How to display the results on the map
- Leaflet is a very popular, beginner-friendly, open source library. In the QuickStart tutorial they show how to add a pin (a "marker", in Leaflet terminology) to a map at any coordinates.
- OpenLayers is another mature, open source mapping library, typically used for more complex mapping applications.
- Google Maps API is probably the most widely used, non-open source mapping library, they also provide maps.