Thursday, April 12, 2012

Create a Google Maps Context Menu


Martin Pearman has released a right-click context menu library for the Google Maps API. ContextMenu creates a menu for Google Maps that appears when users right click on the map.

The menu could be used for a whole range of user interactions. Martin has created an advanced example map where the right-click menu has been used to allow users to set the start and end points to get driving directions. The right-click menu in this example also allows the user to zoom in and out and centre the map on the clicked location.

The code for the context menu has been made available under a GNU copyleft license. Here is a direct link to the JavaScript for the menu - ContextMenu.js

2 comments:

  1. Hello,
    Is there anyway to trigger the context menu on a tablet/touch device?

    ReplyDelete
  2. I love IT...Thank you very much
    can "add marker" and editable info window for that marker be added to the menu?

    ReplyDelete