ATHIRA K S
ATHIRA K S

Reputation: 1

Polygons in Google Map

I construct three polygons in the google map using the help polygons in google Map API for developers site. They are look like one polygon inside an another polygon .When my page is loaded all three polygon are loaded.How can i get the inner polygon when the outer polygon is zoomed or clicked in google map?Image:polygon inside another polygon

Upvotes: 0

Views: 303

Answers (1)

ScaisEdge
ScaisEdge

Reputation: 133360

Your polygon are just place in postion that appear as one is inside another
for google maps the way you place your polygon had not a topological meaning

A easy eay for avoid that a larger polygon is over a small one could be based on z-index

assignin z-index with higher value to the polygon over the others eg:

// the larger - at base
 var polylgon1 = new google.maps.Polygon({ 
    ...
    zIndex: 100 
}); 


// the middle - at medium leve
 var polylgon2 = new google.maps.Polygon({ 
    ...
    zIndex: 200 
}); 


// the smaller  - at top leve 
 var polylgon3= new google.maps.Polygon({ 
    ...
    zIndex: 300 
}); 

Upvotes: 1

Related Questions