I have 3 ShapeCollections on the map. One I want to stay there all the time. The other two I want to toggle on/off.
after removing the shapecollection the first time, map.addShapeCollection(myShapeColl) adds it to the map again (in debug variables), but the collection is not visible on the map. How do I make it show up again?
I don't want to call map.removeShapes() at the start of the toggle because I don't want it to remove my poi markers each time the other shapecollections are toggled.
Here is the toggle code I'm using below. Any ideas?
Thanks,
Don
private function toggleKML():void {
//map.removeShapes();
if (btnKML.label == "Show Areas") {
if(myKMLColl){
myShapeColl = new ShapeCollection();
myShapeColl = myKMLColl;
map.addShapeCollection(myShapeColl);
btnKML.label = "Hide Areas";
}
else {
createKML();
}
}
else {
//remove the remote collection
map.removeShapeCollection(myShapeColl);
btnKML.label = "Show Areas";
}
}
private function toggleKML_LAB():void {
//map.removeShapes();
if (btnKML_LAB.label == "Show Area Names") {
if(myKMLColl_LA

{
map.removeShapeCollection(myShapeColl_LA

;
myShapeColl_LAB = new ShapeCollection();
myShapeColl_LAB = myKMLColl_LAB;
map.addShapeCollection(myShapeColl_LA

;
btnKML_LAB.label = "Hide Area Names";
}
else {
createKML_LAB();
}
}
else {
//remove the remote collection
map.removeShapeCollection(myShapeColl_LA

;
btnKML_LAB.label = "Show Area Names";
}
}