POST
|
Hi Brandon, Changing that setting would only apply if you were working with a hosted feature service, can I ask what version of ArcGIS Server you're using? Is it 10.2? - Daniel Daniel, I am using ArcGIS server 10.1.
... View more
12-06-2013
06:33 AM
|
0
|
0
|
387
|
POST
|
Brandon, Are you working with a hosted feature service or a service that you've published to your own ArcGIS Server? If it's a hosted feature service, try the following; You'll have to be an administrator to do so. My Organization > Edit Settings > Security > uncheck the box for "Allow only standard SQL queries." - Daniel Hey Daniel, I am working with a service that I have published to my own ArcGIS Server. Will changing the security setting for standard SQL queries still apply? Thanks, Brandon
... View more
12-05-2013
11:35 AM
|
0
|
0
|
387
|
POST
|
I am not completely understanding how to build the widgets in dashboard. When I try to add a gauge I can pick my data source and set other properties fine but when I click ok the widget is blank. When I click configure on the gauge the data source has a red triangle/white exclamation point as if the data source is bad. Could this be because my data source is from a secured (https) url? I can see the data fine in the map and edit successfully.
... View more
12-03-2013
05:25 AM
|
0
|
5
|
3179
|
POST
|
If it`s not, then one more question: does the map service return geometry, not just attributes? If yes, then you could just set out spatial reference for your queries. If it doesn`t return geometry and you can`t make it return geometry (using XY event layers, for example) then you need to use Geometry Service indeed. There are few samples in the API documentation. http://resources.arcgis.com/en/help/silverlight-api/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.GeometryService~ProjectAsync.html http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Project There was a nice class for auto reprojection, but it looks like it`s not available now. http://blogs2.esri.com/esri/arcgis/2011/02/13/auto-reprojecting-graphics-layers/ The TruckGPS map service does not return geometry. Just attributes. Thanks for the help I will look into the geometry service more.
... View more
11-27-2013
07:48 AM
|
0
|
0
|
831
|
POST
|
http://gisaprd/ArcGIS/rest/services/AerialCoordinateTest/MapServer What spatial reference this map service uses? It is not 102100? The spatial reference is: 102697 for the tiled service.
... View more
11-27-2013
07:45 AM
|
0
|
0
|
831
|
POST
|
Looks like you are converting between 4326 and 3857 (102100). No need to use geometry service for that, it would be much more efficient to use ESRI.ArcGIS.Client.Projection.WebMercator. Also consider adding timestamp to your data to get rid of "1=1" queries (or maybe it would be better to use a kind of Duplex Services to notify clients, it depends). Also there is a Tracking server for that kind of tasks. TDenis, Thanks for the reply. I tried your suggestion and I am getting a result when I use the "Mercator.FromGeographic" method but it is still not within my tiled service. Is there a more specific coordinate system I need to explicitly declare? My Lat/Long value: 37.1223133333333,-93.27893 Mercator.FromGeographic converted value: X=-10382795.4374339, Y=4469266.40579955, WKID=102100 Mercator.ToGeographic converted value: X=-0.000837860806483038, Y=0.000334317600035687, WKID=4326 Neither of these coordinates put my graphics in the correct location. It should be closer to something like this: X=1424565.77, Y=501970.98. I am trying to learn more about coordinate systems, conversions between systems, etc. Any thoughts on what I can try next?
... View more
11-27-2013
05:28 AM
|
0
|
0
|
831
|
POST
|
Hi, I am attempting to make a simple map that will allow users to see a truck's GPS location on top of a tiled map service. I am having difficulty getting the graphic symbol to overlap my tiled service because the spatial systems do not match. Is there a good example or could someone help me conversion through a geometry service? Is a geometry service even the correct method to use for plotting my graphics? Here is my code so far. Xaml: <UserControl x:Class="TruckGPS_Test.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400" xmlns:esri="http://schemas.esri.com/arcgis/client/2009" xmlns:esriSymbols="clr-namespace:ESRI.ArcGIS.Client.Symbols;assembly=ESRI.ArcGIS.Client"> <Grid x:Name="LayoutRoot" Background="White"> <Grid.Resources> <esri:SimpleMarkerSymbol x:Key="RedMarkerSymbol" Color="Red" Size="12" Style="Circle" /> <esri:SimpleMarkerSymbol x:Key="YellowMarkerSymbol" Color="Yellow" Size="25" Style="Circle" /> <esriSymbols:PictureMarkerSymbol x:Name="TRUCK" Source="images/bucket-truck-box.png" /> </Grid.Resources> <esri:Map x:Name="MyMap" WrapAround="True" Margin="0,0,-325,-506" MouseMove="MyMap_MouseMove"> <!--<esri:ArcGISTiledMapServiceLayer ID="MyLayer" Url="http://gisaprd/ArcGIS/rest/services/BaseMap_ArcReader_Cached/MapServer" />--> <!--<esri:ArcGISTiledMapServiceLayer ID="MyLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />--> <esri:ArcGISTiledMapServiceLayer ID="Aerials" Url="http://gisaprd/ArcGIS/rest/services/AerialCoordinateTest/MapServer" Visible="False" /> <esri:ArcGISDynamicMapServiceLayer Url="http://gisaprd/ArcGIS/rest/services/BaseMapCool__WebViewer/MapServer" /> <esri:GraphicsLayer ID="TruckGPS" > <esri:GraphicsLayer.MapTip> <Grid Background="#FFD65555" > <Border BorderBrush="#FFFF0000" BorderThickness="1" CornerRadius="5" /> <StackPanel Orientation="Vertical" > <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding [USER_NAME]}" FontWeight="Bold" Foreground="White" HorizontalAlignment="Left"/> </StackPanel> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding [SYSTIME]}" FontWeight="Bold" Foreground="White" HorizontalAlignment="Left"/> </StackPanel> </StackPanel> </Grid> </esri:GraphicsLayer.MapTip> </esri:GraphicsLayer> </esri:Map> <Grid MinWidth="300" HorizontalAlignment="Right" Background="White" VerticalAlignment="Top" Margin="0,15,15,0" > <StackPanel Margin="5"> <TextBlock x:Name="ScreenCoordsTextBlock" HorizontalAlignment="Left" VerticalAlignment="Center" Text="Screen Coords: " TextWrapping="Wrap" /> <TextBlock x:Name="MapCoordsTextBlock" HorizontalAlignment="Left" VerticalAlignment="Center" Text="Map Coords: " TextWrapping="Wrap" /> </StackPanel> </Grid> </Grid> </UserControl> C# using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using ESRI.ArcGIS.Client; using ESRI.ArcGIS.Client.Geometry; using ESRI.ArcGIS.Client.Symbols; using System.Runtime.Serialization; using ESRI.ArcGIS.Client.Tasks; using System.Windows.Threading; using ESRI.ArcGIS.Client.Bing; namespace TruckGPS_Test { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); //AddMarkerGraphics(); QueryTask queryTaskTruckGPS = new QueryTask("http://gisaprd/ArcGIS/rest/services/TruckGPS/MapServer/8"); queryTaskTruckGPS.ExecuteCompleted += QueryTask_ExecuteCompletedTruckGPS; ESRI.ArcGIS.Client.Tasks.Query queryTruckGPS = new ESRI.ArcGIS.Client.Tasks.Query(); queryTruckGPS.OutFields.Add("*"); queryTruckGPS.ReturnGeometry = false; queryTruckGPS.Where = "1=1"; queryTaskTruckGPS.ExecuteAsync(queryTruckGPS, "initial"); //This timer updates the outage feature count after a 30 second wait System.Windows.Threading.DispatcherTimer myDispatcherTimer = new System.Windows.Threading.DispatcherTimer(); myDispatcherTimer.Interval = new TimeSpan(0, 0, 0, 10, 0); myDispatcherTimer.Tick += new EventHandler(Each_Tick); myDispatcherTimer.Start(); } public void Each_Tick(object o, EventArgs sender) { QueryTask queryTaskTruckGPS = new QueryTask("http://gisaprd/ArcGIS/rest/services/TruckGPS/MapServer/8"); queryTaskTruckGPS.ExecuteCompleted += QueryTask_ExecuteCompletedTruckGPS; ESRI.ArcGIS.Client.Tasks.Query queryTruckGPS = new ESRI.ArcGIS.Client.Tasks.Query(); queryTruckGPS.OutFields.Add("*"); queryTruckGPS.ReturnGeometry = false; queryTruckGPS.Where = "1=1"; queryTaskTruckGPS.ExecuteAsync(queryTruckGPS, "initial"); } private void QueryTask_ExecuteCompletedTruckGPS(object sender, ESRI.ArcGIS.Client.Tasks.QueryEventArgs args) { //If Counter isn't working check the web service, make sure the table is added to the map service FeatureSet featureSet = args.FeatureSet; GraphicsLayer graphicsLayer = MyMap.Layers["TruckGPS"] as GraphicsLayer; graphicsLayer.ClearGraphics(); if (featureSet != null && featureSet.Features.Count > 0) { ////Check the system time and subtract the time amount wanted from the last gps systime read for movement or idle truck //System.DateTime dTime = DateTime.Now; //// tSpan is 0 days, 0 hours, 0 minutes, and 0 seconds. //System.TimeSpan tSpan = new System.TimeSpan(0, 1, 0, 0); //System.DateTime result = dTime - tSpan; foreach (ESRI.ArcGIS.Client.Graphic feature in featureSet.Features) { if ((feature.Attributes["LONGITUDE"] != null) && (feature.Attributes["LATITUDE"] != null) ) //&& (feature.Attributes["S"]) { var Machine_Name = feature.Attributes["MACHINE_NAME"].ToString(); var User_Name = feature.Attributes["USER_NAME"].ToString(); double x = Convert.ToDouble(feature.Attributes["LONGITUDE"]); double y =Convert.ToDouble(feature.Attributes["LATITUDE"]); feature.Geometry = new MapPoint(x, y); //if (User_Name == "CU656") //{ feature.Symbol = LayoutRoot.Resources["TRUCK"] as ESRI.ArcGIS.Client.Symbols.Symbol; graphicsLayer.Graphics.Add(feature); //} //else //{ // feature.Symbol = LayoutRoot.Resources["RedMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol; // graphicsLayer.Graphics.Add(feature); //} } } { (MyMap.Layers["TruckGPS"] as GraphicsLayer).Refresh(); }; } else { graphicsLayer.ClearGraphics(); //MessageBox.Show("No features returned from query"); } } } }
... View more
11-26-2013
12:24 PM
|
0
|
8
|
4860
|
POST
|
I have been looking at this example in the help but I am having trouble taking my Truck_GPS graphics layer and changing the spatial reference to match my tiled map service. http://help.arcgis.com/en/webapi/silverlight/help/index.html#//01660000001v000000
... View more
11-26-2013
10:23 AM
|
0
|
0
|
221
|
POST
|
Hi, I am attempting to draw points on a map using the lat/long values I am getting from a table. My problem is that my basemap and other data is in X/Y (Missouri State Plane) and when I try to do a mashup with a tiled service my graphics aren't where they are supposed to be. I am having trouble understanding how to use a geometry service to convert the spatial reference. Any help would be greatly appreciated. Below is my code so far: xaml: <UserControl x:Class="TruckGPS_Test.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400" xmlns:esri="http://schemas.esri.com/arcgis/client/2009" xmlns:esriSymbols="clr-namespace:ESRI.ArcGIS.Client.Symbols;assembly=ESRI.ArcGIS.Client"> <Grid x:Name="LayoutRoot" Background="White"> <Grid.Resources> <esri:SimpleMarkerSymbol x:Key="RedMarkerSymbol" Color="Red" Size="12" Style="Circle" /> <esri:SimpleMarkerSymbol x:Key="YellowMarkerSymbol" Color="Yellow" Size="25" Style="Circle" /> <esriSymbols:PictureMarkerSymbol x:Name="TRUCK" Source="images/bucket-truck-box.png" /> </Grid.Resources> <esri:Map x:Name="MyMap" WrapAround="True" Margin="0,0,-325,-506" MouseMove="MyMap_MouseMove"> <!--<esri:ArcGISTiledMapServiceLayer ID="MyLayer" Url="http://gisaprd/ArcGIS/rest/services/BaseMap_ArcReader_Cached/MapServer" />--> <!--<esri:ArcGISTiledMapServiceLayer ID="MyLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />--> <esri:ArcGISTiledMapServiceLayer ID="Aerials" Url="http://gisaprd/ArcGIS/rest/services/AerialCoordinateTest/MapServer" Visible="False" /> <esri:ArcGISDynamicMapServiceLayer Url="http://gisaprd/ArcGIS/rest/services/BaseMapCool__WebViewer/MapServer" /> <esri:ArcGISDynamicMapServiceLayer ID="Landbase" Url="http://gisaprd/ArcGIS/rest/services/SRSLandbase/MapServer" /> <esri:ArcGISDynamicMapServiceLayer ID="Show All Feeders" Url="http://gisaprd/ArcGIS/rest/services/SRSShowAllFeeders/MapServer" Visible="False" /> <esri:ArcGISDynamicMapServiceLayer ID="Electric Data" Url="http://gisaprd/ArcGIS/rest/services/SRSElectricData/MapServer"/> <esri:ArcGISDynamicMapServiceLayer ID="Feeders Outages" Url="http://gisaprd/ArcGIS/rest/services/SRSShowFeedersWOutages/MapServer" DisableClientCaching="True" Opacity=".65" Visible="False"/> <esri:GraphicsLayer ID="TruckGPS" > <esri:GraphicsLayer.MapTip> <Grid Background="#FFD65555" > <Border BorderBrush="#FFFF0000" BorderThickness="1" CornerRadius="5" /> <StackPanel Orientation="Vertical" > <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding [USER_NAME]}" FontWeight="Bold" Foreground="White" HorizontalAlignment="Left"/> </StackPanel> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding [SYSTIME]}" FontWeight="Bold" Foreground="White" HorizontalAlignment="Left"/> </StackPanel> </StackPanel> </Grid> </esri:GraphicsLayer.MapTip> </esri:GraphicsLayer> </esri:Map> <Grid MinWidth="300" HorizontalAlignment="Right" Background="White" VerticalAlignment="Top" Margin="0,15,15,0" > <StackPanel Margin="5"> <TextBlock x:Name="ScreenCoordsTextBlock" HorizontalAlignment="Left" VerticalAlignment="Center" Text="Screen Coords: " TextWrapping="Wrap" /> <TextBlock x:Name="MapCoordsTextBlock" HorizontalAlignment="Left" VerticalAlignment="Center" Text="Map Coords: " TextWrapping="Wrap" /> </StackPanel> </Grid> </Grid> </UserControl> C#: using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using ESRI.ArcGIS.Client; using ESRI.ArcGIS.Client.Geometry; using ESRI.ArcGIS.Client.Symbols; using System.Runtime.Serialization; using ESRI.ArcGIS.Client.Tasks; using System.Windows.Threading; using ESRI.ArcGIS.Client.Bing; namespace TruckGPS_Test { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); //AddMarkerGraphics(); QueryTask queryTaskTruckGPS = new QueryTask("http://gisaprd/ArcGIS/rest/services/TruckGPS/MapServer/8"); queryTaskTruckGPS.ExecuteCompleted += QueryTask_ExecuteCompletedTruckGPS; ESRI.ArcGIS.Client.Tasks.Query queryTruckGPS = new ESRI.ArcGIS.Client.Tasks.Query(); queryTruckGPS.OutFields.Add("*"); queryTruckGPS.ReturnGeometry = false; queryTruckGPS.Where = "1=1"; queryTaskTruckGPS.ExecuteAsync(queryTruckGPS, "initial"); //This timer updates the outage feature count after a 30 second wait System.Windows.Threading.DispatcherTimer myDispatcherTimer = new System.Windows.Threading.DispatcherTimer(); myDispatcherTimer.Interval = new TimeSpan(0, 0, 0, 10, 0); myDispatcherTimer.Tick += new EventHandler(Each_Tick); myDispatcherTimer.Start(); } public void Each_Tick(object o, EventArgs sender) { QueryTask queryTaskTruckGPS = new QueryTask("http://gisaprd/ArcGIS/rest/services/TruckGPS/MapServer/8"); queryTaskTruckGPS.ExecuteCompleted += QueryTask_ExecuteCompletedTruckGPS; ESRI.ArcGIS.Client.Tasks.Query queryTruckGPS = new ESRI.ArcGIS.Client.Tasks.Query(); queryTruckGPS.OutFields.Add("*"); queryTruckGPS.ReturnGeometry = false; queryTruckGPS.Where = "1=1"; queryTaskTruckGPS.ExecuteAsync(queryTruckGPS, "initial"); } private void QueryTask_ExecuteCompletedTruckGPS(object sender, ESRI.ArcGIS.Client.Tasks.QueryEventArgs args) { //If Counter isn't working check the web service, make sure the table is added to the map service FeatureSet featureSet = args.FeatureSet; GraphicsLayer graphicsLayer = MyMap.Layers["TruckGPS"] as GraphicsLayer; graphicsLayer.ClearGraphics(); if (featureSet != null && featureSet.Features.Count > 0) { ////Check the system time and subtract the time amount wanted from the last gps systime read for movement or idle truck //System.DateTime dTime = DateTime.Now; //// tSpan is 0 days, 0 hours, 0 minutes, and 0 seconds. //System.TimeSpan tSpan = new System.TimeSpan(0, 1, 0, 0); //System.DateTime result = dTime - tSpan; foreach (ESRI.ArcGIS.Client.Graphic feature in featureSet.Features) { if ((feature.Attributes["LONGITUDE"] != null) && (feature.Attributes["LATITUDE"] != null) ) //&& (feature.Attributes["S"]) { var Machine_Name = feature.Attributes["MACHINE_NAME"].ToString(); var User_Name = feature.Attributes["USER_NAME"].ToString(); double x = Convert.ToDouble(feature.Attributes["LONGITUDE"]); double y =Convert.ToDouble(feature.Attributes["LATITUDE"]); feature.Geometry = new MapPoint(x, y); //if (User_Name == "CU656") //{ feature.Symbol = LayoutRoot.Resources["TRUCK"] as ESRI.ArcGIS.Client.Symbols.Symbol; graphicsLayer.Graphics.Add(feature); //} //else //{ // feature.Symbol = LayoutRoot.Resources["RedMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol; // graphicsLayer.Graphics.Add(feature); //} } } { (MyMap.Layers["TruckGPS"] as GraphicsLayer).Refresh(); }; } else { graphicsLayer.ClearGraphics(); //MessageBox.Show("No features returned from query"); } } private void MyMap_MouseMove(object sender, System.Windows.Input.MouseEventArgs args) { if (MyMap.Extent != null) { System.Windows.Point screenPoint = args.GetPosition(MyMap); ScreenCoordsTextBlock.Text = string.Format("Screen Coords: X = {0}, Y = {1}", screenPoint.X, screenPoint.Y); ESRI.ArcGIS.Client.Geometry.MapPoint mapPoint = MyMap.ScreenToMap(screenPoint); if (MyMap.WrapAroundIsActive) mapPoint = ESRI.ArcGIS.Client.Geometry.Geometry.NormalizeCentralMeridian(mapPoint) as ESRI.ArcGIS.Client.Geometry.MapPoint; MapCoordsTextBlock.Text = string.Format("Map Coords: X = {0}, Y = {1}", Math.Round(mapPoint.X, 4), Math.Round(mapPoint.Y, 4)); } } } }
... View more
11-26-2013
10:19 AM
|
0
|
1
|
2918
|
POST
|
To answer my question and help others in the future.........I had my networking security group add my url string to the reverse proxy. After that I could change my url string to what was needed to hit my service from outside the intranet. Ex: http://gisadev/arcgis/rest/services/.../FeatureServer http://gisadev.cityutil.com/arcgis/r.../FeatureServer changed to a (https://) url outside the firewall https://myserver_namehere/arcgis/rest/services/my_feature_Service_name_here/FeatureServer
... View more
11-01-2013
10:27 AM
|
0
|
0
|
236
|
POST
|
Hi, I am trying to setup a collector app for a proof of concept. I have created a point feature service that I can successfully edit through the ArcGIS online map interface. When I try to view my map in ArcGIS online explorer or collector the point layer doesn't display. I can access my service with both types of url: http://gisadev/arcgis/rest/services/GasSteelRiserTest/FeatureServer http://gisadev.cityutil.com/arcgis/rest/services/GasSteelRiserTest/FeatureServer At this point my only guess is that my service isn't properly exposed to external users. Is this correct? What is my next step (reverse proxy?)? Thanks for any help, Brandon
... View more
11-01-2013
07:36 AM
|
0
|
1
|
2288
|
POST
|
By default the legend tree nodes are expanded. You can change this behavior either by restyling the legend control, or, likely easier, by code on the event Legend.Refreshed: private void Legend_Refreshed(object sender, Legend.RefreshedEventArgs e)
{
// Collapse all map layers in the legend.
e.LayerItem.IsExpanded = false;
// Collapse all sublayers
if (e.LayerItem.LayerItems != null)
foreach (var sublayerItem in e.LayerItem.LayerItems)
sublayerItem.IsExpanded = false;
} This worked for me when I wanted to collapse all layers and sublayers: private void Legend_Refreshed(object sender, ESRI.ArcGIS.Client.Toolkit.Legend.RefreshedEventArgs e) { // The purpose of the code in this function is to cause all of the leaves in the Legend to be collapsed // to the highest level (i.e. the Layer level) when the application starts up. It is by setting the // LayerItemViewModel.IsExpandable = False for each Layer/sub-Layer that allows this behavior to occur. // Had this code-behind logic not been used all of the leaves would have been expanded to their lowest level // in the Legend Control (this is the default behavior). // Get the Legend. ESRI.ArcGIS.Client.Toolkit.Legend theLegend = (ESRI.ArcGIS.Client.Toolkit.Legend)sender; // Get the LayerItems of the Legend Control. System.Collections.ObjectModel.ObservableCollection<ESRI.ArcGIS.Client.Toolkit.Primitives.LayerItemViewModel> theObservableCollection = theLegend.LayerItems; // Loop through the ObservableCollection<LayerItemViewModel> objects for each Layer. foreach (ESRI.ArcGIS.Client.Toolkit.Primitives.LayerItemViewModel theLayerItemViewModel in theObservableCollection) { // Close the leaves in the Legend Control for the Layers theLayerItemViewModel.IsExpanded = false; } //close the leaves in the Legend Control for the sub layers if (e.LayerItem.LayerItems != null) foreach (var sublayerItem in e.LayerItem.LayerItems) sublayerItem.IsExpanded = false; }
... View more
09-10-2013
07:55 AM
|
0
|
0
|
228
|
POST
|
You can use the OrderByFields property. Documentation here : http://resources.arcgis.com/en/help/silverlight-api/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.Query~OrderByFields.html Thanks for the reply dbroux. I ended up using the same method as mentioned in this thread: http://forums.arcgis.com/threads/30014-Query-task-on-SDE-layer [INDENT] var sortedList = featureSet.Features.OrderBy(f => (string) f.Attributes["STATE_NAME"]).ToList(); foreach(var graphic in sortedList) { System.Diagnostics.Debug.WriteLine(graphic.Attributes["STATE_NAME"]); }[/INDENT]
... View more
03-28-2013
05:16 AM
|
0
|
0
|
151
|
POST
|
Hi, I am trying to reproduce the attribute query example found here: http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/samples/start.htm#AttributeQuery I would like to sort the query results. Is there an easy way to do this? I tried this: InitializeComponent(); QueryTask queryTask = new QueryTask("http://gisadev/ArcGIS/rest/services/CUProperties_Query/MapServer/0"); queryTask.ExecuteCompleted += QueryTask_ExecuteCompleted; queryTask.Failed += QueryTask_Failed; ESRI.ArcGIS.Client.Tasks.Query query = new ESRI.ArcGIS.Client.Tasks.Query(); // Specify fields to return from initial query query.OutFields.AddRange(new string[] { "NAME" }); query.OutFields.Sort(); // This query will just populate the drop-down, so no need to return geometry query.ReturnGeometry = false; // Return all features query.Where = "1=1"; queryTask.ExecuteAsync(query, "initial"); } I think this is only sorting the first field which is object ID. Any suggestions would be appreciated.
... View more
03-27-2013
07:00 AM
|
0
|
2
|
688
|
POST
|
Doh. Good eyes, thank you so much. Thanks to nmanocha also!
... View more
04-06-2011
10:26 AM
|
0
|
0
|
303
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|