I’m looking for some help with a Google Maps implementation. I have to code (JS) a “Smart InfoBox/Bubble” that positions itself intelligently in relation to the marker and that marker’s position relative to the edge of the Map View.
VW does this in their Locator:
http://goo.gl/hiyfk
Example Screenshot: (Bubble Opens Top Left) http://screencast.com/t/OAqehpfNf8
Example Screenshot: (Bubble Opens Top Right) http://screencast.com/t/aqKM2nGZyR
I’m basically looking for which objects I should target to run the calculations on, I’m not ideally up to speed on the GoogleMaps API.
The basic function in my mind should be to get the marker position and then decide which MapView quadrant its in and then pop the InfoBox up in the direction that makes the most sense. Eg. Marker in the NW quadrant = InfoBox to the SE.
Any help pointing me in the right direction is greatly appreciated.
The Google Maps Demo Gallery contains a SmartInfoWindow demo that does pretty much exactly what you are describing. If you check that out and poke around in the code, you should be pretty well on your way