Monday, May 31, 2010

Add a Contextual Menu to Your Google Map

ContextMenuControl Utility Library

Wolfgang Pichler has released a really cool open-sourced utility library to add a right-click contextual menu to a map developed with the Google Maps API.

The contextual menu includes options to get directions, zoom in or out, center the map and find out 'What's here?'. In fact it mirrors very closely what you get if you right click on a map at

To add the control to your own maps all you need to do is include the script tag for the source code and add the control with:
  map.addControl(new ContextMenuControl());

For more information, read through the reference and developer's guide.

Via: Google Geo Developers Blog


1 comment:

reduc 3suisses said...

I spent 3 hours looking for this feature... Thanks for this tips :)