AnsweredAssumed Answered

Convert map extent to UTM

Question asked by ramjee on Jul 27, 2018
Latest reply on Dec 10, 2018 by rscheitlin

I  have a widget that calculate map extent or lat/long.

I need to convert these values to UTM (Mercator). Could you please help. I have included my code below.

 

 

define([

    'dojo/_base/declare',

    'dojo/_base/lang',

    'jimu/BaseWidget',

    'jimu/WidgetManager'

  ],

  function (

    declare,

    lang,

    BaseWidget,

    WidgetManager) {

      var clazz = declare([BaseWidget], {

 

          name: 'UrlButton',

          baseClass: 'widget-urlbutton',

          isOpening: false,

 

          onOpen: function () {

              if (!this.isOpening) {

                  this.isOpening = true;

                  //Get lat,long,scale start

                  var mapCeneter = this.map.extent.getCenter();

                  var lat = mapCeneter.getLatitude();

                  var lon = mapCeneter.getLongitude();

 

                  var minxx = this.map.extent.xmin;

                  var minyy = this.map.extent.ymin;

                  var maxxx = this.map.extent.xmax;

                  var maxyy = this.map.extent.ymax;

 

Do I have to use toUtm(point, conversionMode, addSpaces)

https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#toUtm

Outcomes