POST
|
Hi Elisa; This thread provides one solution for this: Text to Date using Arcade Expressions You may want to also check out the following blog, which contains some useful information on working with dates and times: Unwinding the Clock: Visualizing Time with Arcade
... View more
11-27-2018
06:18 AM
|
1
|
0
|
609
|
POST
|
Awesome, thanks for that helpful clarification and insight Kelly!
... View more
07-31-2018
07:17 AM
|
0
|
0
|
980
|
POST
|
Hi Robert, adding nuanced label expressions can be accomplished by editing web maps creating in ArcGIS Online or ArcGIS Enterprise using the Map Viewer and working with Arcade expressions. Arcade provides formatting functions as well as global variables that provide direct access to features in the map for labeling purposes. Here is an example web map that illustrates the process involved.
... View more
07-26-2018
01:45 PM
|
0
|
2
|
980
|
POST
|
Hi Brendan; It's a common question; in most cases it makes sense to combine fewer layers in a service for multiple reasons: performance, cartographic display, user experience, etc. arcgis server - Lots of layers in one or multiple services? (and why) - Geographic Information Systems Stack Exchange While there isn't a magic number, there is usually a practical ceiling for managing layers within the same service.
... View more
08-13-2014
06:04 AM
|
1
|
0
|
585
|
POST
|
Hi Jay, this might work for you: JS API 3.2 - When do layers render? The map and the featurelayer both have this property (update-end) featurelayer-amd | API Reference | ArcGIS API for JavaScript
... View more
07-29-2014
11:41 AM
|
0
|
0
|
596
|
POST
|
HI Jay, I wonder if you could use PictureMarkerSymbol as an alternative? Esri picture marker symbol generator for JavaScript developers | ArcGIS Blog
... View more
07-29-2014
10:08 AM
|
0
|
0
|
1348
|
POST
|
What benefits/drawbacks have you experienced when using web maps as an application data source? This is a much discussed topic, so I'm looking for any insights or personal experiences on either end of the spectrum.
... View more
07-21-2014
12:13 PM
|
0
|
1
|
3803
|
POST
|
Can you use the array of layers in the response as a way to accomplish this? var layers = response.itemInfo.itemData.operationalLayers;
... View more
07-21-2014
12:02 PM
|
0
|
3
|
663
|
POST
|
This presentation from the UC provides some details on 3D web content: https://community.esri.com/docs/DOC-1818
... View more
07-18-2014
12:06 PM
|
0
|
0
|
370
|
POST
|
HI Gauri, this sample illustrates how to get a map from the web map response: Web map using JSON | ArcGIS API for JavaScript The key aspect of the sample is using the arcgisUtils class to create a deferred object, then obtain the map from the response. arcgisUtils.createMap(webmap,"map").then(function(response){ var map = response.map; //do something with the map here
... View more
07-18-2014
11:54 AM
|
1
|
6
|
663
|
POST
|
Hi Kevin, I ended up with the same error during the build process.. maybe I'm not doing something right? Errors: Encountered errors or warnings while building project NEPTableQuery.mxml. NEPTableQuery.mxml: Could not resolve <esri:QueryTask> to a component implementation. NEPTableQuery.mxml: Could not resolve <esri:Query> to a component implementation. Entire MXML Code: <?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:esri="http://www.esri.com/2008/ags"
xmlns:s="library://ns.adobe.com/flex/spark"
pageTitle="NEP Project Information">
<!--
This sample shows how to query the server and displaying
the result in a datagrid.
The query is sent using the execute() method on a QueryTask.
This sample sets up a QueryTask (what layer on what server to query).
When the user clicks the "Get Details" button, a Query is sent with
the user-provided text to search for.
Meanwhile a DataGrid has been created which listens for the results
(using executeLastResult) from the querytask.
-->
<s:layout>
<s:VerticalLayout horizontalAlign="center" paddingTop="25"/>
</s:layout>
<fx:Script>
<![CDATA[
public function get where():String
public function set where(value:String):void
public function set csvName(value:String):void
{
_csvName = value;
}
public function set csvSeperator(value:String):void
{
_csvSep = value;
}
public function set csvExportOptionLbl(value:String):void
{
_exp2csvBtnLbl = value;
}
public function set txtExportOptionLbl(value:String):void
{
_exp2txtBtnLbl = value;
}
public function set ExportButtonLbl(value:String):void
{
_exportButtonLbl = value;
}
private function exportTo(event:Event):void
{
try
{
var data:String;
var defaultFileName:String;
if(optiongroup.selectedValue == _exp2csvBtnLbl){
data = exportCSV(resultsGrid,_csvSep);
defaultFileName = _csvName + ".csv";
}else{
data = exportTXT(resultsGrid);
defaultFileName = _csvName + ".txt";
}
var fileReference:FileReference = new FileReference();
fileReference.save(data,defaultFileName);
}
catch(error:Error)
{
Alert.show(error.message);
}
}
private function exportCSV(dataGrid:DataGrid, csvSeparator:String=",", lineSeparator:String="\n"):String
{
try
{
var data:String = "";
var columnArray:Array = dataGrid.columns;
var columnCount:int = columnArray.length;
var dataGridColumn:DataGridColumn;
var header:String = "";
var headerGenerated:Boolean = false;
var dataProvider:Object = ObjectUtil.copy(dataGrid.dataProvider);
//trace(ObjectUtil.toString(dataProvider));
var rowCount:int = dataProvider.length;
var dp:Object = null;
var cursor:IViewCursor = dataProvider.createCursor();
var j:int = 0;
//loop through rows
while (!cursor.afterLast)
{
var object:Object = null;
object = cursor.current;
//loop through all columns for the row
for(var i:int = 0; i < columnCount; i++)
{
dataGridColumn = columnArray;
//Exclude column data which is invisible (hidden)
if(!dataGridColumn.visible)
{
continue;
}
if(dataGridColumn.itemRenderer)
{
data += "\""+ object[dataGridColumn.dataField] + "\"";
}else{
data += "\""+ dataGridColumn.itemToLabel(object)+ "\"";
}
if(i < (columnCount -1))
{
data += csvSeparator;
}
//generate header of CSV, only if it's not genereted yet
if (!headerGenerated)
{
header += "\"" + dataGridColumn.headerText + "\"";
if (i < columnCount - 1)
{
header += csvSeparator;
}
}
}
headerGenerated = true;
if (j < (rowCount - 1))
{
data += lineSeparator;
}
j++;
cursor.moveNext ();
}
//set references to null:
dataProvider = null;
columnArray = null;
dataGridColumn = null;
}
catch(error:Error)
{
return null;
Alert.show(error.message);
}
return (header + lineSeparator + data);
}
private function exportTXT(dataGrid:DataGrid, lineSeparator:String="\n"):String
{
try
{
var data:String = "";
var columnArray:Array = dataGrid.columns;
var columnCount:int = columnArray.length;
var dataGridColumn:DataGridColumn;
var header:String = "";
var headerGenerated:Boolean = false;
var dataProvider:Object = ObjectUtil.copy(dataGrid.dataProvider);
var rowCount:int = dataProvider.length;
var dp:Object = null;
var cursor:IViewCursor = dataProvider.createCursor();
var j:int = 0;
//loop through rows
while (!cursor.afterLast)
{
var object:Object = null;
object = cursor.current;
//loop through all columns for the row
for(var i:int = 0; i < columnCount; i++)
{
dataGridColumn = columnArray;
//Exclude column data which is invisible (hidden)
if(!dataGridColumn.visible)
{
continue;
}
if(dataGridColumn.itemRenderer)
{
data += "\""+ object[dataGridColumn.dataField] + "\"";
}else{
data += "\""+ dataGridColumn.itemToLabel(object)+ "\"";
}
if(i < (columnCount -1))
{
data += "\t";
}
//generate header of CSV, only if it's not genereted yet
if (!headerGenerated)
{
header += "\"" + dataGridColumn.headerText + "\"";
if (i < columnCount - 1)
{
header += "\t";
}
}
}
headerGenerated = true;
if (j < (rowCount - 1))
{
data += lineSeparator;
}
j++;
cursor.moveNext ();
}
//set references to null:
dataProvider = null;
columnArray = null;
dataGridColumn = null;
}
catch(error:Error)
{
return null;
Alert.show(error.message);
}
return (header + lineSeparator + data);
}
]]>
</fx:Script>
<fx:Declarations>
<esri:QueryTask id="queryTask"
url="http://134.67.224.174/ArcGIS/rest/services/NEPmap/nepmap1/MapServer/1"
useAMF="false"/>
<esri:Query id="query"
outFields="[PROJECT_NAME, PROJECT_DESCRIPTION, ACRES, HABITAT_DESCRIPTION, GPRA_CATEGORY, RESTORATION_TECHNIQUE, LEAD_PARTNER]"
returnGeometry="false"
text="{nepName.SelectedItem}"/>
<s:RadioButtonGroup id="optiongroup"/>
</fx:Declarations>
<s:Panel title="NEP Project Information">
<s:layout>
<s:VerticalLayout/>
</s:layout>
<s:HGroup verticalAlign="middle">
<mx:FormItem label="Search for NEP Information">
<s:ComboBox id="nepName" dataProvider="{NEP_NAME}" prompt="Select NEP" enabled="true"/>
</mx:FormItem>
</s:HGroup>
<mx:DataGrid id="resultsGrid"
dataProvider="{queryTask.executeLastResult.attributes}"
visible="{queryTask.executeLastResult != null}">
<mx:columns>
<mx:DataGridColumn dataField="PROJECT_NAME" headerText="Project Name"/>
<mx:DataGridColumn dataField="PROJECT_DESCRIPTION" headerText="Project Description"/>
<mx:DataGridColumn dataField="ACRES" headerText="Number of Acres"/>
<mx:DataGridColumn dataField="GPRA_CATEGORY" headerText="Habitat Type"/>
<mx:DataGridColumn dataField="HABITAT_DESCRIPTION" headerText="Habitat Description"/>
<mx:DataGridColumn dataField="RESTORATION_TECHNIQUE" headerText="Restoration Technique"/>
<mx:DataGridColumn dataField="LEAD_PARTNER" headerText="Lead Partner"/>
</mx:columns>
</mx:DataGrid>
<s:controlBarContent>
<s:HGroup verticalAlign="middle">
<s:RadioButton label="{_exp2csvBtnLbl}" groupName="optiongroup" selected="true"/>
<s:RadioButton label="{_exp2txtBtnLbl}" groupName="optiongroup"/>
<s:Button label="{_exportButtonLbl}" id="Export" click="exportTo(event)" skinClass="ExportButtonSkin"/>
</s:HGroup>
</s:controlBarContent>
<s:controlBarLayout>
<s:HorizontalLayout horizontalAlign="right" paddingTop="3" paddingBottom="2" paddingRight="5" />
</s:controlBarLayout>
</s:Panel>
</s:Application>
Thanks for your help, Alison It looks like it cannot resolve the <esri:> xml namespace, just confirm that you have referenced the the API correctly. Do you have the ags .SWC in the build path or in the libs folder within Flash Builder? ==Kevin
... View more
10-11-2011
03:18 PM
|
0
|
0
|
155
|
POST
|
Hi Alison: You use the Id of your control with the property SelectedItem: text="{nephName.SelectedItem}"
... View more
10-04-2011
10:05 AM
|
0
|
0
|
155
|
POST
|
You could try using Isolated Storage: private void SaveGraphics_Click(object sender, RoutedEventArgs e) { try { //Save the graphics layer GraphicsLayer graphicsLayer = MyMap.Layers["StatesGraphicsLayer"] as GraphicsLayer; GraphicCollection pGC = graphicsLayer.Graphics; //Isolated Storage -- Write Graphics IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication(); using (Stream pStream = isf.OpenFile(_ISFileName, FileMode.Create, FileAccess.Write)) { StreamWriter pStreamWriter = new StreamWriter(pStream); foreach (Graphic g in pGC) { if (g.Geometry is ESRI.ArcGIS.Client.Geometry.MapPoint) { MapPoint pPoint = (MapPoint)g.Geometry; pStreamWriter.WriteLine("Point, " + pPoint.X.ToString() + ", " + pPoint.Y.ToString()); } if (g.Geometry is ESRI.ArcGIS.Client.Geometry.Polyline) { ESRI.ArcGIS.Client.Geometry.Polyline pPolyline = (ESRI.ArcGIS.Client.Geometry.Polyline)g.Geometry; ESRI.ArcGIS.Client.Geometry.PointCollection[] pPC = pPolyline.Paths.ToArray(); pStreamWriter.Write("Polyline, "); foreach (MapPoint p in pPC[0]) { pStreamWriter.Write(p.X.ToString() + ", " + p.Y.ToString() + ","); } pStreamWriter.WriteLine(); } if (g.Geometry is ESRI.ArcGIS.Client.Geometry.Polygon) { ESRI.ArcGIS.Client.Geometry.Polygon pPolygon = (ESRI.ArcGIS.Client.Geometry.Polygon)g.Geometry; ESRI.ArcGIS.Client.Geometry.PointCollection[] pPC = pPolygon.Rings.ToArray(); pStreamWriter.Write("Polygon, "); foreach (MapPoint p in pPC[0]) { pStreamWriter.Write(p.X.ToString() + ", " + p.Y.ToString() + ","); } pStreamWriter.WriteLine(); } } pStreamWriter.Close(); pStream.Close(); } } catch { MessageBox.Show("Error", "Error", MessageBoxButton.OK); } }
... View more
02-02-2011
08:16 AM
|
0
|
0
|
455
|
POST
|
I have been playing around with WMS layers in a WPF application but am having some difficulty getting any WMS layers to display when using a service not given in the WMS_WPF sample (for v1.2 of the API). Using either this sample solution or the Toolkit.Datasources assembly in v2.0 I get the same problem. What am I missing? I have the following piece of xaml nested in the Map.Layers section of the WMS_WPF sample solution <esriWMS:WMSMapServiceLayer ID="MyLayer" Layers="2909_17518_bg" Url="http://aes.gsfc.nasa.gov/cgi-bin/wms" Opacity="0.7"></esriWMS:WMSMapServiceLayer> equivalently, <esriToolkitDS:WmsLayer ID="MyLayer" Layers="2909_17518_bg" Url="http://aes.gsfc.nasa.gov/cgi-bin/wms" Opacity="0.7"></esriToolkitDS:WmsLayer> in v2.0 of the API. Hi, have you set up a cross domain (clientaccesspolicy) that permits this use of this URL?
... View more
07-28-2010
11:59 AM
|
0
|
0
|
288
|
Title | Kudos | Posted |
---|---|---|
1 | 11-27-2018 06:18 AM | |
1 | 08-13-2014 06:04 AM | |
1 | 07-18-2014 11:54 AM |
Online Status |
Offline
|
Date Last Visited |
Wednesday
|