我如何离线检查中国或未提供经纬度数据。

How do I offline check china or not given lat, lon data.

我可以查看中国或没有经纬度 GPS 数据吗?

如果用户留在中国那么

第一步。在离线功能

中检查lat/lon

如果为真

为中国请求 googleGeocoding API

像这样..

var chinaGoogleGeocoding="http://maps.google.cn/maps/api/geocode/json?language=en&latlng=" + pos.coords.latitude + "," + pos.coords.longitude + "&key=" + Google_API_Key;

其他

var googleGeocoding="https://maps.googleapis.com/maps/api/geocode/json?language=en&latlng=" + pos.coords.latitude + "," + pos.coords.longitude + "&key=" + Google_API_Key;

你能给我建议吗?

我检查 http://maps.google.cn 在其他国家/地区工作正常..但我只想让留在中国的用户使用它。

http://www.latlong.net

我认为中国的纬度是37开始,47结束,经度是123开始,110结束

所以...

if((pos.coords.latitude>=37 && pos.coords.latitude<=47)&& (pos.coords.latitude>=110 && pos.coords.latitude<=123)) {

//中国 var chinaGoogleGeocoding="http://maps.google.cn/maps/api/geocode/json?language=en&latlng=" + pos.coords.latitude + "," + pos.coords.longitude + "&key=" + Google_API_Key; }别的 { var googleGeocoding="https://maps.googleapis.com/maps/api/geocode/json?language=en&latlng=" + pos.coords.latitude + "," + pos.coords.longitude + "&key=" + Google_API_Key; }

对吗?

通常一个国家地区可以定义为GeoJson

一旦您定义了要使用的区域,您就可以计算您收到的坐标是否在中国的定义区域内。