AnsweredAssumed Answered

Adding points on a dynamic map problem

Question asked by sailitang on Sep 5, 2013
Latest reply on Sep 6, 2013 by sailitang

This is my code. I would like to add a point to my dynamic map, but it doesn't work and nothing is on my map. I don't know if works on dynamic map? If not, for dynamic map, how to add a point? Thanks.

      var map;
        "esri/map", "esri/geometry/Point",
        "esri/symbols/SimpleMarkerSymbol", "esri/graphic",
        "dojo/_base/array", "dojo/dom-style", "dojox/widget/ColorPicker",
        "esri/layers/ArcGISDynamicMapServiceLayer", "dojo/domReady!"
      ], function(
        Map, Point,
        SimpleMarkerSymbol, Graphic,
        arrayUtils, domStyle, ColorPicker, ArcGISDynamicMapServiceLayer
      ) {

        map = new Map("map");
        var basemaplayer = new ArcGISDynamicMapServiceLayer(
        map.on("load", mapLoaded);
        function mapLoaded(){
          var points = [[-66.653, 45.967]];
          var initColor = "#ce641d";
          arrayUtils.forEach(points, function(point) {
            var graphic = new Graphic(new Point(point), createSymbol(initColor));
        function createSymbol(color){
          var markerSymbol = new esri.symbol.SimpleMarkerSymbol();
          markerSymbol.setColor(new dojo.Color(color));
          return markerSymbol;