Grouping lines and other elements in Google Maps (JavaScript V3 API) -



Grouping lines and other elements in Google Maps (JavaScript V3 API) -

i new google maps, have missed basic. want grouping several lines, way points, locations .. logically together, can switch them on / off @ once. thought layer or overlay, still confused difference.

on playground found traffic overlay example doing want do. kind of overlay right me? , how draw line particular overlay?

a similar question google maps marker grouping doing categories on marker , more or less iterating through them switch them on/off - there no easier way?

i could, of course, maintain elements (lines, markers) of grouping in array , array represent logical group. right way?

var path = waypointstolatlngpath(mywaypoints); // generate path waypoint var line = new google.maps.polyline({ path: path, strokecolor: '#ff0000', strokeopacity: 1.0, strokeweight: 1 }); line.setmap(map);

as said in google maps api v3: how remove markers? , in comment above, v3 right approach seems to maintain arrays of overlay elements , remove them setting map null.

i have written little js "class" wrapping these aspects, can switch on/off overlays. in v2 there map.clearoverlays(), seems gone.

javascript google-maps google-maps-api-3

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -