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)
Raju,
Notice that geometries is plural not singular.
params.geometries = [mapPnt];
Then
You are specifying that the point SR is 4326 and then you are saying you want to project it to 4326 by using this line:
params.outSR = outSR;
???
Next you have:
params.transformation = 4326;
which is not correct. Depending on what the original points SR is and what SR you are projecting to you like do not need this at all.
Raju,
Did this info help?