NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum


I want to convert location to lat/long in jquery.

Thanks, Vivek

asked 28 Oct '10, 13:14

Vivek%20Kumar's gravatar image

Vivek Kumar
accept rate: 0%

edited 01 Nov '10, 23:06

TomH's gravatar image

TomH ♦♦


Can you detail your need and your context, please.

(28 Oct '10, 15:52) frodrigo

Hi, I have two text box called from and to and I am inserting location in it. Suppose from text box has France and to text box england, now I want to convert from location to latitude /longitude and as well as to location to latitude and longitude. how we can do that.

I want to do in j query. Thanks for your reply.

(28 Oct '10, 16:57) Vivek Kumar

Your problem is called geocoding and there are various tools and APIs which can help you with that. You could use Nominatim, I guess, or see e.g. Yahoo! PlaceFinder.

permanent link

answered 28 Oct '10, 17:13

Mormegil's gravatar image

accept rate: 0%

Hi ,thanks for the reply

Do you have any example related to open layer.

(29 Oct '10, 10:21) Vivek Kumar

The Routing Demo does exactly this by sending a JSONP request to Nominatim. You can grab a tarball and look in yours.js.

If Nominatim returns more than one result, the first one is used. It has a number of drawbacks. For example, when searching for a large city, the first result may be a border that is quite far from the actual city center.

permanent link

answered 31 Oct '10, 23:22

Nic%20Roets's gravatar image

Nic Roets
accept rate: 6%

edited 01 Nov '10, 00:37

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 28 Oct '10, 13:14

question was seen: 7,607 times

last updated: 01 Nov '10, 23:06

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum