1

I am trying to figure out how to add a search functionality to my openlayers map. I want the user to type in an address and the map to zoom into the location. I am looking at different geocoders and can't figure out a simple solution to this. Nominatim seems liek a possible solution. But I am trying to find something that I can develop on the front end. I have OSM data for my background and would prefer to use this. Any tip or ideas to point me in the right direction would be appreciated!

Thanks

2 Answers 2

3

Here's an example using google.

Just supply your own google key for your environment to test.

3
  • can't we do this with out google support? May 7, 2012 at 20:57
  • @RameshK : yes we can! :)
    – CaptDragon
    May 7, 2012 at 21:02
  • This might be better as its own question, but I want to use a customized Google address search that I already developed and with an openlayers map. @CaptDragon I took your example using Google and added the latest openlayers js <script src="http://www.openlayers.org/api/2.11/OpenLayers.js"></script> but I'm getting an error: Uncaught TypeError: OpenLayers.Control.Geocoder is not a constructor. Do you know what's wrong?
    – Patty Jula
    May 25, 2017 at 16:59
1

To attach such a functionality, you can use Nominatim.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.