我可以使用谷歌地图api v3获取位置的时区吗? [英] Can I use google maps api v3 to get timezone of location?
问题描述
是否可以使用谷歌地图API来抓取时区?我已经在使用它的api进行地理编码和地图显示,我还想添加时区。但我在文档中找不到任何东西。
有什么想法?链接?
您可以使用 您可以从GoogleMaps API获取位置坐标(经度/纬度)。 Is it possible to use google maps api to grab timezone? I'm already using its api for geocoding and map display, I'd like to add timezone also. But I could not find anything in the documentation. Any ideas? links? You can use the Timezone API. For example (using jQuery) : You can get the location coordinates (latitude / longitude) from GoogleMaps API. Note you'll need a specific key to use this API. 这篇关于我可以使用谷歌地图api v3获取位置的时区吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
$。ajax({
url:https://maps.googleapis.com/maps/api/timezone/json?location=6.123123,106.213144& ; timestamp =+(Math.round((new Date()。getTime())/ 1000))。toString(),
})
.done(function(response){
if(response.data.timeZoneId!= null){
//做某事
}
});
$.ajax({
url:"https://maps.googleapis.com/maps/api/timezone/json?location=6.123123,106.213144×tamp="+(Math.round((new Date().getTime())/1000)).toString(),
})
.done(function(response){
if(response.data.timeZoneId != null){
//do something
}
});