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
Post a Comment