设置地图控件的crosshair样式 彻底删除Esri的logo
发布时间:2020-12-15 03:36:35 所属栏目:百科 来源:网络整理
导读:?xml version="1.0" encoding="utf-8"? !-- ?设置地图控件的crosshair样式; ?彻底删除Esri的logo ?-- !-- Copyright (c) 2010-2011 《ArcGIS Server开发指南——基于Flex和.NET》练习代码 完整的代码工程可以从 http://www.geocommon.net 下载 ?-- s:Applic
<?xml version="1.0" encoding="utf-8"?> <!-- ?设置地图控件的crosshair样式; ?彻底删除Esri的logo ?--> <!-- Copyright (c) 2010-2011 《ArcGIS Server开发指南——基于Flex和.NET》练习代码 完整的代码工程可以从 http://www.geocommon.net 下载 ?--> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"? ? xmlns:s="library://ns.adobe.com/flex/spark"? ? xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="655" minHeight="500"? ? xmlns:esri="http://www.esri.com/2008/ags"> <fx:Declarations> <!-- Place non-visual elements (e.g.,services,value objects) here --> </fx:Declarations> <esri:Map id="map" openHandCursorVisible="true" panDuration="6000" ? ?load="loaded();" crosshairVisible="true" logoVisible="false"> <esri:ArcGISDynamicMapServiceLayer? url="http://localhost/ArcGIS/rest/services/Florida/MapServer" /> </esri:Map> <fx:Script> <![CDATA[ import com.esri.ags.events.ZoomEvent; import mx.controls.Alert; import mx.core.UIComponent; private function loaded():void { map.setStyle("crosshairLength",15); map.setStyle("crosshairWidth",1); map.setStyle("crosshairColor",0xff0000); map.setStyle("crosshairAlpha",0.8); } private function RemoveLogo():void { for(var i:Number=0; i<map.numChildren;i++) { var component:UIComponent = map.getChildAt(i) as UIComponent; if(component != null) { if(component.className == "StaticLayer") { for(var j : int = 0 ; j < component.numChildren ; j++){ var stComponent : UIComponent = component.getChildAt(j) as UIComponent; if(stComponent.className == "Image"){ stComponent.visible = false; return; } } } } } } ]]> </fx:Script> </s:Application>
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |