使用Google Maps API获取业务地址 [英] Using Google Maps API to get Address of Business

查看:82
本文介绍了使用Google Maps API获取业务地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要求,我希望Google Maps API有一个解决方案。我从来没有使用过Google地图API--所以我对此很新颖。



在网站主页上有一个表单,当用户来时,我想要以下的东西发生:

1)城市字段应该填充以IP为基础的用户城市b)b)b
2)是第二个称为商店名称的字段 - 当用户开始输入商店名称时 - 我想要获取该城市中具有该名称的所有商户列表,并将其显示为下拉列表,用户可以从中选择适当的分支。没有必要在地图上显示任何内容。
Egs - 如果休斯敦的用户开始输入麦当劳,下列商家列表应该开始显示



  • 麦当劳,12皮尔兰大道,TX TX

  • 麦当劳,2600 Bary Area Blvd,休斯敦TX

  • 麦当劳,262 Clearlake Blvd,休斯敦TX



另外,当我们从Google API获取商家信息的地址时,我们是否将其作为一个字符串来获取,我们需要解析它,还是要获取不同的字段街道名称,城市,州,邮政编码等



任何信息或例子都会真正赞赏
谢谢

解决方案

我认为您不需要Google地图。首先,除了在可公开访问的网页上显示谷歌地图上的内容之外,其他任何使用条款都不允许任何其他用途,其次,还有另一种Google API完全符合您的需求:客户端位置API: http://code.google.com/apis/ajax/documentation/#ClientLocation



关于企业:您将不得不从某处获取数据 - 我不相信Google会为此提供服务。也许您可以简单地使用Google搜索API和一些逻辑来仅查找商户( http://code.google .com / apis / ajaxsearch /

编辑:我为企业,也许你可以看看这个样本: http://code.google.com/apis/ajaxsearch/samples.html# local-搜索


I have a requirement and I am hoping Google Maps API will have a solution. I have never used Google Maps API - so I am very new to this.

On the website homepage there is a form, when a user comes, I want the following things to happen:

1) The city field should be populated with users city based on IP

2) There is a second field called store name - when the user starts typing the store name - I want to fetch all business listings with that name in that city and show it as a drop down from which the user can select the appropriate branch. There is no need for anything to be shown on the map. Egs - If a user in houston starts typing McDonalds, the following business listings should start showing up

  • McDonalds, 12 Pearland Ave, Houston TX
  • McDonalds, 2600 Bary Area Blvd, Houston TX
  • McDonalds, 262 Clearlake Blvd, Houston TX

Also when we get the address for a business listing from Google API - do we get it as one String and we need to parse it or do we get it different fields Street Name, City, State, Zip code etc

Any information or examples will be really appreciated Thanks

解决方案

I don't think you want Google Maps. First of all the terms of use do not allow any use other than displaying things on a Google Map on a publicly accessible webpage, second, there is another Google API that does exactly what you need: the Client location API: http://code.google.com/apis/ajax/documentation/#ClientLocation

Concerning the "businesses": You're going to have to source that data from somewhere - I do not believe google has a service for that. Perhaps you could simply use the Google Search API and some logic to find only businesses (http://code.google.com/apis/ajaxsearch/)

EDIT: I for the businesses, perhaps you could take a look at this sample: http://code.google.com/apis/ajaxsearch/samples.html#local-search

这篇关于使用Google Maps API获取业务地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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