Select to view content in your preferred language

Newbie need help with API 2.0

1113
12
07-12-2010 07:05 AM
MikeSavoy
New Contributor
Hi Folks,

First I am new to ARCGIS 2.0 Fex API, I am using Flash Builder 4.01
I have a running project with Google that I want to convert to ARCGIS
The problem is when I want to add throught actionscript a marker(symbol), it never show where I wanted to be
According to the examples (Adding graphics)

// This is just to show how to add markers
                // using ActionScript code as opposed to MXML tags.
                var myGraphicMarker:Graphic = new Graphic(new MapPoint(1447100, 7477200, new SpatialReference(102100)),
                                                          new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_DIAMOND, 22, 0x009933));
                myGraphicMarker.toolTip = "Marker added with ActionScript";
                myGraphicsLayer.add(myGraphicMarker);

Here where I am coming, the numbers
1447100, 7477200

I want my long lat which are -71.98, 45.33 instead of thos numbers

How can I build my own markers(symbol) with the long lat (my format) isntead of number that I don't understand how to convert them

Any clues, your support I realy appreciated

Thanks to you all

Mike
Tags (2)
0 Kudos
12 Replies
MikeSavoy
New Contributor
Just done it at Today 11:34 AM
My sample code is there
can you see it ?
Thanks
Mike
0 Kudos
DasaPaddock
Esri Regular Contributor
OK, try this:

protected function showMarker():void
   {
                                const mapPoint:MapPoint = new MapPoint(-71.56, 45.33);
    const latlong:MapPoint = WebMercatorUtil.geographicToWebMercator(mapPoint) as MapPoint;
    var myGraphicMarker:Graphic = new Graphic(latlong,
     new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_DIAMOND, 22, 0x009933));
    myGraphicMarker.toolTip = "Marker added with ActionScript";
    repeaterLayer.add(myGraphicMarker);
    myMap.centerAt(myGraphicMarker.geometry as MapPoint); 
   }
0 Kudos
MikeSavoy
New Contributor
Wow It works

Toy just made my day and I am really thankfull for your support
Many thanks again to both of you
I am a happy man

best Regards

Mike
0 Kudos