Convert ArcGis Geographic coordinates Lat Long wkid: 4326 to predicted coordinates wkid: 102000/3857

When using the JS ArcGis API, you can create a point in ArcGis with lat and for a long time as

var testPoint = new Point(-98, 38);

or

var testPoint = new Point(-98, 38, new SpatialReference({ wkid: 4326 }));

and convert it to another SR so that its x and y are changed automatically? For instance. to wkid 102000/3857?

CONTEXT: (maybe you can find a workaround)

I use heatmap.js to draw heatmapLayers on ArcGis maps. I found several examples and the way this API uses data uses a variable datain the following format:

var data = [
  {
    attributes: {},
    geometry: {
      spatialReference: { wkid: ****},
      type: "point",
      x: -40,
      y: 50
    }
  },
  {another point....}
];

The API itself does some sorting on a variable dataand then uses this method

screenGeometry = esri.geometry.toScreenGeometry(this._map.extent, this._map.width, this._map.height, parsedData.data[xParsed][yParsed].dataPoint);

to convert the analyzed point ( parsedData.data[xParsed][yParsed].dataPoint) before finally drawing a heat map.

, , wkid (**** ), wkid: 102000, .

, esri.geometry.toScreenGeometry , , , wkid.

,

+4
1

esri.geometry.toScreenGeometry - , , - (.. ), , HTML .

, , esri.geometry.webMercatorUtils.geographicToWebMercator, lat/long 102100 ( 3857) , ESRI JS. docco:

require([
  "esri/geometry/webMercatorUtils", ... 
], function(webMercatorUtils, ... ) {
  var geom = webMercatorUtils.geographicToWebMercator(candidate.location);
  ...
});

(, SO, " ", / . , , t .:))

+6

All Articles