|
POST
|
Now, on your project, why can't we see the layers we select on the map, just on the legend? Also, for that to work do I have to have that legendskin.mxml? 1 - on your project - are you talk about this sample http://web.zone.ee/bespiva/legendwithskin/ ??? [/HR] 2 - why can't we see the layers we select on the map - hmmmmmmmm just zoom to some big city (LA, NY, ...) and you'll see all streets, parks ... you turn on in TOC. Some sublayers are empty (no map features), but layer is visible and has all needed information to be shown in legend [/HR] 3 - do I have to have that legendskin.mxml? - IMHO skin is just a skin ~ collection of rules+styles by which the element/component is drawn, so if you need to change smthing in legend visualization - yes the better way to change skin. Skin is used in my sample, because default esri legend skin has some bugs P.S. Anatomy of a skin class (Adobe help with samples)
... View more
05-23-2012
10:20 PM
|
0
|
0
|
1053
|
|
POST
|
add layerDetails property to FeatureCollection <?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="10"
paddingLeft="10"
paddingRight="10"
paddingTop="10" />
</s:layout>
<fx:Script>
<![CDATA[
import com.esri.ags.FeatureSet;
import com.esri.ags.Graphic;
import com.esri.ags.SpatialReference;
import com.esri.ags.geometry.Extent;
import com.esri.ags.geometry.MapPoint;
import com.esri.ags.layers.FeatureLayer;
import com.esri.ags.layers.supportClasses.FeatureCollection;
import com.esri.ags.layers.supportClasses.LayerDetails;
import com.esri.ags.symbols.SimpleMarkerSymbol;
private var spatialReference:SpatialReference = new SpatialReference(102100); // the same as in base(tiled) layer
private var initialExtent:Extent;
private function addFeatureLayer(features:Array):void
{
var featureSet:FeatureSet = new FeatureSet(features);
var layerDetails:LayerDetails = new LayerDetails();
var featureLayer:FeatureLayer = new FeatureLayer();
featureLayer.featureCollection = new FeatureCollection(featureSet, layerDetails);
map.addLayer(featureLayer);
map.initialExtent = initialExtent;
map.zoomToInitialExtent();
}
protected function onAddButtonClick(event:MouseEvent):void
{
var graphicCollection:Array = new Array();
// create 10 features with random location
for (var i:int; i < 10; i++)
{
var x:Number = Math.random() * 1000000;
var y:Number = Math.random() * 1000000;
var pt:MapPoint = new MapPoint(x, y, spatialReference);
var attributes:Object = new Object();
attributes.timeStamp = new Date();
var graphic:Graphic = new Graphic(pt, new SimpleMarkerSymbol(), attributes);
graphic.toolTip = attributes.timeStamp.toString();
graphicCollection.push(graphic);
var ptExtent:Extent = new Extent(x, y, x, y, spatialReference);
if (!initialExtent)
{
initialExtent = ptExtent;
}
else
{
initialExtent = initialExtent.union(ptExtent);
}
}
addFeatureLayer(graphicCollection);
}
]]>
</fx:Script>
<s:Button label="Add feature layer"
click="onAddButtonClick(event)" />
<esri:Map id="map">
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
</esri:Map>
</s:Application>
... View more
05-23-2012
09:24 PM
|
0
|
0
|
717
|
|
POST
|
TypeError: Error #1009: Cannot access a property or method of a null object reference comes from this part of code queryTask.executeLastResult.attributes it does not matter where you use this code in ColumnChart tag <mx:ColumnChart id="columnChart"
dataProvider="{queryTask.executeLastResult.attributes}"
visible="{queryTask.executeLastResult != null}">
</mx:ColumnChart> or in script tag function queryOnClick():void
{
/** execute your query, then add the following: */
columnChart.dataProvider = queryTask.executeLastResult.attributes;
if(queryTast.executeLastResult != null)
{
columnChart.visible = true;
}else{
columnChart.visible = false;
}
} If the queryTask is never executed, then queryTask.executeLastResult is null!!! So queryTask.executeLastResult.attributes returns TypeError: Error #1009: Cannot access a property or method of a null object reference example / rule var myAnyTypeObject:* = null;
var somePr:* = myAnyTypeObject.someproperty; // returns TypeError: Error #1009: Cannot access a property ...
myAnyTypeObject.executeSomeFunction();// returns TypeError: Error #1009: Cannot access ... method ... Right? I would suggest to take Ben's code with some changes function queryOnClick():void
{
if(queryTask.executeLastResult != null)
{
columnChart.dataProvider = queryTask.executeLastResult.attributes;
columnChart.visible = true;
}else{
columnChart.visible = false;
}
}
... View more
05-23-2012
05:52 AM
|
0
|
0
|
696
|
|
POST
|
use visibleLayers property dynamicLayer.visibleLayers = new ArrayCollection([0, 1]); sample here
... View more
05-21-2012
05:40 AM
|
0
|
0
|
801
|
|
POST
|
From REST API help GPMultiValue Note that support for the GPMultiValue parameter type was added at 10 The fully-qualified data type for a GPMultiValue parameter is GPMultiValue:<memberDataType>, where memberDataType is one of the data types defined above. For ex. GPMultiValue:GPString, GPMultiValue:GPLong, etc. Note that at 10.0 only GPMultiValue:GPString data type is supported From 10.1 onwards all GP data types will be supported in a GPMultiValue. The parameter value for GPMultiValue data types is a JSON array. Each element in this array is of the data type as defined by the memberDataType suffix of the fully-qualified GPMultiValue data type name. Example 1: GPMultiValue:GPString data type ["Parcels", "Street Lights"] Example 2: GPMultiValue:GPLinearUnit data type: [ { "distance" : 345.67, "units" : "esriMiles" }, { "distance" : 36, "units" : "esriMiles" } ] via Geoprocessing task you can - Send a request to the server to execute a synchronous geoprocessing task. - Submit a job request to the server to execute an asynchronous geoprocessing task. I think input parameters are: var inputParams:Object = new Object();
inputParams.in_feature1 = "string type parameter"; // GPString = String
inputParams.in_featureliste = ["Red", "Green", "Blue"]; // GPMultiValue:GPString = Array
// yourGPTask.execute(inputParams); // - synchronous
// yourGPTask.submitJob(inputParams, new AsyncResponder(resultfunctionname, faultfunctionname ...)); // - asynchronous
... View more
05-21-2012
03:48 AM
|
0
|
0
|
673
|
|
POST
|
Sample app here sources view here Some code copied from this resource
... View more
05-17-2012
12:35 PM
|
0
|
0
|
1063
|
|
POST
|
---> find skin in downloaded ArcGIS API for FLEX \arcgis_api_for_flex_3_0\ArcGIS_Flex\skins\src\com\esri\ags\skins\AttributeInspectorSkin.mxml ---> include skin in to your project (rename if needed) ---> add skinClass attribute to your ispector with reference to included skin ...
<esri:AttributeInspector id="attributeInspector"
visible="false"
includeInLayout="false"
skinClass="ee.alphagis.assets.skins.MyAttributeInspectorSkin"
... ---> in skin find <mx:Form> tag <!--- 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"> ---> configure form layout NB! examples you looked for for example: <!--- Form to display the attributes of the active feature. -->
<mx:Form id="form"
labelWidth="100"
... ---> other way is work (need some dev. exp.) with Fields used in attribute inspector: DoubleField IntegerField StringField ... and others in same package you can extend them, skin them, also create own fields ...
... View more
05-16-2012
11:57 PM
|
0
|
0
|
616
|
|
POST
|
Are you looking for something like this? Some time ago we had similar question - did not find any free animated swf collection 😞 Good collection of map icons, but it is not animated - http://mapicons.nicolasmollet.com/
... View more
05-09-2012
11:07 PM
|
0
|
0
|
406
|
|
POST
|
visiblelayers attribute in <layer> tag visiblelayers �?? Determines the sublayers to show when the application first opens. The default is as specified on the server. Only applies to dynamic, arcims, and wms. It's required for WMS, or no sublayers will be shown.
... View more
05-09-2012
05:42 AM
|
0
|
0
|
404
|
|
POST
|
gis-varna, Sorry, I do not have time to explore "your" code. source of answers to your questions with free video trainings. (Take a look to "Day 3: Data handling and manipulation")
... View more
05-08-2012
03:38 AM
|
0
|
0
|
1283
|
|
POST
|
gis-varna, sample - sources via bindable attributes or dispatch/listen events
... View more
05-07-2012
12:42 AM
|
0
|
0
|
1283
|
|
POST
|
I can't find a remove function too, but ESRI Viewer is extandable application you can extend WidgetTemplate.as as you want (this code is just a sample - not tested)
// Viewer version is 2.5
public function addTitlebarButton(btnIcon:String, btnTip:String, btnFunction:Function, selectable:Boolean = true):void
{
var btn:TitlebarButton = new TitlebarButton();
btn.callback = btnFunction;
btn.selectable = selectable;
btn.source = btnIcon;
btn.toolTip = btnTip;
if (selectable)
{
btn.addEventListener(MouseEvent.CLICK, titlebarButton_clickHandler);
if (headerToolGroup.numElements == 0)
{
selectedTitlebarButtonIndex = 0; // automatically select the first button added
}
}
headerToolGroup.addElement(btn);
}
public function removeTitlebarButton(item:TitlebarButton):Boolean
{
var success:Boolean = false;
// next logic is the same as in headerToolGroup.removeElement(...)
if (item != null)
{
try
{
var buttonIndex:int = headerToolGroup.getElementIndex(item);
if (buttonIndex > -1)
{
headerToolGroup.removeElementAt(buttonIndex);
success = true;
}
}
catch (error:ArgumentError) // child element not exists in headerToolGroup
{
trace(error.getStackTrace());
}
}
return success;
}
... View more
05-02-2012
05:39 AM
|
0
|
0
|
494
|
| 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
|