javascript - Only fire one click event when polyline is clicked in Google Maps (v3) -


For Google Maps V3, I have some code that has been created as a marker when a polyline was clicked. I have some code that creates markers when clicked on the map

Earlier today , when I clicked on the polyline, there was only one marker (I think this is a map click event no fire Was). Now tonight, I have not changed my code at all, and it is firing both to create polyline click events and map click events and two markers. I have no clue if Google has changed its map API between today and now or what's between today, but when I click on the polyline click to cancel the click event for the map. Does anyone know how to do this? Thanks!

Edit: 5th August OK Google! Now when the polyline is clicked, it is not firing a map event, pick it in a way and stick with it! I am pretty sure this problem is not related to my code.

You should create a separate click event. Your polyline, however, is difficult to determine for the map, Or clicked on the polyline or not. In the case of polygon, the API should not fire the map incident.

If not, you may want to apply some type of state pattern to block the code that should not be executed.


Comments