|
POST
|
Mark, Sorry for the delay, I've been out of the office. I recall getting this message while developing the code, but cannot recall what was causing it or if I fixed it. The error is because the value of linkID is not in _dataLinks as the key. When I get back to this project, I'll see if I can remember what was causing it and how to correct it.
... View more
07-26-2011
08:34 AM
|
0
|
0
|
1203
|
|
POST
|
I finally had time to go back and try this. Bruce you were correct - only tweak I had to make was to qualify all of the filter tags with the ogc namespace, otherwise it would connect to the dataset but not filter. https://someserver.agency.gov/service_WFS/MapServer/WFSServer?VERSION=1.1.0&FILTER=<ogc:Filter><ogc:PropertyIsEqualTo><ogc:PropertyName>SURVEY_ID</ogc:PropertyName><ogc:Literal>1234</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter> On a side note, I noticed the .fdl files created contain the user name and password as plain text, was hoping at least the password would be encrypted like in a SDE connection file. Thanks again Bruce, Terry
... View more
07-11-2011
11:35 AM
|
0
|
0
|
1133
|
|
POST
|
The API reference documents can be found here - http://help.arcgis.com/en/webapi/silverlight/apiref/api_start.htm
... View more
07-11-2011
07:11 AM
|
0
|
0
|
1194
|
|
POST
|
Hi Mark, When I run the Identify, it's called against several layers in my map, so I pass in the layer index as the token as well; something like this -
//run ID on each service - starting from top so results more likely to match layer order in map
for (int i = _Map.Layers.Count -1; i >= 0; i--)
{
if (!(_Map.Layers is GraphicsLayer) && _Map.Layers.Visible == true)
{
IDTask = new IdentifyTask();
IDTask.ExecuteCompleted += IdentifyTask_ExecuteCompleted;
IDTask.Failed += IdentifyTask_Failed;
IDTask.Url = MapUtils.GetLayerURL(_Map.Layers);
IDTask.ExecuteAsync(idParams, i);
}
}
In your code it looks like you're just running the Identify against one layer in the QueryPoint_Click routine -
IdentifyTask identifyTask = new IdentifyTask("http://mark-laptopgis/ArcGIS/rest/services/Traffic/TMC/MapServer");
identifyTask.ExecuteCompleted += IdentifyTask_ExecuteCompleted;
identifyTask.Failed += IdentifyTask_Failed;
identifyTask.ExecuteAsync(identifyParams);
If you add the layer id for the Traffic/TMC to the ExcecuteAsync call, the token parameter in AddResultstoControl will not be null. Or if you will always be using the same service & layer to query for attachments, you could change the logic in AddResultstoControl -
urlLayer = "http://mark-laptopgis/ArcGIS/rest/services/Traffic/TMC/MapServer/" + result.LayerId;
flyr = new FeatureLayer();
flyr.Url = urlLayer;
... View more
07-11-2011
07:08 AM
|
0
|
0
|
1203
|
|
POST
|
I have a map service w/ 2 layers in it both with a min & max scale set. If I add the service as an ArcGISDynamicMapServiceLayer to a map, these scale dependancies are honored even in the Legend control. If I just want to add one of the layers from that MapService as a FeatureLayer to a map, how would I do it using the values that I can see in the MapService Layer? The Layer class has a minResolution and maxResolution but is that the same as scale? partial code snippet of how I create the FeatureLayer -
//mapservice is a class returned from an EntityQuery that pulls service properties from a database
FLayer = new FeatureLayer();
FLayer.Url = mapservice.ServerURL + "/" + mapservice.MapServiceName;
FLayer.Mode = FeatureLayer.QueryMode.OnDemand;
FLayer.Initialized += FLayer_Initialized;
if (mapservice.Proxy)
{
FLayer.ProxyUrl = "../proxy.ashx";
}
layer = FLayer;
....snip...
layer.InitializationFailed += Layer_InitializationFailed;
layer.ID = mapservice.DisplayName;
layer.Opacity = mapservice.Transparency == 0 ? 100 : 1 - (Convert.ToDouble(mapservice.Transparency) / 100);
layer.Visible = mapservice.Active;
MyMap.Layers.Add(layer);
Do I need to get the min/max scales using something like
WebClient Web = new WebClient();
Web.DownloadStringAsynch(Flayer.url + "?f=pjson");
And grab the scale properties from the json layer description? Thanks, Terry
... View more
07-07-2011
01:56 PM
|
0
|
2
|
2820
|
|
POST
|
it's just an quick function to determine the type of the layer passed in and return the Url property, since there is not Url property on the ESRI.ArcGIS.Client.Layer class.
public static string GetLayerURL(Layer lyr)
{
string strURL = string.Empty;
if (lyr is ArcGISDynamicMapServiceLayer)
{
strURL = (lyr as ArcGISDynamicMapServiceLayer).Url;
}
else if (lyr is ArcGISTiledMapServiceLayer)
{
strURL = (lyr as ArcGISTiledMapServiceLayer).Url;
}
else if (lyr is ArcGISImageServiceLayer)
{
strURL = (lyr as ArcGISImageServiceLayer).Url;
}
else if (lyr is FeatureLayer)
{
strURL = (lyr as FeatureLayer).Url;
}
return strURL;
}
... View more
07-05-2011
01:04 PM
|
0
|
0
|
1203
|
|
POST
|
Mark, Should be easy enough to fix. Looking at the errors you're seeing, here's what you should change - 1. "The name 'MapUtils' does not exist in the current context". MapUtils is a utility class I made and the function GetLayerURL simply returns the URL of a layer in the map. 2. "The name '_Map' does not exist in the current context". _Map is a reference to my map object. Looks like yours is called MyMap, just swap the two. 3. "object' does not contain a definition for 'Add'". _dataLinks is defined in your code a a generic object. In mine it 's a Dictionary<string,List<DataLink>> _dataLinks { get; set; } 4. "Cannot apply indexing with [] to an expression of type 'object' ". redefining _dataLinks as a Dictionary will fix this too. Hope this helps, Terry
... View more
07-05-2011
06:27 AM
|
0
|
0
|
3028
|
|
POST
|
Mark, What kind of errors are you getting and where? Post up some code and xaml along with where you're seeing problems and we can try to figure it out. TG
... View more
07-01-2011
01:15 PM
|
0
|
0
|
3028
|
|
POST
|
Hello, I have access to a WFS service which contains a large number (250,000+) of features. It takes a very long time to load into ArcMap and I'd like to be able to filter in the data for the end users as they will only want to see data specific to their program. In version 10, there are options when creating the WFS connection parameters to a) set the Max # of Features & b) set a Filter in XML using the OGC comparison filters like this -
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:PropertyIsEqualTo matchCase="false">
<ogc:PropertyName>SURVEY_ID</ogc:PropertyName>
<ogc:Literal>1234</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
Is there a way to do this in 9.3.1? There's a small textbox labeled 'filter' when you view the table list, but I've tried using the exact XML that works in v10 but I still get all the features. Is this kind of functionality available in 9.3.1? Most of our users will not be in v10 until this fall. Thank you, Terry
... View more
06-22-2011
06:29 AM
|
0
|
3
|
1504
|
|
POST
|
try something like this above the code which adds Code to the grid
foreach (DataGridColumn col in PEDQueryNewDataGrid.Columns)
{
if (col.Header.ToString().ToLower() == "code")
{
gridUnmapped.Columns.Remove(col);
break;
}
}
... View more
06-10-2011
07:22 AM
|
0
|
0
|
1563
|
|
POST
|
Sorry, last post was not quite clear. For the Binding, it should still be System.Windows.Data.Binding(bindName). The control on to which we're adding the column needs to be of the type System.Windows.Controls.DataGrid....looking at your XAML that would be PEDQueryNewDataGrid. Try this code -
string bindName = "Attributes[S_" + InputPED.Text + "]";
DataGridTextColumn colPED = new DataGridTextColumn();
colPED.Header = "Code";
colPED.CanUserSort = true;
colPED.Width = new DataGridLength(50);
colPED.Binding = new System.Windows.Data.Binding(bindName);
PEDQueryNewDataGrid.Columns.Add(colPED);
... View more
06-10-2011
06:59 AM
|
0
|
0
|
1563
|
|
POST
|
Assuming the layer you're after is of type ArcGISDynamicMapServiceLayer, use the VisibleLayers property to control which sublayers are displayed. It's an array of Int so just add/remove the sublayer index from that.
int[] myVisibleLayers = { 1, 2, 4 }; //sublayers 0 & 3 will not display
myArcGISDynamicMapServiceLayer.VisibleLayers = myVisibleLayers;
... View more
06-10-2011
06:25 AM
|
0
|
0
|
395
|
|
POST
|
The type of the control to add the column to should be a System.Windows.Controls.DataGrid; a System.Windows.Control.Grid is a layout container. In your original post, you have the XAML for the DataGrid.Columns - what is the name of the data grid those belong to? That's the name of the control that colPED should be Added to. Can you post the full XAML of the data grid?
... View more
06-10-2011
06:18 AM
|
0
|
0
|
1563
|
|
POST
|
I could be wrong but I think the binding is interpreted literally in the XAML, so it's looking for an attribute name 'S_ + InputPED.Text' in your underlying data. Maybe in the Loaded event for the datagrid you can do something like this - In the XAML remove the column from the grid in the code behind
string bindName = "Attributes[S_" + InputPED.Text + "]";
DataGridTextColumn colPED = new DataGridTextColumn();
colPED.Header = "Code";
colPED.CanUserSort = true;
colPED.Width = new DataGridLength(50);
colPED.Binding = new Binding(bindName);
// assuming the datagrid is called gridData - replace with the name of your datagrid
gridData.Columns.Add(colPED);
... View more
06-09-2011
09:09 AM
|
0
|
0
|
1563
|
|
POST
|
Look at the Where property of a FeatureLayer. Documentation says 'Any legal SQL where clause operating on the fields in the layer is allowed' so you should be able to do something like
FeatLayer.Where = "POP2000 > 500000 AND POP2000 < 1000000";
What's considered legal SQL statement will depend on the underlying data source. TG
... View more
06-09-2011
08:16 AM
|
0
|
0
|
721
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-23-2017 08:59 AM | |
| 1 | 06-15-2016 03:27 PM | |
| 1 | 01-14-2016 09:55 AM | |
| 2 | 12-14-2012 09:38 AM | |
| 2 | 10-23-2017 01:22 PM |
| Online Status |
Offline
|
| Date Last Visited |
07-17-2024
08:14 PM
|