Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

right click context menu #227

Open
phpgraham opened this issue Jan 5, 2018 · 1 comment
Open

right click context menu #227

phpgraham opened this issue Jan 5, 2018 · 1 comment

Comments

@phpgraham
Copy link

phpgraham commented Jan 5, 2018

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

@bradcornford
Copy link
Owner

Hi there,

This looks interesting, I'll take a look into this and see if its something that fits nicely into this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants