English 中文(简体)
包括长线坐标在内的城市名称/邮政编码自动化网络服务?
原标题:webservice for autosuggest on city names / postal codes including long-lat coordinates?

i m looking for a webservice, to be used for an autocomplete field, where people can fill in either a postal code / city name or both

this service will need all cities in Europe, so we can use it for all country websites. and in a later stadium we want to keep the world open for asia and america so this would be a plus.

p. 最好还交回各地点的长期坐标

Now it is a free textfield, after leaving the field, we hit the google geocoding service, to find coordinates... preferably i would tie these two together. so we don t have to query 2 services for one thing.

does anyone know of the existance of such a service online somewhere? or would you suggest to build our own database with cities / postal codes / coordinates? if so we would need to get the content from somewhere too, and i was trying to avoid that issue :)

最佳回答

我最近寻找了类似的服务,但徒劳无益。

我希望我的用户在进入城市名称时能够自动完成,一旦选定一个城市,我就必须把名字和排在谷歌第二号上。 最后,我这样做了:

  1. downloaded the geonames allcountries.zip, full extract: this
  2. Imported it into a SQL DB via SSIS (about 7.5 million records!)
  3. Wrote a simple query to extract just the cities (only the PPLC, PPLA and PPLA2 records).

这给我留下了9112个记录表(有相对/长期和国家代码),覆盖了世界上所有城市。 然后,我写了自己的法典,询问数据。

并非理想,但我需要解决办法。

问题回答

I know this post is very old but for thouse who are looking for a simple solution that can be integrated in 5 minutes here is the link: Geocomplete jQuery...

对我的案件,我采取了以下步骤:

1 - 下载here

2 - 将jquery.geocomplete.js或jquery.geocomplete.min.js案列入贵方项目的javascript 。

3 - Call this file in script tags on the html page where you have the input field that you have to autocomplete with cities: <script src= /PathToTheFile/jquery.geocomplete.js ></script>

4 - To convert an input into an autocomplete field, simply call the Geocomplete plugin in script tags: <script> $("#IdOfTheInputField").geocomplete(); // Option 1: Call on element. $.fn.geocomplete("input"); // Option 2: Pass element as argument. </script>

5- 您可以核对有关顶部提供链接的各种选择的完整清单。

希望这有助于!





相关问题
IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

ASP.net web services

I am using a web service which sets the Thread.CurrentPrincipal object while logging in and soon later when another webmethod of the same web service accesses Thread.CurrentPrincipal, its different/...

Unity Container Disposing and XML Web Service

I am registering some wrapers over un-managed objects in container. How can I dispose of them at the end of the container s lifetime? Please bear in mind I have an XML Web service.

SharePoint : web service permission error

I have a sharepoint site, and I am calling a standard sharepoint web service. I create the web service request like this : wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx"; When I use ...

热门标签