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

Preventing event propagation / exposing spiderfying click #158

Open
BHare1985 opened this issue Sep 3, 2018 · 0 comments
Open

Preventing event propagation / exposing spiderfying click #158

BHare1985 opened this issue Sep 3, 2018 · 0 comments

Comments

@BHare1985
Copy link

I am using trackMarker / addMarker to use the spider_click event. Within it I stop event propogation as such:

self.oms.addMarker(marker, function() {
	// do some stuff
	event.stopPropagation();
});

This works as I want it, clicks do not go to my overlays in google maps when clicking on a marker that wont spidify and also once markers get spidify, clicking on them doesnt propogate.

The issue however is the event that causes the spidify to happen still allows event propogation. I solved this by preventing it on all marker clicks:

google.maps.event.addListener(marker, "click", function() {
	event.stopPropagation();
});

Although I am not happen with this solution because I wasnt sure it would even work and also it requires me to do additional listener.

It would be super useful if this was handled natively by OMS, perhaps by some sort of setting to never propogate events. Alternatively, I couldnt find an event for spidering_click that is, the click that will cause a spidering but not an actual spider_click. I tried to recreate this by listening to all clicks and then determining if the marker was would spidery, if it would then i know it was a spidering_click , but this seems better handled by OMS to expose

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

No branches or pull requests

1 participant