Hello I am new to the group, I hope can help me. Add bookmarks for
events, and I would remove them in the same way:
To add use:
map.addOverlay (marker1A) (a function)
To remove use:
map.removeOverlay (marker1A), (another function)
But when running the app I get the following error:
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at com.google.maps.core::MapImpl/removeOverlay()
at com.google.maps.wrappers::IMapWrapper/removeOverlay()
at index/removeMapReady()[C:\Documents and Settings\Gerick\My
Documents\Flex Builder 3\ProdeaDEMODesktop\src\index.mxml:659]
at index/restauraCancel()[C:\Documents and Settings\Gerick\My
Documents\Flex Builder 3\ProdeaDEMODesktop\src\index.mxml:620]
at index/___index_Button1_click()[C:\Documents and Settings\Gerick\My
Documents\Flex Builder 3\ProdeaDEMODesktop\src\index.mxml:161]
This is my function to create bookmarks:
private function onMapReady(event:Event):void {
this.map.setCenter(new LatLng(_latitud,_longitud), 17,
MapType.NORMAL_MAP_TYPE);
map.addControl(new NavigationControl());
map.addControl(new MapTypeControl());
map.enableScrollWheelZoom();
var ptm:String=nombreInd.text;
//Marcador en la posicion A
marker1A = new Marker(new LatLng(_markla1, _marklo1),
new MarkerOptions({
strokeStyle: {
color: 0x000000
},
fillStyle: {
color: 0xCCCCCC,
alpha: 0.8
},
label: "C",
labelFormat: {
bold: true
},
tooltip: ptm,
radius: 12,
hasShadow: false,
clickable: true,
draggable: false,
gravity: 0.1,
distanceScaling: false
}));
marker1A.addEventListener(MapMouseEvent.CLICK, function
(event:MapMouseEvent):void {
marker1A.openInfoWindow(new InfoWindowOptions
({content:_content1}));
});
map.addOverlay(marker1A);
}
This is my function to delete bookmarks:
private function removeMapReady(event:Event):void{
map.removeControl(new NavigationControl());
map.removeControl(new MapTypeControl());
marker1A=null;
map.removeOverlay(marker1A);
Both are enabled by a button. thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API For Flash" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-maps-api-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---