AnsweredAssumed Answered

FeatureLayer wkid transformation/reproject

Question asked by michaellodes on Sep 15, 2017
Latest reply on Sep 18, 2017 by TSolow-esristaff

Hi,

 

I want to reproject my FeatureLayer with client side Point features (wkid: 31468) into my streets basemap (default wkid: 4326).

How can I do this. See me code below, there is one point in "features". There will be several thousand points in future to be displayed.

 

var map = new Map({
      basemap: "streets"

    });

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

var features = [     
          {

     geometry: new Point({
        x: 4408681.069,
        y: 5338984.143
       

      })
  }
               
];



var lyr = new FeatureLayer({
    fields: [
        {
        name: "ObjectID",
        alias: "ObjectID",
        type: "oid"
        }
    ],
    objectIdField: "ObjectID",
    geometryType: "point",
    spatialReference: { wkid: 31468 },
    source: features, 
    renderer: baumRenderer //custom renderer
 
});

map.add(lyr);

 

Thank you very much for your help.

 

Michael

Outcomes