简体   繁体   English

如何将我的网页上的位置搜索与Google地图集成在一起?

[英]How can I integrate a location search on my webpage with google maps?

I currently have Google Maps integrated into my webpage. 我目前已将Google地图集成到我的网页中。 It is being used to tell the user where an event is (generally, it's a user submitted event). 它用于告诉用户事件在哪里(通常是用户提交的事件)。 The previous programmer put it the functionality to center the map on a latitude and longitude, if you knew it. 如果您知道的话,以前的程序员将其功能设为可将地图以经纬度为中心。 However, most people don't know the latitude and longitude of locations (sometimes they do but...), and the users want to be able to enter just a street address like you do when you go to maps.google.com . 但是,大多数人不知道位置的纬度和经度(有时他们知道……),并且用户希望能够像进入maps.google.com一样仅输入街道地址。 How can I get it to do this? 我怎样才能做到这一点?

It's called Geocoding and Google exposes public Geocoding services. 这就是地理编码,而Google公开了公共地理编码服务。

Here's a link to the Google Geocoding Developer service 这是Google Geocoding Developer服务的链接
Here's a link to Yahoo's Geocoding API . 这是Yahoo的Geocoding API的链接。

Read the docs. 阅读文档。 You'll send the address and receive back the Latitude and Longitude. 您将发送地址并收到纬度和经度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM