AnsweredAssumed Answered

Javascript 4.4 display Point Graphics with certain wkid in basemap

Question asked by michaellodes on Aug 13, 2017
Latest reply on Aug 21, 2017 by michaellodes

Hi,

I want to display my point graphics with wkid 31468 in the standard basemap (wkid 4326). My code is below. Do I need any further transformation of my point objects? Can I work with GeometryService class for that?

 

Please help me. I'm sure its not difficult.

 

    require([
      "esri/Map",
      "esri/views/MapView",
      "esri/Graphic",
      "esri/geometry/Point",
      "esri/geometry/Polyline",
      "esri/geometry/Polygon",
      "esri/symbols/SimpleMarkerSymbol",
      "esri/symbols/SimpleLineSymbol",
      "esri/layers/FeatureLayer",
      "esri/symbols/SimpleFillSymbol",
      "dojo/domReady!"
    ], function(
      Map, MapView,
      Graphic, Point, Polyline, Polygon,FeatureLayer,
      SimpleMarkerSymbol, SimpleLineSymbol, SimpleFillSymbol
    ) {
         
      var map = new Map({
        basemap: "hybrid"
       
      });

      var view = new MapView({
        center: [10.755767, 48.179992],
        container: "viewDiv",
        map: map,
        zoom: 15
      });

      var point = new Point({
        longitude: 4407610.834,
        latitude: 5338804.822,
        spatialReference: { wkid: 31468 }
      });


      var markerSymbol = new SimpleMarkerSymbol({
        color: [226, 119, 40],
        outline: { // autocasts as new SimpleLineSymbol()
          color: [255, 255, 255],
          width: 2
        }
      });


      var pointGraphic = new Graphic({
        geometry: point,
        symbol: markerSymbol
      });

     

      view.graphics.addMany([pointGraphic]);
    });

Outcomes