|
POST
|
David, SDK - software development kit (Flex SDK) API - application programming interface (ArcGIS API for flex) (Google Maps API for Flash) Application - some product, built on SDK using API (The ArcGIS Viewer for Flex is a ready-to-deploy viewer application) MapManager.mxml is a part of ArcGIS Flex Viewer Application.
... View more
03-27-2012
09:22 AM
|
0
|
0
|
706
|
|
POST
|
eddie, from your code: 1 - query �?? 1 - params - execute - parse results (for ex. 10 results) 2 - query �?? 2 - params (1 of 10) - execute - parse result - add to graphics layer 3 - query �?? 3 - params (2 of 10) - execute - parse result - add to graphics layer 4 - query �?? 4 - params (3 of 10) - execute - parse result - add to graphics layer ... ~ minimum 11 requests to server, as a result you need to parse minimun 11 responses ... (what happens if first query returns 500 features :cool:) if you have 2 layers, maximum number of queries is 2, non more: 1 - query �?? 1 - params - execute - parse results (for ex. 10 results) - collect params (where clause, or geometry union ...) for second query - hold result as class vaiable, or use as token in second query 2 - query �?? 2 - collected params - execute - parse result - combine with first query results - add to graphics layer try it (code is illustrative): <?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:ags="http://www.esri.com/2008/ags">
<!-- Adobe Flex SDK 4.6.0 -->
<!-- ArcGIS API for Flex 2.5 -->
<!-- http://web.zone.ee/bespiva/ -->
<fx:Script>
<![CDATA[
import com.esri.ags.FeatureSet;
import com.esri.ags.Graphic;
import com.esri.ags.SpatialReference;
import com.esri.ags.events.LayerEvent;
import com.esri.ags.geometry.Extent;
import com.esri.ags.geometry.Geometry;
import com.esri.ags.symbols.SimpleFillSymbol;
import com.esri.ags.symbols.SimpleLineSymbol;
import com.esri.ags.tasks.QueryTask;
import com.esri.ags.tasks.supportClasses.Query;
import mx.collections.ArrayCollection;
import mx.events.FlexEvent;
import mx.rpc.AsyncResponder;
import mx.rpc.Fault;
import mx.utils.StringUtil;
private const FIRST_LAYER_URL:String = "http://server.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Population_by_Sex/MapServer/4";
private const SECOND_LAYER_URL:String = "http://server.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Tapestry/MapServer/4";
private const SPATIAL_REFERENCE:SpatialReference = new SpatialReference(4326);
[Bindable]
private var resultsSource:ArrayCollection = new ArrayCollection();
protected function onLayerLoad(event:LayerEvent):void
{
trace("onLayerLoad");
executeFirstQuery();
}
private function executeFirstQuery():void
{
trace("executeFirstQuery");
var query:Query = new Query();
query.outFields = new Array("*"); // All fields
query.where = "1=1"; // All features
query.returnGeometry = true;
var token:Object = new Object();
token.layer = 1;
var queryTask:QueryTask = new QueryTask(FIRST_LAYER_URL);
queryTask.execute(query, new AsyncResponder(onQueryResult, onQueryFault, token));
}
private function executeSecondQuery(whereClause:String, intermediateResult:ArrayCollection):void
{
trace("executeSecondQuery");
var query:Query = new Query();
query.outFields = new Array("*"); // All fields
query.where = whereClause;
query.returnGeometry = false;
var token:Object = new Object();
token.layer = 2;
token.features = intermediateResult;
var queryTask:QueryTask = new QueryTask(SECOND_LAYER_URL);
queryTask.execute(query, new AsyncResponder(onQueryResult, onQueryFault, token));
}
protected function onQueryResult(featureSet:FeatureSet, token:Object = null):void
{
var queryLayer:int;
var intermediateResult:ArrayCollection = new ArrayCollection();
if (token != null)
{
queryLayer = token.layer;
intermediateResult = token.features;
}
else
{
return;
}
trace(StringUtil.substitute("onQueryResult for {0}-st layer", queryLayer));
switch (queryLayer)
{
case 1:
{
parseFirstQueryResult(featureSet);
break;
}
case 2:
{
parseSecondQueryResult(featureSet, intermediateResult);
break;
}
}
}
protected function onQueryFault(fault:Fault, token:Object = null):void
{
var queryLayer:int;
if (token != null)
{
queryLayer = token.layer;
}
else
{
return;
}
trace(StringUtil.substitute("onQueryFault for {0}-st layer", queryLayer));
}
private function parseFirstQueryResult(featureSet:FeatureSet):void
{
trace("parseFirstQueryResult");
var intermediateResult:ArrayCollection = new ArrayCollection();
var secondQueryWhere:String = "";
if (featureSet != null && featureSet.features.length > 0)
{
var features:Array = featureSet.features;
for each (var graphic:Graphic in features)
{
var attributes:Object = graphic.attributes;
if (attributes != null)
{
var name:String = attributes["NAME"];
var males:Number = attributes["MALES_CY_12"];
var resultItem:Object = new Object();
resultItem.name = name;
resultItem.males = males;
resultItem.geometry = graphic.geometry;
intermediateResult.addItem(resultItem);
if (secondQueryWhere.length > 0)
{
secondQueryWhere = StringUtil.substitute("{0} OR NAME = '{1}'", secondQueryWhere, name);
}
else
{
secondQueryWhere = StringUtil.substitute("NAME = '{0}'", name);
}
}
}
executeSecondQuery(secondQueryWhere, intermediateResult);
}
else
{
trace("First query no features found");
}
}
private function parseSecondQueryResult(featureSet:FeatureSet, intermediateResult:ArrayCollection):void
{
trace("parseSecondQueryResult");
if (featureSet != null && featureSet.features.length > 0)
{
var intermediateResult2:ArrayCollection = new ArrayCollection();
var features:Array = featureSet.features;
for each (var graphic:Graphic in features)
{
var attributes:Object = graphic.attributes;
if (attributes != null)
{
var total:Number = attributes["TOTPOP_CY"];
var name:String = attributes["NAME"];
var resultItem:Object = new Object();
resultItem.name = name;
resultItem.total = total;
intermediateResult2.addItem(resultItem);
}
}
combineResults(intermediateResult, intermediateResult2);
}
else
{
trace("Second query no features found");
}
}
private function combineResults(intermediateResult1:ArrayCollection, intermediateResult2:ArrayCollection):void
{
trace("combineResults");
resultsSource = new ArrayCollection(); // do not use resultsSource.removeAll();
var iExtent:Extent = null;
for each (var obj1:Object in intermediateResult1)
{
for each (var obj2:Object in intermediateResult2)
{
if (obj1.name == obj2.name)
{
var attributes:Object = new Object();
attributes.name = obj1.name;
attributes.total = obj2.total;
attributes.males = obj1.males;
var geom:Geometry = Geometry(obj1["geometry"]);
var graphic:Graphic = new Graphic();
graphic.geometry = geom;
graphic.symbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_CROSS, 0xF5F500, 0.5, new SimpleLineSymbol())
graphic.attributes = attributes;
graphic.toolTip = StringUtil.substitute("Name: {0}\nTotal: {1}\nMales: {2}",
attributes.name,
attributes.total,
attributes.males);
resultsSource.addItem(graphic);
if (iExtent != null)
{
// union extents
var minX:Number = (geom.extent.xmin < iExtent.xmin) ? geom.extent.xmin : iExtent.xmin;
var maxX:Number = (geom.extent.xmax > iExtent.xmax) ? geom.extent.xmax : iExtent.xmax;
var minY:Number = (geom.extent.ymin < iExtent.ymin) ? geom.extent.ymin : iExtent.ymin;
var maxY:Number = (geom.extent.ymax > iExtent.ymax) ? geom.extent.ymax : iExtent.ymax;
iExtent = new Extent(minX, minY, maxX, maxY, SPATIAL_REFERENCE);
}
else
{
iExtent = geom.extent;
}
break;
}
}
}
myMap.initialExtent = iExtent.expand(1.1);
myMap.zoomToInitialExtent();
}
]]>
</fx:Script>
<ags:Map id="myMap"
zoomSliderVisible="false"
scaleBarVisible="false">
<ags:GraphicsLayer load="onLayerLoad(event)"
graphicProvider="{resultsSource}"/>
</ags:Map>
</s:Application>
... View more
03-27-2012
07:18 AM
|
0
|
0
|
1192
|
|
POST
|
more license (english PDF ~84KB) and license (spanish PDF ~104KB) to your collection. Both versions (compiled/sources) of ArcGIS Flex Viewer Appilcation has readme.txt file with link to this license agreement. ArcGIS Flex Viewer Application is open source project - FREE, with some restrictions. P.S. It is still free even if you now for the first time learned of the ESRI 😉
... View more
03-27-2012
02:28 AM
|
0
|
0
|
1134
|
|
POST
|
Understanding Flex Mobile View and ViewNavigator If you want to pass some data from one view to another (for example an ArrayCollection or some other Data Model), then you can use the second argument of the navigator.pushView() method: navigator.pushView(SecondScreen, myData);
... View more
03-26-2012
02:48 AM
|
0
|
0
|
919
|
|
POST
|
How can I pass my attributes to another view? http://forums.arcgis.com/threads/53425-Passing-data-to-new-view - this thread? 1 - You have >1 views in your app. 2 - Your app is mobile app. 3 - Clicking in some view you need to handle it in another view. Right? Looks like puzzle or charade :confused: Let me try: 1(both views are opened at the same time) - You can bind data to your second view (adobe help). 2(both views have access to object) - You can't bind data, but you have reference to some object (layer or/and graphic) in both views. Each time, you add somthing to your graphics layer you can handle graphicAdd handler. - you access to each graphic added to layer; When you have access to graphic add listener to it (change, click, over, out ....); 3(flex mobile) - Read adobe help carefully, search samples (Passing data between Views) in adobe site, search samples (Understanding Flex Mobile View and ViewNavigator) in web. If you want to pass some data from one view to another (for example an ArrayCollection or some other Data Model), then you can use the second argument of the navigator.pushView() method: navigator.pushView(SecondScreen, myData); P.S. Reproduction of 1 question to multiple threads is bad idea, remove duplicates.
... View more
03-26-2012
02:45 AM
|
0
|
0
|
964
|
|
POST
|
Ann, protected function pointsXML_resultHandler(event:ResultEvent):void { var inSr:SpatialReference = new SpatialReference(4326); var outSr:SpatialReference = new SpatialReference(3857); var gArr:Array = new Array(); var myGraphics:Array = new Array(); var x:XML = XML(event.result); pntList = x..entry; for (var i:int; i < pntList.length(); i++) { var latlong:Array = pntList.point.split(" "); //create graphic attributes var attributes:Object = new Object(); attributes.name = pntList.name; // attributes["name"] attributes.region = pntList.region; // attributes["region"] attributes.summary = pntList.summary; // attributes["summary"] // you can hold/add/remove/read/... on client side any attribute types you want attributes.myBool = false; // type Boolean attributes.creationDate = new Date(); // type date attributes.myComplexAttribute = new MyComplexAttribute(); attributes.symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.CIRCLE, ...); var myPoint:Geometry = new MapPoint(latlong[1], latlong[0], inSr); var coordGraphic:Graphic = new Graphic(myPoint, null, attributes); gArr.push(myPoint); myGraphics.push(coordGraphic); } geometryService.project(gArr, outSR, new AsyncResponder(onProjectComplete, onProjectFault, myGraphics)); }
... View more
03-26-2012
01:24 AM
|
0
|
0
|
964
|
|
POST
|
Try attached sample (may be you find some heplful things): [ATTACH=CONFIG]12890[/ATTACH]
... View more
03-21-2012
04:12 AM
|
0
|
0
|
929
|
|
POST
|
Schopp, try add to EditWidgetAttributeInspectorSkin.mxml highlighted code (Button and it's click handler): <?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2010 Esri
All rights reserved under the copyright laws of the United States
and applicable international laws, treaties, and conventions.
You may freely redistribute and use this sample code, with or
without modification, provided you include the original copyright
notice and use restrictions.
See use restrictions in use_restrictions.txt.
-->
<!---
Custom skin class for the AttributeInspector component.
-->
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Metadata>
/**
* A strongly typed property that references the component to which this skin is applied.
*/
[HostComponent("com.esri.ags.components.AttributeInspector")]
[Event(name="attachmentGroupClicked", type="flash.events.Event")]
[Event(name="okButtonClicked", type="flash.events.Event")]
</fx:Metadata>
<fx:Script>
<![CDATA[
import com.esri.ags.Graphic;
import com.esri.ags.components.AttributeInspector;
import mx.controls.Alert;
protected function onGetGeometryButtonClick(event:MouseEvent):void
{
var ai:AttributeInspector = hostComponent as AttributeInspector;
if (ai != null)
{
var af:Graphic = ai.activeFeature;
if (af != null && af.geometry != null)
{
// so the "af.geometry" is that you need
Alert.show(af.geometry.toString());
}
else
{
Alert.show("AttributeInspector has no active features!");
}
}
else
{
Alert.show("AttributeInspector is null!");
}
}
]]>
</fx:Script>
<fx:Script>
<![CDATA[
import com.esri.ags.layers.FeatureLayer;
import mx.containers.FormItem;
import mx.containers.FormItemDirection;
import mx.events.ChildExistenceChangedEvent;
// configurable through the edit widget's config file
[Bindable]
public static var showAttachmentsText:String;
[Bindable]
public static var deleteLabel:String;
[Bindable]
public static var okLabel:String;
private function attachmentGroup_clickHandler(event:MouseEvent):void
{
dispatchEvent(new Event("attachmentGroupClicked", true, true));
}
protected function okButton_clickHandler(event:MouseEvent):void
{
dispatchEvent(new Event("okButtonClicked", true, true));
}
protected function form_childAddHandler(event:ChildExistenceChangedEvent):void
{
var displayObject:DisplayObject = event.relatedObject;
if (displayObject != null && displayObject is FormItem)
{
var formItem:FormItem = displayObject as FormItem;
var labelValue:String = formItem.label;
formItem.label = "";
var lbl:Label = new Label();
lbl.text = labelValue;
formItem.addChildAt(lbl, 0);
}
}
]]>
</fx:Script>
<s:states>
<s:State name="normal"/>
<s:State name="disabled"/>
<s:State name="invalid"/>
</s:states>
<s:layout>
<s:VerticalLayout horizontalAlign="center"/>
</s:layout>
<!--- Form to display the attributes of the active feature. -->
<mx:Form id="form"
width="100%" height="100%"
enabled.disabled="false"
horizontalScrollPolicy="off"
maxHeight="{hostComponent.getStyle('formMaxHeight')}"
verticalScrollPolicy="auto" childAdd="form_childAddHandler(event)">
</mx:Form>
<s:HGroup verticalAlign="middle">
<!--- Button to delete the active feature. -->
<s:Button id="deleteButton"
enabled.disabled="false"
label="{deleteLabel}"/>
<s:Button id="okButton"
click="okButton_clickHandler(event)"
enabled.disabled="false"
label="{okLabel}"/>
<s:Button label="Geometry?" click="onGetGeometryButtonClick(event)" />
</s:HGroup>
<s:HGroup id="attachmentGroup"
width="100%" height="100%"
horizontalAlign="right"
includeInLayout="{FeatureLayer(hostComponent.activeFeature.graphicsLayer).layerDetails.hasAttachments}"
verticalAlign="middle"
visible="{FeatureLayer(hostComponent.activeFeature.graphicsLayer).layerDetails.hasAttachments}">
<s:Label buttonMode="true"
click="attachmentGroup_clickHandler(event)"
fontWeight="bold"
text="{showAttachmentsText}"/>
<mx:Image id="img"
width="25" height="25"
buttonMode="true"
click="attachmentGroup_clickHandler(event)"
source="@Embed('/assets/images/edit_attachments.png')"/>
</s:HGroup>
</s:SparkSkin>
... View more
03-21-2012
12:39 AM
|
0
|
0
|
2243
|
|
POST
|
Kaju114, You have such a detailed description of the problem / task. :rolleyes: 1) I have 3 feature layers really, 3 FeatureLayer instances? Show, how did you tried to initialize them (code or scheme)? or you have 3 Feature Services? And you have some limitations for each service, so you can't combine (union) it in Desktop or Server side? 2) how can i combine them??? coz i want to perform query after unioning those layers. query is the only task? have you tried to do it? Do you have experience (are you developer or salesman)? Did you wrote some code in flex, or you tried with server side extension? Anywhere, IMHO, 1 - Yes it is possible. It is hot hard work, but ... 2 - If you have combined 3 Feature Services (from server side) in one FeatureLayer (on client side) you still need to make 3 requests to the server, wait for the response to every request, and having on hand all 3 answers (responses) combine it.
... View more
03-20-2012
11:38 PM
|
0
|
0
|
929
|
|
POST
|
Silvia, no. If I disable my network device i recieve this error message: [RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://www.arcgis.com/sharing/content/items/78e9ed6c172a43719e2114cfb7f6d306?f=json"]. URL: http://www.arcgis.com/sharing/content/items/78e9ed6c172a43719e2114cfb7f6d306?f=json"] at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler() at mx.rpc::Responder/fault() at mx.rpc::AsyncRequest/fault() at DirectHTTPMessageResponder/errorHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete() You need to search in adobe forums about: "event listeners", "event dispatchers". cannot convert mx.rpc.events::FaultEvent@13a5a301 to com.esri.ags.events.LayerEvent just fill the difference: wrong code: var wmUtil:WebMapUtil = new WebMapUtil();
wmUtil.addEventListener(FaultEvent.FAULT, onWebMapUtilFault, false, 0, true);
protected function onWebMapUtilFault(event:LayerEvent):void // wrong event type
{
//
}
/*
TypeError: Error #1034: Type Coercion failed: cannot convert mx.rpc.events::FaultEvent@ad35f81 to com.esri.ags.events.LayerEvent.
...
...
*/
working code: var wmUtil:WebMapUtil = new WebMapUtil();
wmUtil.addEventListener(FaultEvent.FAULT, onWebMapUtilFault, false, 0, true);
protected function onWebMapUtilFault(event:FaultEvent):void
{
trace(event.fault.getStackTrace());
} Sample: <?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:ags="http://www.esri.com/2008/ags">
<!-- Adobe Flex SDK 4.5.1 -->
<!-- ArcGIS API for Flex 2.5 -->
<!-- http://web.zone.ee/bespiva/webmaputil/ -->
<s:layout>
<s:HorizontalLayout gap="5"
paddingBottom="10"
paddingLeft="10"
paddingRight="10"
paddingTop="10" />
</s:layout>
<fx:Script>
<![CDATA[
import com.esri.ags.Map;
import com.esri.ags.events.WebMapEvent;
import com.esri.ags.webmap.WebMapUtil;
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.AsyncResponder;
import mx.rpc.Fault;
protected function onPanelCreationComplete(event:FlexEvent):void
{
var targetPanel:Panel = event.target as Panel;
var wmUtil:WebMapUtil = new WebMapUtil();
switch (targetPanel.id)
{
case (panel1.id):
{
wmUtil.createMapById("69f7b98f49db4becb44ac2de3aa37dd9",
new AsyncResponder(onCreateMapByIdComplete, onFault, targetPanel.id));
break;
}
case (panel2.id):
{
wmUtil.createMapById("f3b0db715d9148f7a4d3b4f8159b90b5",
new AsyncResponder(onCreateMapByIdComplete, onFault, targetPanel.id));
break;
}
case (panel3.id):
{
wmUtil.createMapById("b3b981c496d443749fdc8661f9e38e65",
new AsyncResponder(onCreateMapByIdComplete, onFault, targetPanel.id));
break;
}
case (panel4.id):
{
wmUtil.createMapById("78e9ed6c172a43719e2114cfb7f6d306",
new AsyncResponder(onCreateMapByIdComplete, onFault, targetPanel.id));
break;
}
}
}
protected function onCreateMapByIdComplete(event:WebMapEvent, token:Object = null):void
{
if (event.errors.length > 0)
{
for (var i:int; i < event.errors.length; i++)
{
trace(event.errors);
}
return;
}
var map:Map = event.map as Map;
if (map != null)
{
switch (token.toString())
{
case panel1.id:
{
panel1.removeAllElements();
panel1.addElement(map);
break;
}
case panel2.id:
{
panel2.removeAllElements();
panel2.addElement(map);
break;
}
case panel3.id:
{
panel3.removeAllElements();
panel3.addElement(map);
break;
}
case panel4.id:
{
panel4.removeAllElements();
panel4.addElement(map);
break;
}
}
}
}
protected function onFault(fault:Fault, token:Object = null):void
{
trace(fault.getStackTrace());
Alert.show(fault.message.toString(), "Fault");
}
]]>
</fx:Script>
<s:VGroup gap="5"
width="100%"
height="100%">
<s:Panel id="panel1"
title="Top-Left panel"
width="100%"
height="100%"
creationComplete="onPanelCreationComplete(event)">
</s:Panel>
<s:Panel id="panel2"
title="Bottom-Left panel"
width="100%"
height="100%"
creationComplete="onPanelCreationComplete(event)">
</s:Panel>
</s:VGroup>
<s:VGroup gap="5"
width="100%"
height="100%">
<s:Panel id="panel3"
title="Top-Right panel"
width="100%"
height="100%"
creationComplete="onPanelCreationComplete(event)">
</s:Panel>
<s:Panel id="panel4"
title="Bottom-Right panel"
width="100%"
height="100%"
creationComplete="onPanelCreationComplete(event)">
</s:Panel>
</s:VGroup>
</s:Application>
... View more
03-19-2012
06:36 AM
|
0
|
0
|
767
|
|
POST
|
In this sample: 1 - Layer visibility change works. 2 - Legend content change works. <?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:ags="http://www.esri.com/2008/ags">
<!-- Adobe Flex SDK 4.5.1 -->
<!-- ArcGIS API for Flex 2.5 -->
<s:layout>
<s:HorizontalLayout gap="5"
paddingBottom="10"
paddingLeft="20"
paddingRight="20"
paddingTop="20"/>
</s:layout>
<fx:Script>
<![CDATA[
import com.esri.ags.events.LayerEvent;
import com.esri.ags.layers.Layer;
import mx.collections.ArrayCollection;
import spark.events.IndexChangeEvent;
[Bindable]
private var layersList:ArrayCollection = new ArrayCollection();
protected function onLayerLoad(event:LayerEvent):void
{
layersList.addItem(event.layer);
if (layersList.length == 1)
{
ddlLayers.selectedIndex = 0;
ddlLayers.dispatchEvent(new IndexChangeEvent(IndexChangeEvent.CHANGE, false, false, -1, 0));
}
}
protected function onLayerSelectionChange(event:IndexChangeEvent):void
{
for each (var layer:Layer in myMap.layers)
{
if (layer == ddlLayers.selectedItem)
{
layer.visible = true;
layer.validateNow();
myLegend.map = myMap;
myLegend.respectCurrentMapScale = true;
myLegend.layers = new Array(layer);
}
else if (layer is ArcGISDynamicMapServiceLayer)
{
layer.visible = false;
}
}
}
]]>
</fx:Script>
<ags:Map id="myMap">
<ags:ArcGISTiledMapServiceLayer id="baseLayer"
url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
<ags:ArcGISDynamicMapServiceLayer id="layer1"
load="onLayerLoad(event)"
imageFormat="png32"
name="Events"
url="http://sampleserver5.arcgisonline.com/ArcGIS/rest/services/LocalGovernment/Events/MapServer" />
<ags:ArcGISDynamicMapServiceLayer id="layer2"
load="onLayerLoad(event)"
imageFormat="png32"
name="Recreation"
url="http://sampleserver5.arcgisonline.com/ArcGIS/rest/services/LocalGovernment/Recreation/MapServer" />
<ags:ArcGISDynamicMapServiceLayer id="layer3"
load="onLayerLoad(event)"
imageFormat="png32"
name="Geology"
url="http://sampleserver5.arcgisonline.com/ArcGIS/rest/services/Energy/Geology/MapServer" />
</ags:Map>
<s:VGroup gap="5"
paddingLeft="5"
paddingTop="5"
paddingRight="5"
paddingBottom="5"
height="100%"
width="100%">
<s:DropDownList id="ddlLayers"
minWidth="200"
dataProvider="{layersList}"
labelField="name"
change="onLayerSelectionChange(event)"/>
<s:Scroller height="100%">
<s:Group height="100%">
<ags:Legend id="myLegend" />
</s:Group>
</s:Scroller>
</s:VGroup>
</s:Application>
Good luck.
... View more
03-19-2012
02:59 AM
|
0
|
0
|
1867
|
|
POST
|
I'm not sure, and I can't test it, as the result i do not understand what is it? - getResolution() Gets the resolution of the Layer. and But may be ... setDPI(int) Sets the dot-per-inch of the map (used to determine the resolution of the map). Are the same things... :confused: I'm not sure. I have no SDK installed on current working machine - I can't try it.
... View more
03-19-2012
02:16 AM
|
0
|
0
|
1183
|
|
POST
|
Another question in another thread (with other name - so all members can read/help you). As a start point do search in this forum, use keywords "datagrid". - http://forums.arcgis.com/search.php I think, what this question is not new.
... View more
03-16-2012
05:08 AM
|
0
|
0
|
1054
|
|
POST
|
Luca, 2.6 will never be released (wiping a tear) - the next is version 3.0 :mad: and it is still mx:Form (Starting with Flex 4.5, Adobe recommends that you use the spark.components.Form class as an alternative to this class) - the last release Flex SDK is 4.6.0 - ESRI is two steps behind I didn't find a way to move the label to the top of the input NB! That is not best coding sample. I just want to show you, what you no need to worry ESRI dev. team :cool: each time you think what "It's hard ..." in AttributeInspector skin class add red colored code: <!--- Form to display the attributes of the active feature. --> <mx:Form id="form" width="100%" height="100%" enabled.disabled="false" horizontalScrollPolicy="off" maxHeight="{hostComponent.getStyle('formMaxHeight')}" verticalScrollPolicy="auto" childAdd="form_childAddHandler(event)"> </mx:Form> // in script tag protected function form_childAddHandler(event:ChildExistenceChangedEvent):void { var displayObject:DisplayObject = event.relatedObject; if (displayObject != null && displayObject is mx.containers.FormItem) { var formItem:FormItem = displayObject as FormItem; var labelValue:String = formItem.label; formItem.label = ""; var lbl:Label = new Label(); lbl.text = labelValue; formItem.addChildAt(lbl, 0); } } P.S. Also you can skin mx components and containers http://help.adobe.com/en_US/flex/using/WS6DB252F3-BC93-4c6e-B95D-724CF2E928D7.html#WSF73B153C-F7B2-426d-AB9A-9AC892BA7E4C P.S.2 You have an idea, http://ideas.arcgis.com/.
... View more
03-16-2012
04:36 AM
|
0
|
0
|
1054
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-03-2017 11:25 PM | |
| 1 | 10-06-2016 11:49 PM | |
| 2 | 06-07-2012 01:38 AM | |
| 1 | 06-03-2012 09:42 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|