Two questions:1 - how do you change the text style for the units. I have tried several things and can't get it to work correctly. The basic problem is the font for the units is a different size than any of the other text on the form.2 - is it possible to get projected coordinates from the maps rather than just longitude and latitude? All of our maps are in state plane coordinate systems.Thanks,Bryan
dojo.connect(measurement, "onMeasureEnd", function (toolName, geometry) { if (toolName == "location") { var resultValue = measurement.resultValue.domNode.innerHTML; var stateCoords = "XY: " + Math.round(geometry.x).toString() + ", " + Math.round(geometry.y).toString(); measurement.resultValue.domNode.innerHTML = resultValue + "<br /><br />" + stateCoords; } });
@btfou - I think you misunderstood - I'm not wanting to hack/steal their code. I simply want to extend it (fairly common for Silverlight API). I am also not opposed to writing my own - which maybe where I end up - I just need something quick and would prefer to stick with OOTB functionality. I have been down the custom road before and been burned too many times.
outSR = new esri.SpatialReference({wkid:102100}); // change with your map spatialReference dojo.connect(measurement, "onMeasureEnd", function(activeTool,geometry){ esri.config.defaults.geometryService.project([geometry], outSR, function (projectedPoints) { var contentPane = dojo.byId("dijit_layout_ContentPane_1"); contentPane.innerHTML = "X: " + projectedPoints[0].x + "<br> Y: " + projectedPoints[0].y }); });
/* COPYRIGHT 2009 ESRI TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL Unpublished material - all rights reserved under the Copyright Laws of the United States and applicable international laws, treaties, and conventions. For additional information, contact: Environmental Systems Research Institute, Inc. Attn: Contracts and Legal Services Department 380 New York Street Redlands, California, 92373 USA email: contracts@esri.com */
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.