<?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" keyDown="app_keyDownHandler(event)" keyUp="app_keyUpHandler(event)"> <fx:Script> <![CDATA[ protected function app_keyDownHandler(event:KeyboardEvent):void { if (event.keyCode == Keyboard.CONTROL) { map.panEnabled = false; } } protected function app_keyUpHandler(event:KeyboardEvent):void { if (event.keyCode == Keyboard.CONTROL) { map.panEnabled = true; } } ]]> </fx:Script> <esri:Map id="map" width="100%" height="100%"> <esri:ArcGISTiledMapServiceLayer url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/> </esri:Map> </s:Application>
This is not a plug and play solution for the ESRI Flex Viewer, but you will get the idea..See Sample code below. <?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" keyDown="app_keyDownHandler(event)" keyUp="app_keyUpHandler(event)"> <fx:Script> <![CDATA[ protected function app_keyDownHandler(event:KeyboardEvent):void { if (event.keyCode == Keyboard.CONTROL) { map.panEnabled = false; } } protected function app_keyUpHandler(event:KeyboardEvent):void { if (event.keyCode == Keyboard.CONTROL) { map.panEnabled = true; } } ]]> </fx:Script> <esri:Map id="map" width="100%" height="100%"> <esri:ArcGISTiledMapServiceLayer url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/> </esri:Map> </s:Application> Drew
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.