Google将API:从CID引用到参考? [英] Google places API: from CID to reference?

查看:141
本文介绍了Google将API:从CID引用到参考?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目标是:用已知的商业场所填充数据库,以便与这些地方生成地图。我坚持知道的地方,因为我的用户只会搜索数据库中的地方。



我不想重新创建商家地点作为标记(因此经纬度不足以识别某个地方),因为这些地点已经在Google地图上提供了有趣的信息(地址,评论,评分,图片......)。

自然的引用是使用CID并将其存储在数据库中。现在想象一下,数据库是由地点和CID组成的,而我想要将那些地点的地图生成为可点击的标记。当用户点击标记时,她访问商业地点的页面,例如 http://maps.google.com/maps/place?cid=998657413562662319 。太好了!

但是如何生成这些地图呢?我没有数据库中的坐标(假设)。我无法使用Google Places API(这会给我坐标),因为它使用不同的参考,来检索业务的位置以生成地图。



有什么想法?

非常感谢!



澄清:我想使用Google Maps API来生成包含我知道CID的许多商业地点的地图。这与Google中的我的地图相当。只有我想将这些地方存储在我的数据库中。



潜在解决方案:对于数据库中的每个商家,和坐标。编写一个脚本,使用Google Places在特定坐标处查找企业。循环响应数组(JSON / XML),直到找到与搜索到的业务对应的CID的响应。将Google Places参考存储到数据库中。对每个新增业务重复此脚本。麻烦...

解决方案

这是你在找什么?
http://maps.google.com/maps?cid=998657413562662319

如果您想在地图上使用多个cid,它看起来像是最佳选择:
http://maps.google.com/maps?cid=998657413562662319&q=a&output=json


My objective: populate a database with known business places in order to generate maps with those places. I insist on "known places", because my users will only search for the places that are in the database.

I don't want to recreate business places as markers on the map (so latitude and longitude is not enough to id a place), because the places are already available on Google Maps with interesting information (address, comments, ratings, pictures...).

The natural reference is to use the CID and store it in the database.

Now imagine the database is populate with places and their CID, and I want to generate maps with those places as click-able markers. When the user clicks on the marker, she access the business place's page, e.g. http://maps.google.com/maps/place?cid=998657413562662319. Great!

But how to generate those maps? I don't have the coordinates in the database (assumption). And I cannot use Google Places API (which would give me the coordinates), because it uses a different reference, to retrieve the location of the business so as to generate the maps.

Any ideas?

Thanks a lot!

To clarify: I want to use Google Maps API to generate a map with many business places of which I know the CID. It is comparable to "my maps" in Google. Only that I want to store the places in my database.

Potential solution: For each business in the database, store the name, CID, and coordinates. Write a script that uses Google Places to find businesses at specific coordinates. Loop through the response array (JSON/XML) until the response with the CID corresponding to the searched business is found. Store the Google Places reference into the database. Repeat this script for each newly added business. Cumbersome...

解决方案

Is this what you are looking for? http://maps.google.com/maps?cid=998657413562662319

It looks like your best option if you want more than one cid on a map is to use: http://maps.google.com/maps?cid=998657413562662319&q=a&output=json

这篇关于Google将API:从CID引用到参考?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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