I have adapted a code for finding a place, setting a graphic point and zooming into it.
//////////////////////////////////////////////////////////////////////
var myGraphic:Graphic = new Graphic();
const mapPoint:MapPoint = new MapPoint();
//mapPoint.spatialReference.wkid=3003;
mapPoint.x=parentApplication.objCmpCollections.acCollectionSite[0].latitude;
mapPoint.y=parentApplication.objCmpCollections.acCollectionSite[0].longitude;;
myGraphic.geometry = mapPoint;
//myGraphic.geometry.spatialReference.wkid=3003;
myGraphic.symbol = mySymbol;
myGraphic.id = "graphic";
myGraphicsLayer.add(myGraphic);
map.scale=15000;
map.centerAt(mapPoint);
///////////////////////////////////////////////////////////////////////////
When I am debugging it in flex builder I get a 1009 null object reference error at the last line. The map correctly displays the graphic symbol in the correct place and does the scale.
So map is not null, mapPoint is not null.
Can anybody help me in pointing out this error?
Thanks a lot for your help
Paolo, Lake Como, Italy