|
POST
|
An ArcGIS Server 10 layer can include a Renderer in the Drawing Info. e.g. http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/MapServer/0 The Flex API's FeatureLayer will use this by default. If you're using a layer that does not have any Drawing Info, then the default symbology is used. You can set a renderer or symbol on the FeatureLayer since these properties are inherited from GraphicsLayer: http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/GraphicsLayer.html
... View more
07-29-2010
01:10 PM
|
0
|
0
|
1761
|
|
POST
|
See: http://forums.arcgis.com/threads/8762-WGS-1984-Web-Mercator-(Auxiliary-Sphere)-WKID-102100
... View more
07-29-2010
11:27 AM
|
0
|
0
|
1139
|
|
POST
|
Since it's a bindable property you can use the ChangeWatcher.watch() method. Reference: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/binding/utils/ChangeWatcher.html
<?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">
<s:layout>
<s:VerticalLayout horizontalAlign="center"/>
</s:layout>
<fx:Script>
<![CDATA[
import mx.binding.utils.ChangeWatcher;
import mx.collections.ArrayCollection;
import mx.events.FlexEvent;
protected function button1_clickHandler(event:MouseEvent):void
{
dynLyr.visibleLayers = new ArrayCollection([ 5 ]);
}
protected function dynLyr_initializeHandler(event:FlexEvent):void
{
ChangeWatcher.watch(dynLyr, "visibleLayers", updateVisibilty);
}
protected function updateVisibilty(event:Event):void
{
trace(event);
}
]]>
</fx:Script>
<s:Button click="button1_clickHandler(event)" label="Update Visible Layers"/>
<esri:Map id="map">
<esri:ArcGISDynamicMapServiceLayer id="dynLyr"
initialize="dynLyr_initializeHandler(event)"
url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer"/>
</esri:Map>
</s:Application>
... View more
07-29-2010
08:26 AM
|
0
|
0
|
859
|
|
POST
|
When I try your code, there are many features being returned from both layers, but the code is only using the first one. Line 76: var result:IdentifyResult = results[0]; If you add a breakpoint on this line and run the debugger, it should stop here and then you can inspect the results Array to see all the results. Another way to debug this is to use a tool like HttpFox to see the request and response and you can open the urls in a new tab and change f=json to f=html to see the results in the Service Directory. You may want to consider having a DataGrid for each layer where you can view the attributes for all the features that are returned. I'd also recommend setting identifyParams.returnGeometry to false if you're not going to add the features being returned to the map. This will improve the performance.
... View more
07-28-2010
04:02 PM
|
0
|
0
|
572
|
|
POST
|
To get the features from a FeatureLayer, you can use the inherited graphicProvider property: http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/GraphicsLayer.html#graphicProvider FeatureSet.attributes is really nothing more than the extractAttributesFromFeatures function Rene has posted. You could get the attributes like this: var attributes:Array = new FeatureSet(ArrayCollection(featureLayer.graphicProvider).toArray()).attributes; Reference: http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/FeatureSet.html#attributes
... View more
07-28-2010
09:32 AM
|
0
|
0
|
1835
|
|
POST
|
Small correction since FeatureSet.attributes is an Array featureSet.attributes[0]["field name"]; // gets the value of a field from the first feature This is the same as: featureSet.features[0].attributes["field name"]
... View more
07-28-2010
09:11 AM
|
0
|
0
|
1079
|
|
POST
|
See http://forums.arcgis.com/threads/8509-Bing-or-Open-Street-Map-and-Flex-Viewer2
... View more
07-28-2010
09:06 AM
|
0
|
0
|
817
|
|
POST
|
I'd try the IdentifyTask where the IdentifyParameters.layerOption is set to IdentifyParameters.LAYER_OPTION_ALL and set the IdentifyParameters.layerIds to the id's of the two layers you want to get the attributes for. Reference: http://resources.esri.com/help/9.3/arcgisserver/apis/flex/apiref/com/esri/ags/tasks/IdentifyParameters.html
... View more
07-27-2010
03:49 PM
|
0
|
0
|
572
|
|
POST
|
Hi Joey, I took a look at this with a REST expert and was told that you'll need to publish a raster catalog as part of a geodatabase and to make sure that you have a Date field selected for the start time field. Currently your layers have no fields. You may want to contact http://support.esri.com for more help with getting this set up.
... View more
07-27-2010
03:25 PM
|
0
|
0
|
781
|
|
POST
|
Here's an example. I've modified IdentifySample.mxml to use a 10.0 service.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:esri="http://www.esri.com/2008/ags">
<mx:Script>
<![CDATA[
import com.esri.ags.Graphic;
import com.esri.ags.events.MapMouseEvent;
import com.esri.ags.symbol.InfoSymbol;
import com.esri.ags.tasks.IdentifyParameters;
import com.esri.ags.tasks.IdentifyResult;
import mx.controls.Alert;
import mx.rpc.AsyncResponder;
private function mapClickHandler(event:MapMouseEvent):void
{
clickGraphicsLayer.clear();
var identifyParams:IdentifyParameters = new IdentifyParameters();
identifyParams.returnGeometry = true;
identifyParams.tolerance = 3;
identifyParams.width = myMap.width;
identifyParams.height = myMap.height;
identifyParams.geometry = event.mapPoint;
identifyParams.mapExtent = myMap.extent;
identifyParams.spatialReference = myMap.spatialReference;
var clickGraphic:Graphic = new Graphic(event.mapPoint, clickPtSym);
identifyTask.execute(identifyParams, new AsyncResponder(myResultFunction, myFaultFunction, clickGraphic));
clickGraphicsLayer.add(clickGraphic);
}
private function myResultFunction(results:Array, clickGraphic:Graphic = null):void
{
if (results && results.length > 0)
{
var result:IdentifyResult = results[0];
var resultGraphic:Graphic = result.feature;
// update clickGraphic (from mouse click to returned feature)
clickGraphic.symbol = new InfoSymbol(); // use default renderer
clickGraphic.attributes = resultGraphic.attributes;
}
}
private function myFaultFunction(error:Object, clickGraphic:Graphic = null):void
{
Alert.show(String(error), "Identify Error");
}
]]>
</mx:Script>
<!-- start declarations -->
<!-- Symbol for where the user clicked -->
<esri:SimpleMarkerSymbol id="clickPtSym" style="x" color="0xFF0000" size="12"/>
<!-- Identify Task -->
<esri:IdentifyTask id="identifyTask"
concurrency="last"
url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/MapServer?layerDefs=0:magnitude > 5"/>
<!-- end declarations -->
<esri:Map id="myMap" mapClick="mapClickHandler(event)" openHandCursorVisible="false">
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer"/>
<esri:ArcGISDynamicMapServiceLayer url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/MapServer">
<esri:layerDefinitions>
<mx:String>magnitude > 5</mx:String>
</esri:layerDefinitions>
</esri:ArcGISDynamicMapServiceLayer>
<esri:GraphicsLayer id="clickGraphicsLayer"/>
</esri:Map>
</mx:Application>
... View more
07-27-2010
01:47 PM
|
0
|
0
|
1036
|
|
POST
|
Hi Robert, Here's a sample that gives me two events. Hope this helps...
<?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">
<s:layout>
<s:VerticalLayout horizontalAlign="center"/>
</s:layout>
<fx:Script>
<![CDATA[
import com.esri.ags.events.LayerEvent;
import mx.events.CollectionEvent;
protected function dynLyr_loadHandler(event:LayerEvent):void
{
dynLyr.visibleLayers.addEventListener(CollectionEvent.COLLECTION_CHANGE, updateVisibilty);
}
protected function updateVisibilty(event:CollectionEvent):void
{
trace(event);
}
protected function button1_clickHandler(event:MouseEvent):void
{
dynLyr.visibleLayers.removeAll();
dynLyr.visibleLayers.addItem(5);
}
]]>
</fx:Script>
<s:Button label="Update Visible Layers" click="button1_clickHandler(event)"/>
<esri:Map id="map">
<esri:ArcGISDynamicMapServiceLayer id="dynLyr"
load="dynLyr_loadHandler(event)"
url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer"/>
</esri:Map>
</s:Application>
Trace: [CollectionEvent kind="reset" location=-1 oldLocation=-1 type="collectionChange" bubbles=false cancelable=false eventPhase=2] [CollectionEvent kind="add" location=0 oldLocation=-1 type="collectionChange" bubbles=false cancelable=false eventPhase=2]
... View more
07-27-2010
01:09 PM
|
0
|
0
|
859
|
|
POST
|
Have you put a crossdomain.xml file at http://gisweb2/crossdomain.xml ?
... View more
07-27-2010
12:34 PM
|
0
|
0
|
554
|
|
POST
|
See: http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/ArcGISDynamicMapServiceLayer.html#exportMapImage()
... View more
07-27-2010
12:09 PM
|
0
|
0
|
2716
|
|
POST
|
If you're using PictureMarkerSymbols, then the Graphic has a child and you get mouseOver events for it as well that bubble up to the Graphic. A simple alternative is to use the rollOver/Out events instead. Another option is to check the event's target. Reference: http://livedocs.adobe.com/flex/3/langref/flash/display/InteractiveObject.html#event:rollOut
... View more
07-27-2010
11:48 AM
|
0
|
0
|
624
|
|
POST
|
Version 2 of the API still supports ArcGIS Server 9.3. Also, in version 2, you can now place the ScaleBar like any other component outside of the Map. e.g.
<?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">
<s:layout>
<s:VerticalLayout horizontalAlign="center"/>
</s:layout>
<esri:Map id="map" scaleBarVisible="false">
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
</esri:Map>
<esri:ScaleBar map="{map}"/>
</s:Application>
... View more
07-16-2010
11:22 AM
|
0
|
0
|
2501
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-06-2017 01:13 PM | |
| 2 | 03-06-2017 02:12 PM | |
| 1 | 06-22-2010 12:01 PM | |
| 1 | 08-06-2012 09:29 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-15-2025
04:18 PM
|