<?xml version="1.0" encoding="utf-8"?> <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" xmlns:esri="http://www.esri.com/2008/ags" minWidth="955" minHeight="600"> <fx:Script> <![CDATA[ import com.esri.ags.events.LayerEvent; import com.esri.ags.events.MapEvent; import com.esri.ags.layers.supportClasses.LOD; import mx.controls.Alert; private var LastMapExt:Extent; private var PanelShown:Boolean; protected function zoomMax_updateStartHandler(event:LayerEvent):void { if (myMap.scale == 72223.819286){ LastMapExt = myMap.extent; if(LastMapExt && !PanelShown){ PanelShown = true; Alert.show("You have reached the limit of the zoom level for this layer."); } }else{ PanelShown = false; LastMapExt = null; } } private function addLODs(event:MapEvent):void { var lods:Array = myMap.lods; lods.push(new LOD(19, 0.149291071, 564.2485881)); lods.push(new LOD(18, 0.29858214171376, 1128.4971762)); lods.push(new LOD(17, 0.59716428342752, 2256.9943525)); lods.push(new LOD(16, 1.19432856685505, 4513.988705)); lods.push(new LOD(15, 2.38865713397468, 9027.977411)); lods.push(new LOD(14, 4.77731426794937, 18055.954822)); lods.push(new LOD(13, 9.55462853563415, 36111.909643)); lods.push(new LOD(12, 19.1092570712683, 72223.819286)); lods.push(new LOD(11, 38.2185141425366, 144447.638572)); lods.push(new LOD(10, 76.4370282850732, 288895.277144)); myMap.lods = lods; } ]]> </fx:Script> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <esri:Map id="myMap" logoVisible="false" load="addLODs(event)"> <esri:extent> <esri:Extent xmin="-9598200" ymin="3968200" xmax="-9500400" ymax="4026200"> <esri:SpatialReference wkid="102100"/> </esri:Extent> </esri:extent> <esri:ArcGISTiledMapServiceLayer url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/> <esri:ArcGISDynamicMapServiceLayer id="zoomMax" alpha="1" url="http://*mylayer*/MapServer" visible="true" minScale="72223.819286" updateStart="zoomMax_updateStartHandler(event)"/> </esri:Map> </s:Application>
protected function _updateStartHandler(event:LayerEvent):void { var Layer:ArcGISDynamicMapServiceLayer = event.target as ArcGISDynamicMapServiceLayer; Alert.show("You have reached the limit of the zoom level for this layer."); } protected function myMap_panStartHandler(event:PanEvent):void { if (myMap.scale == 72223.819286) { _updateStartHandler(null) } }
<esri:Map id="myMap" logoVisible="false" load="addLODs() + onMapLoad()" level="3" extent="{initialExtent}" top="89" panStart="myMap_panStartHandler(event)" panEnd="myMap_panStartHandler(event)" panUpdate="myMap_panStartHandler(event)" >
<esri:ArcGISDynamicMapServiceLayer id="zoomMax" alpha="0" url="http://*mylayer*/MapServer" minScale="72223.819286" updateStart="_updateStartHandler(event)" />
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.