/** * Overwrite coordinates decorations * * This example shows how to display transformed/recomputed measurements for points * - value is shown as a square root of the given coordinate * - additional text after unit is added * This is of course nonsense just for the purpose of demonstration * * 2017-11-24 Piotr Szrajber <piotr.szrajber@hexagongeospatial.com> */Sys.Application.add_init(function(){var_translate_=Intergraph.WebSolutions.Core.WebClient.Platform.Translate,_draw_=Intergraph.WebSolutions.Core.WebClient.Platform.ClientScript.Draw,pointLabelLength=200;// length of the label in pixels TODO: CHANGE HEREIntergraph.WebSolutions.Core.WebClient.Platform.ClientScript.Draw.DecorationLayer.prototype._getCoordsDecorations=function(point){vartexts=[],isGeographic=$crs.getCurrent().get_isGeographic(),unit=(isGeographic?_translate_.AbbrDegrees:_translate_.AbbrMeters)+"^½",// TODO: CHANGE HERElatIndicator=isGeographic?_translate_.AbbrLatitude:"",lonIndicator=isGeographic?_translate_.AbbrLongitude:"",format="√{0}\u0305 = {1}{2}{3}",// TODO: CHANGE HEREvalueFormatter=function(value){returnMath.sqrt(value).toFixed(2);// TODO: CHANGE HERE};texts.push(String.format(format,"x",valueFormatter(point.x),unit,latIndicator));// TODO: CHANGE HEREtexts.push(String.format(format,"y",valueFormatter(point.y),unit,lonIndicator));// TODO: CHANGE HEREreturn[new_draw_.Geometry.Label(point,null,texts[0],true,pointLabelLength),new_draw_.Geometry.Label(point,null,texts[1],true,pointLabelLength)];};});
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.