You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to easily add ability to do a right click context menu, eg:
would like to add this using your code style, so that it becomes another option with definable features.
I've used this method before to add polygons, circles, markers, center here options at point of right click.
so far i have amended the map.blade.php file adding the following to the initialize function:
/** Create the menu and attached it to the map */
var menu = new contextMenu({map:map_{!! $id !!}});
// Add some items to the menu
menu.addItem('Zoom In', function(map, latLng){
map.setZoom( map.getZoom() + 1);
map.panTo( latLng );
});
menu.addItem('Zoom Out', function(map, latLng){
map.setZoom( map.getZoom() - 1 );
map.panTo(latLng);
});
menu.addItem('Create Polygon', function(map, latLng){
// TODO - add code to start editable polygon here
});
menu.addItem('Create Circle', function(map, latLng){
// TODO - add code to create editable circle here
});
menu.addItem('Add Marker', function(map, latLng){
// TODO - add code to create marker here
});
menu.addSep();
menu.addItem('Center Here', function(map, latLng){
map.panTo(latLng);
});
then including the js and css files to my app.blade.php file
that worked the context menu appears, would be nice to fully integrate this with your code to be more definable via config arrays
The text was updated successfully, but these errors were encountered:
Not an issue, more a request..
Is there a way to easily add ability to do a right click context menu, eg:
would like to add this using your code style, so that it becomes another option with definable features.
I've used this method before to add polygons, circles, markers, center here options at point of right click.
an example of context menu is here:
https://github.com/gizzmo/Gmaps-Context-Menu
so far i have amended the map.blade.php file adding the following to the initialize function:
/** Create the menu and attached it to the map */
var menu = new contextMenu({map:map_{!! $id !!}});
// Add some items to the menu
menu.addItem('Zoom In', function(map, latLng){
map.setZoom( map.getZoom() + 1);
map.panTo( latLng );
});
menu.addItem('Zoom Out', function(map, latLng){
map.setZoom( map.getZoom() - 1 );
map.panTo(latLng);
});
menu.addItem('Create Polygon', function(map, latLng){
// TODO - add code to start editable polygon here
});
menu.addItem('Create Circle', function(map, latLng){
// TODO - add code to create editable circle here
});
menu.addItem('Add Marker', function(map, latLng){
// TODO - add code to create marker here
});
menu.addSep();
menu.addItem('Center Here', function(map, latLng){
map.panTo(latLng);
});
then including the js and css files to my app.blade.php file
that worked the context menu appears, would be nice to fully integrate this with your code to be more definable via config arrays
The text was updated successfully, but these errors were encountered: