在google地图API中显示地板选择器 [英] Showing floor picker in google maps api for javascript

查看:234
本文介绍了在google地图API中显示地板选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将Google Maps API用于android或ios时,似乎默认启用室内地图,并且在放大具有室内地图的建筑物时,会自动显示地板选取器控件。如何在JavaScript的Google Maps API中获得类似的功能(即以桌面浏览器为目标)?特别是,我想展示一个楼层选取器控件,并且可以像在maps.google.com上一样在层楼之间进行更改。 解决方案

Google目前在Javascript API中不支持此功能。



这三个问题都得到Google的回应,称它是增强,这可能意味着它们有时会添加:

https://code.google.com/p/gmaps-api-issues/issues/detail?id=6642

https://code.google.com/p/gmaps-api-issues/issues/detail?id=6792 < a>

https:// code.google.com/p/gmaps-api-issues/issues/detail?id=6783



我知道的唯一解决方法是手动添加您自己的地板选取器,然后添加eac h floor作为ImageMapType并在它们之间切换。不幸的是,这要求您自己提供所有的场景图像,而不是使用Google的。



ImageMapType文档: https://developers.google.com/maps/documentation/javascript/examples/maptype-image-overlay


When using the Google Maps API for android or ios it seems that the indoor maps are enabled by default and the "floor picker" control automatically appears when you zoom in to a building that has indoor maps. How can I get similar functionality in the Google Maps API for javascript (i.e. targetted at a desktop browser)? In particular, I would like to show a floor picker control and be able to change between floors just like at maps.google.com.

解决方案

Google doesn't support this in the Javascript API currently.

These three issues all have responses from Google stating that it's an "Enhancement", which may mean they'll add it sometime:
https://code.google.com/p/gmaps-api-issues/issues/detail?id=6642
https://code.google.com/p/gmaps-api-issues/issues/detail?id=6792
https://code.google.com/p/gmaps-api-issues/issues/detail?id=6783

The only workaround I'm aware of is to manually add your own floor picker, then add each floor as an ImageMapType and switch between them. Unfortunately, this requires you to provide all of the floor imagery yourself rather than use Google's.

ImageMapType docs: https://developers.google.com/maps/documentation/javascript/examples/maptype-image-overlay

这篇关于在google地图API中显示地板选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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