Skip to content

ffflabs/google-maps-api-contextmenu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

google-maps-api-contextmenu

This is a fork of Martin Pearman's ContextMenu

A contextMenu for google.maps.api v3

usage:

var menuStyle = {
		menu: 'context_menu',
		menuSeparator: 'context_menu_separator',
		menuItem: 'context_menu_item'
	};

	var contextMenuOptions  = {
		id: "map_rightclick",
		eventName: "menu_item_selected",
		classNames: menuStyle,
		menuItems: 
		[
		   {label:'option1', id:'menu_option1'},
		   {label:'option2', id:'menu_option2'},
		]
	};

var contextMenu = new google.maps.ContextMenu(map, contextMenuOptions, function() {
      console.log('optional callback');
});
google.maps.event.addListener(map, 'rightclick', function(mouseEvent) {
  contextMenu.show(mouseEvent.latLng);
});

About

A contextMenu for google.maps.api v3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published