A geocoder is a utility that powers map search. It returns a set of Latitude and Longitude ("lat long") geocoordinates ("geocodes") when queried for an address (“814 Mission Street, San Francisco”), a landmark (“albert einstein statue”), a city/town/county ("Byron Bay"), and many businesses, services or attractions (“Hershey Chocolate World”). With geocode in hand, a marker or pin can be placed on the map at the desired location.
This Leaflet example demonstrates geocoding results from Mapzen’s Open Source Pelias project (more below), and it demonstrates reverse-geocoding, which simply finds and returns the nearest address to a lat long. In this example, you can move the marker and see the reverse geocoding result.
Our example also provides a helpful information box to display actual latitude and longitude, view bounds of the map corners, and zoom level.
We were recently introduced to the folks at Mapzen who have been doing amazing work with Open Source projects including geocoding, routing, and vector rendering. Their map search project is called "Pelias," and we’ve found it to be outstanding and a project we hope to contribute to.
Mapzen Search is free for up to 30,000 geocoding requests per day (and 6 per second). You can use the results to provide search results, and you can store a result for future reference (e.g., a lat long that maps your business). This is actually a great deal: most commercial geocoder providers won’t let you store a geocode without upgrading to a premium or top tier. If you believe your application will exceed Mapzen’s limits, just contact us and we’ll work with them to find a good solution.
Pelias is a separate service from MapJam, so you’ll have to get your own API key from MapZen here: Mapzen is awesome!
MapJam for Developers