kml - Making some placemarks visible with Google Maps API V3 -
i have kml file multiple placemarks, example below:
<placemark> <name>00550m</name> <description></description> <styleurl>#550m</styleurl> <polygon> <outerboundaryis> <linearring> <tessellate>1</tessellate> <coordinates> -019.2041,63.4130 -013.2722,57.0138 004.2309,52.4405 001.1318,49.5607 -021.0657,55.3650 -019.2041,63.4130 </coordinates> </linearring> </outerboundaryis> </polygon> </placemark>
using earth plugin can turn populate array placemarks :
if ('getfeatures' in top.mykml) { var firstchild = top.mykml.getfeatures().getfirstchild(); while(firstchild !== null){ top.myobjects.push(firstchild); firstchild = firstchild.getnextsibling(); } }
and make them visible or not :
for (var = 0; < alen; i++){ aname = top.myobjects[i].getname(); afl = (aname.substring(2, 5)); if (afl == '200'){ top.myobjects[i].setvisibility(true); } }
however, getfeatures isn't available in maps, ,
if ('featuredata' in top.mykml)
returns false.
is possible achive want do, if how. if not guess each placemark have go in single file.
thanks.
kmllayer doesn't give access objects on map.
you have 2 options can think of:
Comments
Post a Comment