Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
He all!

Just wondering? I allow users of my web application to create a map with their own polygons, polylines and markers. (Using Google Maps API 3).

Everything seems to work just fine. However, one of my users pointed out that if they draw a polygon on the map and proceed to draw a standard marker and/or polyline, the click event does not place a marker if you click on top of a polygon fill area?

Is there a way to overcome this? I've tried to find the answer, but it seems not too many people require this complex map editing.

Greetings!
Posted

1 solution

Solved!

One simple option added to polyline and polygon properties:
Before:
PHP
var polyOptions = {
                    strokeColor: polylineColor,
                    strokeOpacity: polyLineOpacity,
                    strokeWeight: polyLineWidth
                }

After:
PHP
var polyOptions = {
                   strokeColor: polylineColor,
                   strokeOpacity: polyLineOpacity,
                   strokeWeight: polyLineWidth,
                   clickable: false
               }


Simple solution to a simple prob!
Enjoy!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900