我如何获得特定地点的经度和纬度 [英] haw can i get latitude and longitude of particular place

查看:110
本文介绍了我如何获得特定地点的经度和纬度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有
我想用文本框"Place",经度"和纬度"制作一个HTML页面,当我们在文本框内键入任何地名并提交表单时,调用一个Java脚本函数来获取经度"和纬度".

Dear All
I want to make a html page with Textbox "Place", "longitude" and "latitude" when we type any place name in place Textbox and submit form call a java script function to get "longitude" and "latitude" .

推荐答案

我碰巧使用worldweatheronline.com来获取当地天气.

他们的API的一部分包括城市搜索API-您给他们一个城市名称,然后它们会返回该名称的最佳匹配.例如,您给他们巴黎",它会还给您:法国巴黎",巴黎,德克萨斯州"等,以及每个人的纬度和经度.

如果您用谷歌搜索它们,还有其他可用的.

Google有一个类似的API,但是我对他们的使用条款的理解是,仅当您打算使用该API在地图上显示一个点时,才应该使用该API-因为那不是我使用的模型还有别的.

这里有一个很好的示例网页:

http://stevemorse.org/jcal/latlon.php [
I happen to use worldweatheronline.com to get local weather.

Part of their API includes a city search API -- you give them a city name and they return the best matches for that name. For example you give them "Paris" it will give you back: "Paris, France", "Paris, TX" , etc. along with the latitude and longitude for each.

There are others available if you google for them.

Google has a similar API, but my understanding of their terms of use is you are only supposed to use that API if you are going to use it to display a point on a map -- since that isn''t my usage model I went with something else.

There''s a good sample webpage here:

http://stevemorse.org/jcal/latlon.php[^]

which I found via google. He lists links to services he uses to get the data, and you can also look at the source code for the page.


这篇关于我如何获得特定地点的经度和纬度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆