var myGraphicMarker:Graphic = new Graphic(new MapPoint(1447100, 7477200, new SpatialReference(102100)),
var myGraphicMarker:Graphic = new Graphic(new MapPoint(-71.98, 45.33, new SpatialReference(4326)),
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:esri="http://www.esri.com/2008/ags"
width="100%"
height="100%">
<!-- States -->
<s:states>
<s:State name="test"/>
</s:states>
<!-- WebServices, etc... -->
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
//Flex
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.core.FlexGlobals;
import mx.events.FlexEvent;
import flash.sampler.NewObjectSample;
import mx.rpc.events.ResultEvent;
//ESRI Object
import com.esri.ags.events.ExtentEvent;
import com.esri.ags.geometry.Geometry;
import com.esri.ags.geometry.MapPoint;
import com.esri.ags.geometry.Extent;
import com.esri.ags.Graphic;
import com.esri.ags.layers.TiledMapServiceLayer;
import com.esri.ags.layers.GraphicsLayer;
import com.esri.ags.SpatialReference;
import com.esri.ags.symbols.PictureMarkerSymbol;
import com.esri.ags.utils.WebMercatorUtil;
//***************************************** Affichage des repeteurs **********************************
protected function showMarker():void
{
var myGraphicMarker:Graphic = new Graphic(new MapPoint(-71.98, 45.33, new SpatialReference(4326)),
new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_DIAMOND, 22, 0x009933));
myGraphicMarker.toolTip = "Marker added with ActionScript";
repeaterLayer.add(myGraphicMarker);
myMap.centerAt(myGraphicMarker.geometry as MapPoint);
}
]]>
</fx:Script>
<!-- Map -->
<esri:Map id="myMap" level="4" load="myMap.centerAt(new MapPoint(-7133000, 4522000));" bottom="40" left="7" right="7" top="7">
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
<!-- Layer -->
<esri:GraphicsLayer id="repeaterLayer">
<esri:Graphic>
<esri:symbol>
<esri:SimpleMarkerSymbol color="0x0033DD" size="18"/>
</esri:symbol>
</esri:Graphic>
</esri:GraphicsLayer>
</esri:Map>
<s:Button label="CLICK ME" click="showMarker();" bottom="5" left="11"/>
</s:Application>
const mapPoint:MapPoint = new MapPoint(-71.56,45.33); const latlong:MapPoint = WebMercatorUtil.geographicToWebMercator(mapPoint) as MapPoint;