简体   繁体   English

解析Google Maps API GeoCode-服务器端还是客户端?

[英]Parsing Google Maps API GeoCode - server side or client side?

With this url: 使用此网址:

http://maps.googleapis.com/maps/api/geocode/json?latlng=31.376356,34.811039&sensor=false http://maps.googleapis.com/maps/api/geocode/json?latlng=31.376356,34.811039&sensor=false

I can obtain the type of the location (road, street etc.). 我可以获得位置的类型(道路,街道等)。

  1. Is there any other solution? 还有其他解决方案吗?
  2. If I use on server side, it's going to consume the company queries, right? 如果我在服务器端使用,它将消耗公司查询,对吗?
    • If so, doing it on client side consume the client queries? 如果是这样,在客户端执行此操作会消耗客户端查询吗?

My goal is obtaining the type of coordinate (road, street etc) preferably on server side without consume the company queries. 我的目标是在不消耗公司查询的情况下,最好在服务器端获取坐标类型(道路,街道等)。

Ideas anyone? 有任何想法吗?

Is this a website or an application that you need to hit geocoding servers on every request? 这是您需要在每次请求时访问地理编码服务器的网站还是应用程序? If so, you should use client-side. 如果是这样,则应使用客户端。

If you have some predefined latLng values then you can use server side geocoding and cache the results for a couple of hours. 如果您有一些预定义的latLng值,则可以使用服务器端地理编码并将结果缓存几个小时。 This way, you probably won't need to worry about quota. 这样,您可能无需担心配额。

From Google Developers' site: 在Google Developers网站上:

When to Use Client-Side Geocoding 何时使用客户端地理编码

The basic answer is "almost always." 基本答案是“几乎总是”。 As geocoding limits are per user session, there is no risk that your application will reach a global limit as your userbase grows. 由于地理编码限制是针对每个用户会话的,因此您的应用程序不会随着用户群的增长而达到全局限制。 Client-side geocoding will not face a quota limit unless you perform a batch of geocoding requests within a user session. 除非您在用户会话中执行一批地理编码请求,否则客户端地理编码将不会面临配额限制。 Therefore, running client-side geocoding, you generally don't have to worry about your quota. 因此,运行客户端地理编码通常不需要担心配额。

See here 这里

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

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