zeeshangrw

Loading PictureMarkerSymbol

Discussion created by zeeshangrw on Oct 17, 2010
Latest reply on Oct 19, 2010 by manamlogica
I am new to ArcGIS API for Javascript. I am trying to add graphics. which includes Image,line,polygon. I am trying the reference link

http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm

I am stuck while trying to load line using desired positions longitude and latitude. Kindly if some one can help me out with some code modification that what i m missing here ?. i m putting my code in which i m loading Line..Later In the case of succeed i will load rest of graphics.Thanks


<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.1"></script>
    <script type="text/javascript">
        dojo.require("esri.map");
        dojo.require("esri.graphic");

            function init() {
            var initExtent = new esri.geometry.Extent({ "xmin": 5129249.759455201, "ymin": 3361184.138260187, "xmax": 5520607.344275116, "ymax": 3463304.0080491337, "spatialReference": { "wkid": 102100} });
            var map = new esri.Map("map", { extent: initExtent });
            dojo.connect(map, "onload", Draw_Symbol());
         
            var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
            map.addLayer(tiledMapServiceLayer);         

        }
  function Draw_Symbol() {
            var pt = new esri.geometry.Point(47.249625077193045, 29.526414016317314, map.spatialReference)
            var sms = new esri.symbol.SimpleMarkerSymbol().setStyle(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE).setColor(new dojo.Color([255,0,0,0.5]));
            var attr = {"XCoord":evt.mapPoint.x,"YCoord":evt.mapPoint.y,"Plant":"Mesa Mint"};
            var infoTemplate = new esri.InfoTemplate("Vernal Pool Locations","Latitude: ${YCoord},Longitude: ${XCoord} Plant Name:${Plant}");
            var graphic = new esri.Graphic(pt,sms,attr,infoTemplate);            
              //tried map.graphics.add(graphics); but error
             }

        dojo.addOnLoad(init);
</script>


Regards,
Zeeshan

Outcomes