/** * Modify coordinates formatting for EPSG:4326 to decimal minutes * 2018-01-25 Piotr Szrajber <piotr.szrajber@hexagongeospatial.com> */Sys.Application.add_init(function(){// not sure about the computations, this is just an example :)functionformat(deg){varseconds=Math.round(Math.abs(deg)*360000),degrees=Math.floor(seconds/360000),minutes=(seconds-degrees*360000)/6000;returnString.format("{0}{1}\u00B0{2}",deg<0?"-":"",degrees,minutes.toFixed(4));}varorig=Intergraph.WebSolutions.Core.WebClient.Controls.Map.MapControl.prototype._updateCoords;Intergraph.WebSolutions.Core.WebClient.Controls.Map.MapControl.prototype._updateCoords=function(x,y){// x and y are in units of the CRSif($crs.getCurrent().get_id()==="EPSG:4326"){$(this._coordsDiv).html("LON:"+format(x)+", "+"LAT"+format(y));}else{orig.call(this,x,y);}};});
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.