AnsweredAssumed Answered

mapandcenter zoom to the wrong location

Question asked by lkoumis on Nov 15, 2015
Latest reply on Nov 15, 2015 by oearley

I have this script that defines a point, it draws the point at the correct location but it centers the map at the wrong place! Why?

 

Thanks.

 

startup: function() {

      this.inherited(arguments);

    

  pointSymbol = new SimpleMarkerSymbol(

  SimpleMarkerSymbol.STYLE_CIRCLE, 10,

  new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0, 0, 0]), 1),

  new Color([0, 204, 0])

  );

  myGraphicPoint = new Point([-121.07462622, 38.90015662]);

  myGraphicMarker = new Graphic(myGraphicPoint, pointSymbol);

  myGraphicMarker.setAttributes({"name":"Project Spot"});

  myGraphicsLayer = new GraphicsLayer();

  myGraphicsLayer.add(myGraphicMarker);

  this.map.addLayer(myGraphicsLayer);

      this.map.centerAndZoom(myGraphicPoint.geometry, 8);

    },

Outcomes