|
POST
|
Ah okay. I was not able to run the project directly. I had to copy VB code and translate to C#. At any case, Update() is essential when the parameters of the Query changes. Since Where part changed, you need to run the Query again. http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~Update.html
... View more
12-07-2010
11:29 AM
|
0
|
0
|
2284
|
|
POST
|
Yes, it's on our list. The bug is not fixed for v2.1 because we were on code-freeze when we learned about this.
... View more
12-07-2010
10:48 AM
|
0
|
0
|
1397
|
|
POST
|
Have you looked at this sample? http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#WmsLayerSimple Notice that in the xaml, the following xaml namespace definition was added.
xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
which allows for the following code to work:
<esri:WmsLayer .../>
I also tried your code and it works for me. Have you check project references the correct assembly? ESRI.ArcGIS.Client.Toolkit.DataSources.dll?
... View more
12-07-2010
10:37 AM
|
0
|
0
|
1859
|
|
POST
|
I tried your code and came across the following issues: 1 - Button1_Click is never going to be hit unless you add Click="Button1_Click" in xaml 2 - SelectionLayer_UpdateCompleted is never going to be hit unless you make the following changes 3 - Since Where property is modified, Update() on the layer needs to be invoked again (Not sure how correct VB conversion is but hopefully you get the idea).
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs)
Dim SelectionLayer As FeatureLayer = CType(Me.MyMap.Layers("CensusDemographics"),FeatureLayer)
SelectionLayer.Mode = ESRI.ArcGIS.Client.FeatureLayer.QueryMode.Snapshot
SelectionLayer.Where = "POP2000 < 100"
SelectionLayer.UpdateCompleted = (SelectionLayer.UpdateCompleted + SelectionLayer_UpdateCompleted)
SelectionLayer.Update
End Sub
Private Sub SelectionLayer_UpdateCompleted(ByVal sender As Object, ByVal e As System.EventArgs)
SelectionLayer = CType(sender,ESRI.ArcGIS.Client.FeatureLayer)
SelectionLayer.UpdateCompleted = (SelectionLayer.UpdateCompleted - SelectionLayer_UpdateCompleted)
SelectionLayer.Mode = ESRI.ArcGIS.Client.FeatureLayer.QueryMode.SelectionOnly
SelectionLayer.Where = "1=1"
SelectionLayer.Update
End Sub
Notice that if you check value for SelectionLayer before code for Button1_Click is executed, it is null. Map layers are accessible by their ID not by their Name. Which is probably why you felt you needed to type cast the sender to FeatureLayer in the UpdateCompleted event handler. Also, I'm not sure why you would want to switch the mode of FeatureLayer at run-time. Using the layer for dual purpose does not sound like a good approach(just my opinion).
... View more
12-07-2010
09:31 AM
|
0
|
0
|
2284
|
|
POST
|
Oh okay, then that caused the Invalid URL. The problem then is how the Network Analysis service is setup and published, not the query formed by the web API. Please try to visit the following help doc: http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//009300000055000000.htm If you have further question about this, you might get answers from the ArcGIS Server forum.
... View more
12-07-2010
09:00 AM
|
0
|
0
|
575
|
|
POST
|
You can probably do this on FeatureDataGrid's SelectionChanged event? Provided you know the ObjectID Field. You can do this on the first
private void FeatureDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
var graphics = (sender as ESRI.ArcGIS.Client.Toolkit.FeatureDataGrid).SelectedGraphics;
foreach(var g in graphics)
{
// get id
var id = g.Attributes["objectIdField"];
// TODO: retrieve outside data for this id
break;
}
}
... View more
12-07-2010
08:53 AM
|
0
|
0
|
2192
|
|
POST
|
What I mean to say is go to the Network Analyst service directly such as http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Closest%20Facility/solveClosestFacility and enter each input separate as displayed on Fiddler's Inspectors WebForms (see the screenshot from previous link). See if you still get the same results as when you did when you copied the web request URL. Maybe the Network Analyst service itself is inaccessible or the web request is not correctly formed. It's easier to identify the problem when you do one step at a time.
... View more
12-07-2010
08:30 AM
|
0
|
0
|
3355
|
|
POST
|
The REST API accepts the following parameters http://help.arcgis.com/en/arcgisserver/10.0/apis/rest/query.html therefore "select distinct" is not possible. You would have to do this through maybe a LINQ query once you have the results back. You can do something like the following in the Query_ExecuteCompleted event handler: var graphics = (from g in e.FeatureSet.Features select g).Distinct(); CODE]
... View more
12-07-2010
08:19 AM
|
0
|
0
|
650
|
|
POST
|
Have you tried making the web request from your web browser directly? This URL exists? http://sourani-pc/ArcGIS/rest/services/LAND/NetworkDS/NAServer/Closest%20Facility/solveClosestFacility Try to put the input parameters here as you see them from Fiddler when your app makes the request. Kindly look at Post#14 from this thread for reference http://forums.arcgis.com/threads/14730-Area-And-Perimeter
... View more
12-07-2010
08:12 AM
|
0
|
0
|
3355
|
|
POST
|
Are you using Silveright, WPF or WP7? This should work for Silverlight:
GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
GeneralTransform generalTransform = MyMap.TransformToVisual(Application.Current.RootVisual);
System.Windows.Point transformScreenPnt = generalTransform.Transform(e.GetPosition(this.MyMap));
var graphics = graphicsLayer.FindGraphicsInHostCoordinates(transformScreenPnt);
The following examples demonstrate the use of FindGraphicsInHostCoordinates: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#InfoWindowSimple http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Offset http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Reshape http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Union
... View more
12-07-2010
07:51 AM
|
0
|
0
|
1113
|
|
POST
|
You have downloaded from this page? http://resources.arcgis.com/content/arcgis-windowsphone-api-how-to-download It should work. We have SDK and sample WP7 projects built using this API.
... View more
12-07-2010
07:38 AM
|
0
|
0
|
762
|
|
POST
|
This is one of the bug fixes in v2.1. Please use the newer version.
... View more
12-06-2010
03:17 PM
|
0
|
0
|
560
|
|
POST
|
FeatureDataGrid works with a single layer on your map service or feature service. For example: http://serverapps.esri.com/ArcGIS/rest/services/California/MapServer/8 instead of http://serverapps.esri.com/ArcGIS/rest/services/California/MapServer. You can see that each layer have different fields/attributes. This may be related to what you are trying to accomplish: http://forums.arcgis.com/threads/8309-How-to-perform-spatial-query-between-two-services... Since the attributes/fields will be unknown until user selects a layer, you can use GraphicsLayer for your FeatureDataGrid. Perform a QueryTask on selected service. And store the results to this GraphicsLayer. This also means you need to create your columns in code or have different DataTemplate resource per layer and set the column template in code-behind or allow AutoGenerateColumns.
... View more
12-06-2010
12:06 PM
|
0
|
0
|
2091
|
|
POST
|
Oh no worries, these are good questions. Both 'type' and 'description' are assumed to be fields in your feature service, which we have also been referring to as attributes of your graphics. The code you posted must then be meant for a specific feature service? If yes, you need to replace them with the actual fields of your service. You can visit the FeatureLayer URL directly from your web browser to see more information about the layer.
... View more
12-06-2010
11:22 AM
|
0
|
0
|
2091
|
|
POST
|
Ah okay I see what you're doing now. In this case, you do not need LocationToAddressAsync nor AddressToLocationAsync. Using this sample http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#RoutingDirections, I commented out code for initializing locator and subscribing to its events. Instead, I subscribed to MouseClick.
if (_stops.Count < 2)
_stops.Add(new Graphic(){Geometry = e.MapPoint});
if(_stops.Count == 2)
_routeTask.SolveAsync(_routeParams);
Since you already have the lat/lon values, you do not need to get MapPoints from an event such as MouseClick, you can simply do: _stops.Add(new Graphic(){Geometry = new MapPoint(lat, lon}); // for both start and end location. That should be all you need to do.
... View more
12-06-2010
11:15 AM
|
0
|
0
|
1127
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 weeks ago | |
| 1 | 09-11-2025 01:30 PM | |
| 1 | 06-06-2025 10:14 AM | |
| 1 | 03-17-2025 09:47 AM | |
| 1 | 07-24-2024 07:32 AM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|