|
POST
|
Patrick, If I had a task to create a DataGrid with the ability to edit and save changes, then I would start something like this. I can change Incident number and track changes. I know, how to apply edits. Source is here (4KB).
... View more
11-10-2011
12:09 PM
|
0
|
0
|
1004
|
|
POST
|
Hi, Have you tried something like Clustering? I'm not sure, but maybe it will help. Also FeatureLayer has public property selectedFeatures = Array of Graphics in the current selection of this feature layer. It's readonly. This gives you the opportunity to make a new selection request with the choice of advanced query options. For example: (1) on client map click -> (2) new selection query based on geometry -> (3) as a result featureLayer.selectedFeatures -> (4) find needed feature in this Array -> (5) new selection query based on feature id. Maybe some of the steps are not needed. But the idea that all objects in FeatureLayer are the result of query from the server.
... View more
11-06-2011
09:40 PM
|
0
|
0
|
440
|
|
POST
|
1 - when i import mx.controls.Alert; it says the import Alert could not be found Try it : www.adobe.com... 2 - is it possible to label the feature layer (in the mxml) without performing a query? I think: Yes. I have not found any query maker/caller in this sample.
... View more
11-06-2011
06:05 AM
|
0
|
0
|
956
|
|
POST
|
1 - Can you show your AttributeIspector skin code? 2 - Why u can not use some own GridItemRenderer instead of AttributeInspector?
... View more
11-04-2011
06:11 AM
|
0
|
0
|
1004
|
|
POST
|
Error #2032 is StreamError. I tried to get a similar error and i got id: 1 - if service URL is wrong Fault details: Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http:// ivanbespalov.argisonline.com/ArcGIS/rest/services... 2 - if service URL is OK, but not accessible or not available at the moment 3 - may be something wrong with your crossdomain.xml (read adobe forums) Note: if URL is OK, but some of query params WRONG you got not Error #2032: StreamError - you got responce from ArcGIS server with fault message = "Unable to complete Query operation.".
... View more
11-02-2011
11:50 PM
|
0
|
0
|
822
|
|
POST
|
lyr.timeInfo is NULL Because layer is not loaded yet. 1 - Add layer to map: map.addLayer(lyr); or dispatch Layer load event (if you do not want to add layer to your map) lyr.dispatchEvent(new LayerEvent(LayerEvent.LOAD, lyr)); 2 - listen LayerEvent: lyr.addEventListener(LayerEvent.LOAD, onLayerLoad, false, 0, true);
lyr.addEventListener(LayerEvent.LOAD_ERROR, onLayerLoadError, false, 0, true);
protected function onLayerLoad(event:LayerEvent):void
{
//get lyr.timeInfo here
}
protected function onLayerLoadError(event:LayerEvent):void
{
//trace error
}
... View more
10-31-2011
07:07 AM
|
0
|
0
|
308
|
|
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:esri="http://www.esri.com/2008/ags">
<s:layout>
<s:VerticalLayout paddingBottom="15"
paddingLeft="10"
paddingRight="10"
paddingTop="15"/>
</s:layout>
<fx:Script>
<![CDATA[
import com.esri.ags.Graphic;
import com.esri.ags.events.MapMouseEvent;
import com.esri.ags.symbols.Symbol;
import mx.collections.ArrayCollection;
import spark.events.IndexChangeEvent;
import spark.filters.GlowFilter;
[Bindable]
private var graphicsSource:ArrayCollection = new ArrayCollection();
[Bindable]
private var stateSource:ArrayCollection = new ArrayCollection([0, 1, 2, 3]);
[Bindable]
private var selectedGraphic:Graphic = null;
protected function myMap_mapClickHandler(event:MapMouseEvent):void
{
var state:Number = Math.round(Math.random());
var date:Date = new Date();
var attributes:Object = new Object();
attributes.state = state;
attributes.date = date;
var gr:Graphic = new Graphic();
gr.geometry = event.mapPoint;
gr.attributes = attributes;
graphicsSource.addItem(gr);
}
protected function list1_changeHandler(event:IndexChangeEvent):void
{
animationFilter.stop();
if (list1.selectedItem is Graphic)
{
selectedGraphic = list1.selectedItem as Graphic;
list2.selectedIndex = selectedGraphic.attributes["state"];
animationFilter.target = selectedGraphic;
animationFilter.play();
}
else
{
selectedGraphic = null;
}
}
protected function list2_changeHandler(event:IndexChangeEvent):void
{
selectedGraphic.attributes["state"] = event.newIndex;
var ind:int = list1.selectedIndex;
graphicsSource.refresh();
list1.selectedIndex = ind;
}
protected function list3_changeHandler(event:IndexChangeEvent):void
{
animationFilter.stop();
selectedGraphic = null;
if (isFiltered.selected)
{
graphicsSource.filterFunction = graphicsFilterFunction;
}
else
{
graphicsSource.filterFunction = null;
}
graphicsSource.refresh();
}
private function graphicsFilterFunction(item:Object):Boolean
{
if (item is Graphic)
{
var attributes:Object = Graphic(item).attributes;
if (attributes.hasOwnProperty("state") && attributes["state"] == list3.selectedIndex)
{
return true;
}
}
return false;
}
private function ddlLabelFunction(item:Object):String
{
if (item is Graphic)
{
var attributes:Object = Graphic(item).attributes;
if (attributes.hasOwnProperty("date"))
{
return attributes["date"];
}
}
return null;
}
]]>
</fx:Script>
<fx:Declarations>
<esri:SimpleMarkerSymbol id="sms1"
color="0xFF0000"
size="16"
style="diamond" />
<esri:SimpleMarkerSymbol id="sms0"
color="0x00FF00"
size="24"
style="triangle" />
<esri:SimpleMarkerSymbol id="sms2"
color="0xCCCCCC"
size="36"
style="circle" />
<esri:SimpleMarkerSymbol id="sms3"
color="0xFFFF00"
size="50"
style="square" />
<s:AnimateFilter id="animationFilter"
repeatCount="0"
duration="500"
repeatBehavior="reverse"
bitmapFilter="{new spark.filters.GlowFilter()}">
<s:SimpleMotionPath property="color" valueFrom="0x00FF00" valueTo="0x0000FF"/>
<s:SimpleMotionPath property="blurX" valueFrom="6" valueTo="18"/>
<s:SimpleMotionPath property="blurY" valueFrom="6" valueTo="18"/>
</s:AnimateFilter>
</fx:Declarations>
<esri:Map id="myMap" mapClick="myMap_mapClickHandler(event)">
<esri:extent>
<esri:Extent xmin="2730524.567128713" xmax="2826835.222767905" ymin="8425522.38792159" ymax="8477346.69309887"/>
</esri:extent>
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
<esri:GraphicsLayer id="myGraphicsLayer"
graphicProvider="{graphicsSource}">
<esri:renderer>
<esri:UniqueValueRenderer attribute="state">
<esri:UniqueValueInfo value="3" symbol="{sms3}" />
<esri:UniqueValueInfo value="2" symbol="{sms2}" />
<esri:UniqueValueInfo value="1" symbol="{sms1}" />
<esri:UniqueValueInfo value="0" symbol="{sms0}" />
</esri:UniqueValueRenderer>
</esri:renderer>
</esri:GraphicsLayer>
</esri:Map>
<s:HGroup width="100%"
horizontalAlign="center"
chromeColor="0xCCCCCC">
<s:Label text="Each map click adds new graphics with random state attribute."
fontWeight="bold"/>
</s:HGroup>
<s:HGroup gap="25"
width="100%">
<s:Label text="Graphics list" />
<s:DropDownList id="list1"
width="250"
dataProvider="{graphicsSource}"
change="list1_changeHandler(event)"
labelFunction="ddlLabelFunction"/>
<s:Label text="Selected graphic state"
visible="{selectedGraphic != null}"/>
<s:DropDownList id="list2"
change="list2_changeHandler(event)"
dataProvider="{stateSource}"
visible="{selectedGraphic != null}"/>
<s:Label text="Filter by state" />
<s:CheckBox id="isFiltered"
selected="false"
change="list3_changeHandler(null)"/>
<s:DropDownList id="list3"
selectedIndex="0"
change="list3_changeHandler(event)"
dataProvider="{stateSource}"/>
</s:HGroup>
</s:Application>
... View more
10-27-2011
11:32 PM
|
0
|
0
|
582
|
|
POST
|
Bjorn, you right sampleserver2.arcgisonline.com/ (version 9.3)... returns fault. ArcGIS Server REST API -> Using Spatial References: The REST API supports only well-known ID's. This JSON code is not WKID, but it is WKT of ESPG::1314: {"wkt":"PROJCS[\"OSGB 1936 / British National Grid\",GEOGCS[\"OSGB36\",DATUM[\"OSGB36\",SPHEROID[\"Airy 1830\",6377563.396,299.3249646,AUTHORITY[\"EPSG\",\"7001\"]],TOWGS84[446.448,-125.157,542.06,0.1502,0.247,0.8421,-20.4894],AUTHORITY[\"EPSG\",\"6277\"]],PRIMEM[\"Greenwich\",0.0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943295],AXIS[\"Geodetic latitude\",NORTH],AXIS[\"Geodetic longitude\",EAST],AUTHORITY[\"EPSG\",\"4277\"]],PROJECTION[\"Transverse_Mercator\",AUTHORITY[\"EPSG\",\"9807\"]],PARAMETER[\"central_meridian\",-2.0],PARAMETER[\"latitude_of_origin\",49.0],PARAMETER[\"scale_factor\",0.9996012717],PARAMETER[\"false_easting\",400000.0],PARAMETER[\"false_northing\",-100000.0],UNIT[\"m\",1.0],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"27700\"]]"} Question: is the projection in attached screenshot correct?
... View more
09-19-2011
12:30 PM
|
0
|
0
|
5026
|
|
POST
|
Using ArcGIS server REST Api to project geometries u can input only Well-known ID's (wkid) - as Input/Output Spatial Refences presented here. Using other Api's (Flex Api for expmple) you can create any own or exists Spatial Reference based on Well-Know Text (wkt) if ESRI Well-known ID (wkid) not exists. <?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 paddingBottom="6"/>
</s:layout>
<fx:Script>
<![CDATA[
import com.esri.ags.Graphic;
import com.esri.ags.SpatialReference;
import com.esri.ags.events.GeometryServiceEvent;
import com.esri.ags.events.MapMouseEvent;
import com.esri.ags.geometry.Geometry;
import com.esri.ags.geometry.MapPoint;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.utils.StringUtil;
private var grGeometry:MapPoint = new MapPoint();
/**
* Listen map mouse down handler
*/
protected function myMap_mapMouseDownHandler(event:MapMouseEvent):void
{
grGeometry = event.mapPoint;
var geometriesToProject:Array = new Array();
geometriesToProject.push(grGeometry);
var wkid:Number = NaN;
/* var wkid:Number = 1314; */
var wkt:String = "GEOGCS[\"OSGB 1936\",DATUM[\"OSGB_1936\",SPHEROID[\"Airy 1830\",6377563.396,299.3249646,AUTHORITY[\"EPSG\",\"7001\"]],TOWGS84[375,-111,431,0,0,0,0],AUTHORITY[\"EPSG\",\"6277\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"DMSH\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]]";
var projectionSR:SpatialReference = new SpatialReference(wkid, wkt);
sampleGeometryService.project(geometriesToProject, projectionSR);
var gr:Graphic = new Graphic(grGeometry);
var grId:String = myGraphicsLayer.add(gr);
trace(StringUtil.substitute("Graphic with id: {0} added.", grId));
}
/**
* Listen geometry service project complete handler
*/
protected function onProjectComplete(event:GeometryServiceEvent):void
{
var pt:MapPoint = (event.result as Array)[0] as MapPoint;
trace(event.result.toString());
Alert.show(StringUtil.substitute("From: x={0} \ny={1} \nSR={2}; \n\nTo: x={3} \ny={4} \nSR={5}",
grGeometry.x,
grGeometry.y,
grGeometry.spatialReference.toString(),
pt.x,
pt.y,
pt.spatialReference.toString()),
"Projection result");
}
/**
* Listen geometry service fault handeler
*/
protected function onGeometryServiceFault(event:FaultEvent):void
{
trace(StringUtil.substitute("onGeometryServiceFault >> {0}", event.message));
Alert.show(event.fault.message, "Projection failt");
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Symbol for all point shapes -->
<esri:SimpleMarkerSymbol id="sms"
color="0x00FF00"
size="12"
style="{SimpleMarkerSymbol.STYLE_DIAMOND}"/>
<esri:GeometryService id="sampleGeometryService"
url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
projectComplete="onProjectComplete(event)"
fault="onGeometryServiceFault(event)"/>
</fx:Declarations>
<esri:Map id="myMap"
mapMouseDown="myMap_mapMouseDownHandler(event)"
level="3"
wrapAround180="true">
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>
<esri:GraphicsLayer id="myGraphicsLayer" symbol="{sms}"/>
</esri:Map>
</s:Application> Tell me where I am wrong.
... View more
09-19-2011
04:11 AM
|
0
|
0
|
5026
|
|
POST
|
<viewer:BaseWidget ...>
...
private var myGraphicsLayer:GraphicsLayer;
/**
* Listen widget template open handler
*/
protected function openHandler(event:Event):void
{
myGraphicsLayer = getMyGraphicsLayer();
if (!myGraphicsLayer)
{
// show alert 'Graphics Layer is null'
trace("GraphicsLayer not found");
}
else
{
trace(StringUtil.substitute("GraphicsLayer with id={0} found", myGraphicsLayer.id));
}
}
/**
* Get existing graphics layer or add new if does not exists
*/
private function getMyGraphicsLayer():GraphicsLayer
{
var result:GraphicsLayer = null;
if (map)
{
var mapLayers:ArrayCollection = map.layers as ArrayCollection;
for each (var mapLayer:Layer in mapLayers)
{
if (mapLayer is GraphicsLayer)
{
result = mapLayer as GraphicsLayer;
map.addEventListener(MapMouseEvent.MAP_MOUSE_DOWN, onMapClick);
break;
}
}
// if map has not any graphics layer add new
if (!result)
{
result = new GraphicsLayer();
map.addLayer(result);
}
}
return result;
}
/**
* Listen map mouse down event handler
*/
protected function onMapClick(event:MapMouseEvent):void
{
if (myGraphicsLayer)
{
var grGeometry:MapPoint = event.mapPoint;
var sms:SimpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 10, 0xFF0000);
var attributes:Object = new Object();
attributes.dateadded = new Date();
var gr:Graphic = new Graphic(grGeometry, sms, attributes);
var grId:String = myGraphicsLayer.add(gr);
trace(StringUtil.substitute("Graphic with id: {0} added.", grId));
}
}
/**
* Listen widget template close handler
*/
private function closedHandler(event:Event):void
{
if (map)
{
map.removeEventListener(MapMouseEvent.MAP_MOUSE_DOWN, onMapClick);
}
}
....
<viewer:WidgetTemplate id="wTemplate"
width="300"
height="300"
closed="closedHandler(event)"
open="openHandler(event)">
<!-- Here are widget contents -->
</viewer:WidgetTemplate>
</viewer:BaseWidget>
... View more
09-15-2011
11:24 PM
|
0
|
0
|
343
|
|
POST
|
Hi. Reading reference: fromJSON () method public static function fromJSON(json:String):FeatureSet Convert from JSON to FeatureSet. Parameters json:String â?? ArcGIS JSON String Returns FeatureSet â?? a new FeatureSet See also Input JSON should match this REST response syntax Try this: <?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:esri="http://www.esri.com/2008/ags"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<s:layout>
<s:VerticalLayout paddingBottom="6"/>
</s:layout>
<fx:Script>
<![CDATA[
import com.esri.ags.FeatureSet;
import com.esri.ags.Graphic;
import com.esri.ags.events.MapMouseEvent;
import com.esri.ags.geometry.Geometry;
import com.esri.ags.geometry.MapPoint;
import mx.collections.ArrayCollection;
import mx.utils.StringUtil;
private var jsonFeatureSet:String = "";
/**
* Listen map mouse down handler
*/
protected function myMap_mapMouseDownHandler(event:MapMouseEvent):void
{
//var grGeometry:MapPoint = myMap.extent.center;
var grGeometry:MapPoint = event.mapPoint;
var grAttributes:Object = new Object();
var dateAttr:Date = new Date();
grAttributes.creationDate = dateAttr;
var numberAttr:Number = 777;
grAttributes.n = numberAttr;
var boolAttr:Boolean = true;
grAttributes.b = boolAttr;
var stringAttr:String = "Text";
grAttributes.s = stringAttr;
var gr:Graphic = new Graphic(grGeometry, sms, grAttributes);
gr.toolTip = mx.utils.StringUtil.substitute("{0}\n{1}\n{2}\n{3}",
gr.attributes.creationDate,
gr.attributes.n,
gr.attributes.b,
gr.attributes.s);
var grId:String = myGraphicsLayer.add(gr);
trace(StringUtil.substitute("Graphic with id: {0} added.", grId));
}
/**
* Listen export button click handler
*/
protected function btnExportClick(event:MouseEvent):void
{
var arrGraphics:ArrayCollection = myGraphicsLayer.graphicProvider as ArrayCollection;
if (arrGraphics != null && arrGraphics.length > 0) {
var fsToExport:FeatureSet = new FeatureSet(arrGraphics.toArray());
fsToExport.geometryType = Geometry.MAPPOINT;
if (fsToExport != null) {
jsonFeatureSet = fsToExport.toJSON();
trace(jsonFeatureSet);
}
}
}
/**
* Listen import button click handler
*/
protected function btnImportClick(event:MouseEvent):void
{
if (jsonFeatureSet != null && jsonFeatureSet.length > 0) {
var fsImported:FeatureSet = FeatureSet.fromJSON(jsonFeatureSet);
if (fsImported != null) {
var arrImported:Array = fsImported.features as Array;
myGraphicsLayer.graphicProvider = arrImported;
}
}
}
/**
* Listen clear all button click handler
*/
protected function btnClearClick(event:MouseEvent):void
{
myGraphicsLayer.clear();
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Symbol for all point shapes -->
<esri:SimpleMarkerSymbol id="sms"
color="0x00FF00"
size="12"
style="{SimpleMarkerSymbol.STYLE_DIAMOND}"/>
</fx:Declarations>
<esri:Map id="myMap"
mapMouseDown="myMap_mapMouseDownHandler(event)"
level="3"
wrapAround180="true">
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>
<esri:GraphicsLayer id="myGraphicsLayer" symbol="{sms}"/>
</esri:Map>
<s:Button id="btnExport" label="Export to JSON string" click="btnExportClick(event)"/>
<s:Button id="btnClearAll" label="Clear all graphics" click="btnClearClick(event)"/>
<s:Button id="btnImport" label="Import from JSON string" click="btnImportClick(event)"/>
</s:Application> In this sample: 1 - Add graphics clicking on Map 2 - Click export to JSON button 3 - Click clear graphics button 4 - Click import fromJSON button Symbols 😞 The 1 of the ways, to hold information about symbols = save it in one of the attributes in your graphic object. Parse this attribute when "FeatureSet.fromJSON" complete (create own classes, methods). Create symbol based on parsed data on fly. Good luck.
... View more
09-12-2011
01:41 AM
|
0
|
0
|
1004
|
|
POST
|
Hi, FeatureSet is Array of Graphics. FeatureSet () Constructor public function FeatureSet(features:Array = null) where features property features:Array Array of graphic features. ... See also com.esri.ags.Graphic Each feature in features array is Graphic. Each Graphic (in JSON) consists of "geometry" (in JSON) and "attributes" (in JSON) smthing like: "features" : [ { "geometry" : { "x" : -178.24479999999991, "y" : 50.012500000000045 }, "attributes" : { "objectid" : 3745682, "datetime" : 1272210710000, "depth" : 31.100000000000001, "eqid" : "2010vma5", "latitude" : 50.012500000000003, "longitude" : -178.2448, "magnitude" : 4.7999999999999998, "numstations" : 112, "region" : "Andreanof Islands, Aleutian Islands, Alaska", "source" : "us", "version" : "Q" } }, { "geometry" : { "x" : -72.865099999999927, "y" : -37.486599999999953 }, "attributes" : { "objectid" : 3745685, "datetime" : 1272210142999, "depth" : 40.600000000000001, "eqid" : "2010vma4", "latitude" : -37.486600000000003, "longitude" : -72.865099999999998, "magnitude" : 4.9000000000000004, "numstations" : 58, "region" : "Bio-Bio, Chile", "source" : "us", "version" : "7" } } ] com.esri.ags.FeatureSet has public methods: fromJSON () method public static function fromJSON(json:String):FeatureSet toJSON () method public function toJSON():String Good luck.
... View more
09-08-2011
10:52 PM
|
0
|
0
|
1004
|
|
POST
|
You need to search information about mobile browser meta tags. Some times ago we solved the similar problem with:
...
<head>
<title>${title}</title>
<meta name="google" value="notranslate">
<meta name="viewport" content="width=device-width, target-densitydpi=high-dpi, initial-scale=1.0, user-scalable=no" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
... Try to search in web this key worlds: "Building web pages to support different screen densities". Good luck
... View more
08-16-2011
12:43 AM
|
0
|
0
|
365
|
|
POST
|
Curt, read more about imageFormat property for dynamic type layers. http://forums.arcgis.com/threads/27413-layer-transparency-not-working
... View more
08-09-2011
08:49 PM
|
0
|
0
|
322
|
| 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
|