|
POST
|
EditTool has properties ghostVertexSymbol and vertexSymbol define symbols in editTool declaration: <esri:EditTool id="editTool" map="{map}">
<esri:ghostVertexSymbol>
<!-- put your symbol here -->
</esri:ghostVertexSymbol>
<esri:vertexSymbol>
<!-- put your symbol here -->
</esri:vertexSymbol>
</esri:EditTool>
... View more
11-05-2012
04:41 AM
|
0
|
0
|
625
|
|
POST
|
Ionara, IMHO, you must extend scale bar skin. You can find it in downloaded ArcGIS API for flex, 'skins' folder. Copy it and paste in skins package of your application, define skin class for Scale Bar: <fx:Style>
@namespace mx "library://ns.adobe.com/flex/mx";
@namespace esri "http://www.esri.com/2008/ags";
@namespace s "library://ns.adobe.com/flex/spark";
esri|ScaleBar
{
skin-class: ClassReference("your.skins.package.ScaleBarMetricSkin");
}
</fx:Style>
... View more
11-04-2012
09:47 PM
|
0
|
0
|
558
|
|
POST
|
All functions and events you need are in Map class: panDown() panLeft() panRight() panUp() + 4 pan functions... event: panStart - com.esri.ags.events.PanEvent.PAN_START Fires when a user commences panning. event: panUpdate - com.esri.ags.events.PanEvent.PAN_UPDATE Fires during the pan process. event: panEnd - com.esri.ags.events.PanEvent.PAN_END Fires when the pan is complete.
... View more
11-04-2012
08:36 PM
|
0
|
0
|
1666
|
|
POST
|
ArcGIS for developers 1, 2 ArcGIS REST API for 10.1 SOAP SDK
... View more
10-23-2012
09:39 PM
|
0
|
0
|
503
|
|
POST
|
1 - mx : DateChooser property selectedDate Date selected in the DateChooser control. If the incoming Date object has any time values, they are zeroed out. so: var date1:Date = new Date(myDateChooser.selectedDate.fullYear, myDateChooser.selectedDate.month, myDateChooser.selectedDate.date, 0, 0, 0, 0);
var date2:Date = myDateChooser.selectedDate;
// as a result date1 equals date2 2 - There is a lot of same questions in this forum, where developers can't access just added features - some time they resolve setting property disableClientCaching=true to FeatureLayer, some time problem in other condition - "where clause" ... The better way, IMHO, handle layer listeners: // called layer.refresh(); -> listen it's update start and update end handlers -> trace to console update results // called layer.applyEdits(); -> listen it's edit fault and edit result handlers -> trace to console // called layer.queryFeatures(); -> listen it's query fault and query result handler -> trace to console ... as a result you have full vison about you layer - "What are you waiting calling layer.refresh()? VS What really happens when called layer.refresh()?" ... Your browser network monitoring tools are also helpful - "F12" key in IE, "F12" key in Chrome, alot of addons for FF ... - as a result you can see all your requests to server and it's responses ... Good luck ...
... View more
10-22-2012
11:30 PM
|
0
|
0
|
572
|
|
POST
|
FeatureLayer has event selectionComplete. Handle it: ...
myFeatureLayer1.addEventListener(FeatureLayerEvent.SELECTION_COMPLETE, onSelectionComplete);
myFeatureLayer2.addEventListener(FeatureLayerEvent.SELECTION_COMPLETE, onSelectionComplete);
...
or in mxml tag
...
<esri:FeatureLayer id="myFeatureLayer1"
selectionComplete="onSelectionComplete(event)"
... />
<esri:FeatureLayer id="myFeatureLayer2"
selectionComplete="onSelectionComplete(event)"
... />
...
protected function onSelectionComplete(event:FeatureLayerEvent):void
{
event.featureLayer // Reference to the associated FeatureLayer
event.featureLayer.selectedFeatures // selected features
...
}
...
... View more
10-21-2012
11:44 PM
|
0
|
0
|
259
|
|
POST
|
Philip, Sample 1 (with sources) - Project a point using GeometryService Sample 2 (with sources) - Project a point using WebMercatorUtil Good luck.
... View more
10-21-2012
11:26 PM
|
0
|
0
|
1281
|
|
POST
|
answer to your question is here ArcGIS API 3.0 (final) for Flex ... Requires Adobe Flex 4.6 SDK or higher, which in turn requires at least Flash Player 11.1. ... Post with link to download Adobe SDK 4.6
... View more
10-18-2012
04:20 AM
|
0
|
0
|
592
|
|
POST
|
By default you have access to added feature object id - it is unique, so you can find added feature using it: var graphic:Graphic = new Graphic(); // add attributes to graphic var adds:Array = new Array(graphic); // or = [graphic] featureLayer.applyEdits(adds, null, null, false, new AsyncResponder(onEditResult, onEditFault)); ... protected function onEditResult(results:FeatureEditResults, token:Object = null):void { for each (var addResult:FeatureEditResult in results.addResults) { if (addResult.success === false) { trace("Feature adding error: " + addResult.error.message.toString()); } else { trace("Added feature object Id = " + addResult.objectId); } } for each (var updateResult:FeatureEditResult in results.updateResults) { ... } } protected function onEditFault(fault:Fault, token:Object = null):void { trace(fault.faultString); } you can use token to store any information about current request: Additional information to associate with this request. var graphic:Graphic = new Graphic(); // add attributes to graphic var adds:Array = new Array(graphic); // or = [graphic] var requestToken:Object = graphic.attributes; featureLayer.applyEdits(adds, null, null, false, new AsyncResponder(onEditResult, onEditFault, requestToken)); ... protected function onEditResult(results:FeatureEditResults, token:Object = null):void { for each (var addResult:FeatureEditResult in results.addResults) { if (addResult.success === false) { trace("Feature adding error: " + addResult.error.message.toString()); } else { if (token) { var addedGraphicAttributes:Object = token; for (var attributeName:Object in addedGraphicAttributes) { var attributeValue:Object = feature[attributeName]; trace(">>> " + attributeName + " : " + attributeValue); } } else { trace("Added feature object Id = " + addResult.objectId); } } } for each (var updateResult:FeatureEditResult in results.updateResults) { ... } } protected function onEditFault(fault:Fault, token:Object = null):void { trace(fault.faultString); } Reference: FeatureEditResults, FeatureEditResult
... View more
10-17-2012
11:57 PM
|
0
|
0
|
572
|
|
POST
|
I was wrong. Haste. 🙂 But you could also read the help. :cool: try it: gpParams["Input_Data_File_Parameter_Name"] = com.esri.ags.utils.JSONUtil.encode(dataFile); IMHO, the best practice is testing your service in browser (REST API) at first. Most of browsers comes with "network monitoring tools" (usually F12 key pressing). Open your GP service, set input parameters - find request in monitoring console ... If your service works - start playing with web APIs. Good luck.
... View more
10-15-2012
11:18 PM
|
0
|
0
|
1222
|
|
POST
|
From ESRI help (find GPDataFile😞 import com.esri.ags.events.GeoprocessorEvent;
import com.esri.ags.tasks.Geoprocessor;
import com.esri.ags.tasks.supportClasses.DataFile;
import com.esri.ags.tasks.supportClasses.JobInfo;
import com.esri.ags.utils.JSONUtil;
import mx.rpc.AsyncResponder;
import mx.rpc.Fault;
private function submitJob():void
{
var gpUrl:String = "http://server/arcgis/rest/services/folder/service/GPServer";
var gp:Geoprocessor = new Geoprocessor(gpUrl);
var dataFile:DataFile = new DataFile("http://server/folder/file.txt");
var gpParams:Object = new Object();
gpParams["Input_Data_File_Parameter_Name"] = JSONUtil.encode(dataFile);
/* wrong
gpParams["Input_Data_File_Parameter_Name"] = dataFile.toJSON();
*/
// add other req. parameters
// if service is Asynchronous
gp.submitJob(gpParams, new AsyncResponder(onJobComplete, onJobFault));
// else
gp.addEventListener(GeoprocessorEvent.EXECUTE_COMPLETE, onExecuteComplete);
gp.execute(gpParams);
}
/**
* Listen job complete server response
*/
protected function onJobComplete(result:JobInfo, token:Object = null):void
{
if (result.jobStatus == JobInfo.STATUS_SUCCEEDED)
{
//TODO: complete code
}
else
{
//TODO: complete code
}
}
/**
* Listen server error responses
*/
protected function onJobFault(fault:Fault, token:Object = null):void
{
trace(fault.message.toString());
}
/**
* Listen job complete server response
*/
protected function onExecuteComplete(event:GeoprocessorEvent):void
{
//TODO: complete code
}
... View more
10-15-2012
03:03 AM
|
0
|
0
|
1222
|
|
POST
|
http://forums.arcgis.com/threads/64114-Uploads-capability-on-Geoprocessor?highlight=upload
... View more
10-14-2012
11:28 PM
|
0
|
0
|
1222
|
|
POST
|
private function getFeatureSet():FeatureSet
{
var gp:ArrayCollection = myLayer.graphicProvider as ArrayCollection;
if (!gp)
{
return null;
}
var featureSet:FeatureSet = new FeatureSet(gp.toArray());
var counter:int;
// for each feature in collection
for each (var feature:Object in featureSet.attributes)
{
counter++;
trace("> " + counter);
// for each attribute in feature
for (var attributeName:Object in feature)
{
var attributeValue:Object = feature[attributeName];
trace(">>> " + attributeName + " : " + attributeValue);
}
}
return featureSet;
}
/* output */
/*
> 1
>>> UNITS10_49 : 10898
>>> STATE_FIPS : 02
>>> AMERI_ES : 14569
>>> UNITS3_9 : 18983
>>> WIDOWED : 4428
>>> STATE_CITY : 0203000
>>> ASIAN_PI : 10910
>>> STATE_NAME : Alaska
>>> DIVORCED : 20631
>>> AGE_5_17 : 45189
>>> RENTER_OCC : 39030
>>> AGE_18_64 : 151392
>>> HSEHLD_1_M : 10673
>>> AGE_65_UP : 8258
>>> TYPE : city
...*/
Good luck
... View more
10-14-2012
10:34 PM
|
0
|
0
|
371
|
|
POST
|
Try it: <?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:text="flash.text.*"
xmlns:esri="http://www.esri.com/2008/ags"
pageTitle="Clustering with Flex API">
<s:layout>
<s:VerticalLayout />
</s:layout>
<fx:Script>
<![CDATA[
import com.esri.ags.Graphic;
import com.esri.ags.clusterers.supportClasses.ClusterGraphic;
import com.esri.ags.esri_internal;
import com.esri.ags.events.ExtentEvent;
import com.esri.ags.events.FlareEvent;
import com.esri.ags.events.FlareMouseEvent;
import com.esri.ags.events.GraphicEvent;
import com.esri.ags.events.LayerEvent;
import com.esri.ags.events.MapEvent;
import mx.collections.ArrayCollection;
import spark.events.GridEvent;
import spark.utils.TextFlowUtil;
[Bindable]
private var gridSource:ArrayCollection;
protected function map_loadHandler(event:MapEvent):void
{
featureLayer.addEventListener(FlareMouseEvent.FLARE_CLICK, flareClickHandler);
featureLayer.addEventListener(FlareEvent.FLARE_IN_START, flareInStartHandler);
}
private function flareClickHandler(event:FlareMouseEvent):void
{
showInfoWindow(event.graphic, event.stageX, event.stageY);
}
private function flareInStartHandler(event:FlareEvent):void
{
map.infoWindow.hide();
}
private function showInfoWindow(gr:Graphic, stageX:Number, stageY:Number):void
{
myTextArea.textFlow = TextFlowUtil.importFromString(
'<span fontWeight="bold">State Name: </span>' + gr.attributes.STATE_NAME + '<br/>'
+ '<span fontWeight="bold">Age (5-17): </span>' + gr.attributes.AGE_5_17 + '<br/>'
+ '<span fontWeight="bold">Age (18-64): </span>' + gr.attributes.AGE_18_64 + '<br/>'
+ '<span fontWeight="bold">Age (65 and above): </span>' + gr.attributes.AGE_65_UP);
map.infoWindow.label = gr.attributes.CITY_NAME;
map.infoWindow.closeButtonVisible = false;
map.infoWindow.show(map.toMapFromStage(stageX, stageY));
}
private var activeGraphic:ClusterGraphic;
/**
* Highlight by object ID
*/
private function playHiglight(oid:Number):void
{
stopHiglight();
var gr:Graphic = getFeatureById(oid);
if (gr)
{
var clusterGraphic:ClusterGraphic = gr.esri_internal::clusterGraphic;
if (clusterGraphic != null) // clustered
{
// this graphic symbol must be resored on roll out
activeGraphic = clusterGraphic;
// set highlight symbol
clusterGraphic.symbol = highlightSymbol;
animationFilter.target = clusterGraphic;
animationFilter.play();
}
else // not clustered
{
animationFilter.target = gr;
animationFilter.play();
}
}
}
/**
* Stop highlight graphics
*/
private function stopHiglight():void
{
if (activeGraphic)
{
// restore default flare symbol
activeGraphic.symbol = flareSymbol;
}
animationFilter.stop();
}
protected function map_extentChangeHandler(event:ExtentEvent):void
{
map.infoWindow.hide();
}
protected function featureLayer_graphicAddHandler(event:GraphicEvent):void
{
event.graphic.addEventListener(MouseEvent.CLICK, graphicClickHandler); // showing info window on non-clustered graphics
}
private function graphicClickHandler(event:MouseEvent):void
{
showInfoWindow(Graphic(event.target), event.stageX, event.stageY);
}
/**
* @return feature with input object ID, if not exists returns <b>null</b>
*/
private function getFeatureById(oid:Number):Graphic
{
if (oid > 0)
{
for each (var gr:Graphic in featureLayer.graphicProvider)
{
if (gr != null && gr.attributes[getOidFieldName()] == oid)
{
return gr;
}
}
}
return null;
}
/**
* @return layer object id field name
*/
private function getOidFieldName():String
{
if (featureLayer.layerDetails != null)
{
return featureLayer.layerDetails.objectIdField;
}
return null;
}
/**
* Feature layer load - add additional listeners
*/
protected function onFeatureLayerLoad(event:LayerEvent):void
{
featureLayer.addEventListener(LayerEvent.UPDATE_END, onFeatureLayerUpdateEnd);
}
/**
* Init grid datasource
*/
protected function onFeatureLayerUpdateEnd(event:LayerEvent):void
{
gridSource = new ArrayCollection();
for each (var graphic:Graphic in featureLayer.graphicProvider)
{
gridSource.addItem(graphic.attributes);
}
if (gridSource.length > 0)
{
// do not need anymore in this listener - remove it
featureLayer.removeEventListener(LayerEvent.UPDATE_END, onFeatureLayerUpdateEnd);
}
}
/**
* Listen mouse roll over datagrid row
*/
protected function onRowRollOver(event:GridEvent):void
{
var oidField:String = getOidFieldName();
if (event.item && event.item.hasOwnProperty(oidField))
{
playHiglight(event.item[oidField]);
}
}
/**
* Listem mouse roll out datagrid row
*/
protected function onRowRollOut(event:GridEvent):void
{
stopHiglight();
}
/**
* Listem mouse double click
*/
protected function onRowDoubleClick(event:MouseEvent):void
{
var oidField:String = getOidFieldName();
if (dataGrid.selectedItem && dataGrid.selectedItem.hasOwnProperty(oidField))
{
var graphic:Graphic = getFeatureById(dataGrid.selectedItem[oidField]);
playHiglight(dataGrid.selectedItem[oidField]);
map.centerAt(MapPoint(graphic.geometry));
}
}
]]>
</fx:Script>
<fx:Declarations>
<s:AnimateFilter id="animationFilter"
repeatBehavior="reverse"
duration="500"
repeatCount="0">
<s:bitmapFilter>
<s:GlowFilter />
</s:bitmapFilter>
<s:motionPaths>
<fx:Vector type="spark.effects.animation.MotionPath">
<s:SimpleMotionPath property="color" valueFrom="0x00FF00" valueTo="0x0000FF"/>
<s:SimpleMotionPath property="blurX" valueFrom="6" valueTo="30"/>
<s:SimpleMotionPath property="blurY" valueFrom="6" valueTo="30"/>
</fx:Vector>
</s:motionPaths>
</s:AnimateFilter>
<text:TextFormat id="tf"
font="Arial"
size="14"/>
<esri:FlareSymbol id="flareSymbol"
backgroundAlphas="[0.5,1.0]"
backgroundColors="[0x00FF00,0xFF0000]"
flareMaxCount="30"
flareSizeIncOnRollOver="3"
sizes="[20,30]"
textFormat="{tf}"
weights="[30,60]"/>
<esri:FlareSymbol id="highlightSymbol"
backgroundAlphas="[1,1]"
backgroundColors="[0xFFFF00,0xFFFF00]"
flareMaxCount="30"
flareSizeIncOnRollOver="3"
sizes="[20,30]"
textFormat="{tf}"
weights="[30,60]"/>
<esri:WeightedClusterer id="clusterer"
symbol="{flareSymbol}">
<esri:center>
<!--
x/y values are from the below extent x/y min/max values, these are the center of the extent.
To make sure that you have the same clusters every time and independently of the map size and extent, these values have to set explicity,
or you can let the cluster pick the map center at runtime.
-->
<esri:MapPoint x="{(-14477000-6677000)*0.5}" y="{(2273000+8399000)*0.5}"/>
</esri:center>
</esri:WeightedClusterer>
<esri:SimpleMarkerSymbol id="defaultsym"
alpha="0.8"
color="0xFF0000">
<esri:SimpleLineSymbol width="2" color="0xFFFFFF"/>
</esri:SimpleMarkerSymbol>
</fx:Declarations>
<esri:Map id="map"
extentChange="map_extentChangeHandler(event)"
load="map_loadHandler(event)"
openHandCursorVisible="false">
<esri:extent>
<esri:Extent xmin="-14477000" ymin="2273000" xmax="-6677000" ymax="8399000">
<esri:SpatialReference wkid="102100"/>
</esri:Extent>
</esri:extent>
<esri:infoWindowContent>
<s:TextArea id="myTextArea"
width="200" height="80"
editable="false"/>
</esri:infoWindowContent>
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer"/>
<esri:FeatureLayer id="featureLayer"
clusterer="{clusterer}"
definitionExpression="POP1990 > 75000"
graphicAdd="featureLayer_graphicAddHandler(event)"
load="onFeatureLayerLoad(event)"
mode="snapshot"
outFields="*"
symbol="{defaultsym}"
url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0"/>
</esri:Map>
<s:HGroup width="100%"
gap="5"
minHeight="10"
verticalAlign="middle">
<s:Label text="{featureLayer.numGraphics}"/>
<s:Label text="Graphics - Overall cluster min count"/>
<s:Label text="{clusterer.overallMinCount}"/>
<s:Label text="max count"/>
<s:Label text="{clusterer.overallMaxCount}"/>
</s:HGroup>
<s:DataGrid id="dataGrid"
dataProvider="{gridSource}"
doubleClickEnabled="true"
doubleClick="onRowDoubleClick(event)"
width="100%"
height="400"
gridRollOver="onRowRollOver(event)"
gridRollOut="onRowRollOut(event)"/>
</s:Application>
... View more
10-12-2012
03:23 AM
|
0
|
0
|
569
|
| 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
|