Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing floor picker in google maps api for javascript

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.

like image 679
Alex Flint Avatar asked Apr 20 '14 20:04

Alex Flint


1 Answers

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

like image 165
Allan Wintersieck Avatar answered Nov 15 '22 01:11

Allan Wintersieck