Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I achieve Geocoding with the JavaScript OpenLayers API, in the same fashion as the Google Maps API?

share|improve this question

closed as too broad by PolyGeo Jul 19 at 4:27

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
What do you want to geocode? In what language? Do you have an example what you want to achieve....? Did you take a look at: dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/… – stUrb May 7 '12 at 20:25
    
i need to get latitude, longitude from the given address, like google geocode... – Ramesh Kotha May 7 '12 at 20:37
1  
You can still use the Google Geocoding API - if you stay under 2500 reqs per day, it's free to use. You'd have to tie it in with your web application somehow. Is your question really how to do that? If so, we need more context. What do you want to achieve? What do you already have? – mvexel May 9 '12 at 19:01
1  
Also, there's alternatives that may be just as well suited to your needs: the MapQuest Open geocoder based on OpenStreetMap data, for example. developer.mapquest.com/web/products/open/nominatim – mvexel May 9 '12 at 19:02
    
Thanks @mvexel, i need to get latitude, longitude from given address for any country, i have done this with google maps api, but i need any free geocoding api, thats why i turned to OpenLayers, but geocoding is not possible with OpenLayers.. – Ramesh Kotha May 9 '12 at 19:16

Openlayers does not feature a Geocoding API. There are several questions here related to geocoding. Some of them specifically mention openlayers and geocoding (many do so with Google).

share|improve this answer
    
is there any alternative is there? i am using openlayers, so what would be the best possible way? – Ramesh Kotha May 8 '12 at 17:58

You can use Google Geocoder with OpenLayers, for an example see this post:

How to use Google Maps V3 Geocode with Openlayers

Disclaimer: as someone pointed out you might be in violation of their usage terms, but I'll leave that for you lawyer to figure out.

share|improve this answer

Possible way, Try to find any other free/commercial geocoder. Once you geocode the address, still you can you use your openlayer to overlay the lat.longs on the map tiles.

share|improve this answer
    
can u suggest any free geocoder. – Ramesh Kotha May 9 '12 at 14:43

http://geocoder.us/help/

"geocoder.us find the latitude & longitude of any US address - for free"

hope you are trying for US addresses...

share|improve this answer
    
thanks for your answer, but i am trying for whole world, is there any thing? – Ramesh Kotha May 9 '12 at 15:03

Using openlayers 3, you will have the opportunity to use a series of servers. OSM or photon as usual is of preference (I will personally go for this especially with a limited budget), though using the Mapquest or Google geocoder you will need a key. I will refer you to: https://github.com/jonataswalker/ol3-geocoder. It will be very helpful!

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

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