Is it possible, via a widget or other means, to rotate the orientation of my map. By default north is at the top of the screen but I would like to be able to view my map facing E, S, W and other directions too.
Hi Bjorn
I was able to able to migrate the sample to a compiled widget.
By the way, the tool is not interacting with the map. I can rotate the "wheel" , I can click on "N" to center the weehl. But nothing happens in the map. I suspect that it's because I've ommitted the following line from the sample (I didn't figure out how to implement this part in to the widget):
<esri:center>
<esri:MapPoint x="-10051125" y="4669530"/>
</esri:center>
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
</esri:Map>
Here is my code :
<?xml version="1.0" encoding="utf-8"?>
<viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:esri="http://www.esri.com/2008/ags"
xmlns:viewer="com.esri.viewer.*"
xmlns:components="widgets.RotateMap.components.*">
<fx:Script>
<![CDATA[
import com.esri.ags.Map;
import com.esri.ags.geometry.MapPoint;
import com.esri.viewer.AppEvent;
import com.esri.viewer.utils.LocalizationUtil;
import mx.collections.ArrayCollection;
import mx.events.FlexEvent;
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<esri:Map id="map"
crosshairVisible="true"
level="17"
middleButtonRotationEnabled="true"
wrapAround180="true"
zoomSliderVisible="false">
</esri:Map>
<components:RotationWheel id="wheel"
width="75" height="75"
left="20" top="20"
change="map.rotateTo(wheel.mapRotation, wheel.mapRotation == 0)"
mapRotation="{map.mapRotation}"
skinClass="widgets.RotateMap.skins.RotationWheelSkin"/>
</viewer:BaseWidget>
Any tip on this issue?
Thanks in advance
Dilson
Question solved, I was totally misunderstanding the concept between a sample and passing into a widget format. I just had to remove the class esr:map and voila, the Rotate Wheel interacts with the my WebGIS application.