Select to view content in your preferred language

Can't move infoSymbol with EditTool

668
0
11-05-2012 08:53 AM
stevemclaughlin
Occasional Contributor
All other graphics I can move with the editTool, but the infoSymbol doesn't want to move, also when I move a simpleMarkerSymbol, the infosymbol moves with it????!@?
run the program, hit the button and when you mouse over the infoSymbol the cursor changes to the move icon(4 arrows), click on the infoSymbol, but it refuses to move.   If you try moving the SimpleMarkerSymbol located over California, the infoSymbol located over Mongolia moves as well. WTF?
thanks,
Steve


[HTML]<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:mx="library://ns.adobe.com/flex/mx"
      xmlns:esri="http://www.esri.com/2008/ags"
      xmlns:s="library://ns.adobe.com/flex/spark"
      pageTitle="Basic InfoSymbol example">

<fx:Script>
  <![CDATA[
   import com.esri.ags.tools.EditTool;

   protected function editMode(event:MouseEvent):void
   {
    var myEditTool:EditTool = new EditTool(myMap);
    myEditTool.activate(EditTool.MOVE, [gr1,ca]);
   }
  ]]>
</fx:Script>
<fx:Declarations>
  <esri:InfoSymbol id="infoSymbol1">
   <esri:infoRenderer>
    <fx:Component>
     <s:DataRenderer>
      <s:layout>
       <s:VerticalLayout/>
      </s:layout>
      <s:Label text="{data.myTitle}"/>
     </s:DataRenderer>
    </fx:Component>
   </esri:infoRenderer>
  </esri:InfoSymbol>
</fx:Declarations>

<esri:Map id="myMap">
  <esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
  <esri:GraphicsLayer  >
   <esri:Graphic id="gr1"  symbol="{infoSymbol1}" >
    <esri:geometry>
     <esri:MapPoint x="11945000" y="6074000"/>
    </esri:geometry>
    <esri:attributes>
     <fx:Object>
      <fx:myTitle>Mongolia</fx:myTitle>
     </fx:Object>
    </esri:attributes>
   </esri:Graphic>
   <esri:Graphic id="ca"  >
    <esri:geometry>
     <esri:MapPoint x="-13163000" y="4035000" />
    </esri:geometry>
    <esri:symbol>
     <esri:SimpleMarkerSymbol color="0x0033DD" size="18"/>
    </esri:symbol>
   </esri:Graphic>
  </esri:GraphicsLayer>
</esri:Map>
<s:Button label="move items" click="editMode(event)"  top="50" left="100"/>
</s:Application>[/HTML]
Tags (2)
0 Kudos
0 Replies