当 GMap 卫星图像不可用时该怎么办
当卫星图像在某个缩放级别不可用时,是否可以使用谷歌地图 API(javascript,v2)以编程方式进行检测?我正在自动创建一些地图并将它们设置为特定的缩放级别,但在某些情况下,该级别没有可用的卫星图像,在这种情况下,我想自动备份缩放级别。 API 是否公开了某种确定图像缺乏的方法?
到目前为止,我唯一能想到的就是尝试使用 javascript 找出 api 发出的图像请求是否失败,然后根据这些失败的图像请求做出反应,但我无法真正做到这一点工作……似乎有点不优雅。感谢您的帮助!
is it possible to programmatically detect with the google maps api (javascript, v2) when satellite imagery is unavailable at a certain zoom level? I am creating some maps automatically and setting them to a certain zoom level, but in a few cases there is no satellite imagery available at that level, in which case I'd like to automatically back up a zoom level. Does the api expose some way of determining this lack of imagery?
So far the only thing I can think of is trying to find out, with javascript, whether or not the image requests that the api makes are failing, and then reacting based on those failed image requests, but I can't really get it to work... and it seems a little inelegant. Thanks for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没关系!看起来修复很简单:getMaxZoomAtLatLng
Nevermind! Looks like the fix is easy: getMaxZoomAtLatLng