|
POST
|
I'm not saying this is the only way but your question was how to use CollectionViewSource so I gave you the links from MSDN. 🙂 You can also sort the results using Linq and use the sorted results as ListBox ItemsSource.
... View more
02-08-2011
10:28 AM
|
0
|
0
|
2592
|
|
POST
|
I mean, if you copy-paste the service URL to Internet Explorer/FireFox/Google Chrome, do you see anything on this web page? The reason I ask is to narrow-down the cause of blank page by not using SL app and simply viewing information on the layer through your web browser. Please try to use Fiddler when you do this too.
... View more
02-08-2011
08:41 AM
|
0
|
0
|
1567
|
|
POST
|
Anything you can do in XAML, you can do in code-behind. This is close however I am curious with this line: FeatureLayer tempWellFL = new FeatureLayer(); tempWellFL.Url = "gis.asdf.com/ArcGIS/rest/services/aaa/MapServer/0"; this. mainPage.MyMap.Layers.Add(tempWellFL); //tempWellFL.Update(); If MyMap is the name of your map, you can do MyMap.Layers.Add(tempWellFL). Maybe mainPage is null? Also, you don't want to call Update() when there are no changes to the query and the layer has not been initialized.
... View more
02-08-2011
08:36 AM
|
0
|
0
|
1496
|
|
POST
|
So did that work for you? Do your features get a symbol now?
... View more
02-08-2011
08:26 AM
|
0
|
0
|
2223
|
|
POST
|
I'm not sure how you could construct a Binding statement directly, you might need to write a converter for this. Label comes from the UniqueValueRenderer http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.UniqueValueInfo_members.html. Renderer from the GraphicsLayer can be of any Renderer type that implements IRenderer. http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.GraphicsLayer~Renderer.html You can try this code after the layer is Initialized and see that you can retrieve this value.
GraphicsLayer MyGraphicsLayer = sender as GraphicsLayer;
if (MyGraphicsLayer.Renderer is UniqueValueRenderer)
{
UniqueValueRenderer renderer = MyGraphicsLayer.Renderer as UniqueValueRenderer;
string label = renderer.DefaultLabel;
foreach (var info in renderer.Infos)
label = info.Label;
}
You can create a converter that accepts layer and value so that when you can break from the loop when a matching value is found (info.Value == parameterValue).
... View more
02-08-2011
08:22 AM
|
0
|
0
|
432
|
|
POST
|
Yes, DataTemplates are used to specify the visual representation of your data. Question: BUT will I be able to click a link of some sort This will depend if you provided a hyperlink. Question: and will the MapTip close when I MouseLeave Yes, MapTip closes when you leave the graphic or enter another graphic. MapTipHideDelay, just delays closing the maptip. Question: Is there a way to format the MapTip like the Data Template? Or are you stuck with the Rows and Columns GraphicsLayer MapTips can also be a user-defined UserControl so it is customizable like the InfoWindow. You will be able to do something like: MyGraphicsLayer.MapTip = new MyMapTipUserControl(); Toolkit MapTip widget style can be modified too and the approach is similar to this: http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/05/20/Use-control-templates-to-customize-the-look-and-feel-of-ArcGIS-controls.aspx I think the best way to decide is try out the SDK samples and customize them. These are your 3options. http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#InfoWindowSimple http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#GraphicsMapTip http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#MapTipWidget
... View more
02-08-2011
08:07 AM
|
0
|
0
|
1819
|
|
POST
|
In that MSDN sample, they defined their own class Customer and CustomerCollection. They did not show code-behind but it should be a simple class with properties that implements INotifyPropertyChanged and the collection is just an ObservableCollection. I think if you are going to use this approach, you need to create your own model class too with properties that you can sort by. http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged(v=VS.95).aspx http://msdn.microsoft.com/en-us/library/system.windows.datatemplate(v=vs.95).aspx
... View more
02-08-2011
07:49 AM
|
0
|
0
|
2592
|
|
POST
|
You can look at this sample for using CollectionViewSource http://msdn.microsoft.com/en-us/library/system.windows.data.collectionviewsource(v=VS.95).aspx. Notice that the PropertyName matches a property in the object collection. What about using DataGrid or FeatureDataGrid where sorting comes for free. Look at this sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitFeatureDataGrid. FeatureDataGrid also work with GraphicsLayer, your GraphicsLayer can contain the resulting graphics which also include the new attribute buffer distance. Notice in the live sample, that you can click the header of the column and the column is sorted accordingly.
... View more
02-07-2011
02:17 PM
|
0
|
0
|
2592
|
|
POST
|
Here's your code with minor changes. You don't need to create a new instance of FeatureLayer and if you are changing parameters to your FeatureLayer query, you need to call Update() http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLayer~Update.html. Refresh will redraw the current set of graphics. //FeatureLayer GPgl2 = new FeatureLayer(); FeatureLayer GPgl2 = this.mainPage.MyMap.Layers["WellPermitsFL"] as FeatureLayer; GPgl2.Where = String.Format("{0}='{1}'", "Type", "Expired"); GPgl2 .Update();
... View more
02-07-2011
01:53 PM
|
0
|
0
|
1496
|
|
POST
|
Have you looked at this sample? http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#InfoWindowSimple You can try to modify the DataTemplate applied to the InfoWindow. If you are using MapTip, you can set MapTipHideDelay as in this sample http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#GraphicsMapTip. See how MapTip is set up for StatesGraphicsLayer, with the delay you are able to mouse hover on the MapTip. Compare this with the other layer's MapTip that immediately closes once you leave the feature.
... View more
02-07-2011
01:35 PM
|
0
|
0
|
1819
|
|
POST
|
The PictureMarkerSymbol created by the service is different from the PictureMarkerSymbol exposed in our API. You can however, parse the Json string to get to the imageData and create a BitmapImage from this Source.
byte[] contentInBytes = Convert.FromBase64String(imageData);
BitmapImage bmi = new BitmapImage();
bmi.SetSource(new MemoryStream(contentInBytes));
For example this service:http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/MapServer/0 If you append "?f=pjson" or "?f=json", you will see that each esriPMS has an imageData.
... View more
02-07-2011
01:26 PM
|
0
|
0
|
597
|
|
POST
|
Does your UniqueValueRenderer define a DefaultSymbol? Do the features get the DefaultSymbol atleast? Maybe the graphic.Attribute value does not match any of the UniqueValueInfo.Value. The values must have the same data type. I tried the following code for this layerhttp://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/MapServer/0 For simplicity, I have only one UniqueValueInfo. Graphics whose ftype attribute do not match my UniqueValueInfo.Value will get the default symbol.
<esri:UniqueValueRenderer x:Key="MyRenderer" Attribute="ftype">
<esri:UniqueValueRenderer.DefaultSymbol>
<esri:SimpleMarkerSymbol Color="Blue" Size="10" Style="Circle"/>
</esri:UniqueValueRenderer.DefaultSymbol>
<esri:UniqueValueInfo >
<esri:UniqueValueInfo.Value>
<sys:Int32>10901</sys:Int32> </esri:UniqueValueInfo.Value>
<esri:UniqueValueInfo.Symbol>
<esri:SimpleMarkerSymbol Color="Yellow" Size="10" Style="Diamond"/>
</esri:UniqueValueInfo.Symbol>
</esri:UniqueValueInfo>
</esri:UniqueValueRenderer>
... View more
02-07-2011
01:06 PM
|
0
|
0
|
2223
|
|
POST
|
If you will be using FeatureLayer, when the layer is Initialized you can retrieve the LayerInfo.Name. I think this is the same name as your FeatureClass. Alternatively, you can parse Json string that looks like this http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0?f=json if you append "?f=json" to your service URL. Look for "name" here.
... View more
02-04-2011
03:24 PM
|
0
|
0
|
695
|
|
POST
|
Yes this bug had been fixed for v2.1 Final. The current SDK sample is run against v2.1 Final (see link below) no longer reproduce this error. To replicate: Use http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsAutoSave Check Continuous Action Click Edit Vertices Click on graphic to begin editing Click Cancel Action Click on any graphic to begin editing again // EditVertices should not be active at this point.
... View more
02-04-2011
03:10 PM
|
0
|
0
|
568
|
|
POST
|
You can use Editor Select command to select features from your GraphicsLayer. You can try out this sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsExplicitSave Notice that the "New Selection" button will allow you to draw an envelope around your region of interest. Or you can use FindGraphicsInHostCoordinates to select your graphics.
GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
GeneralTransform generalTransform = MyMap.TransformToVisual(Application.Current.RootVisual);
System.Windows.Point transformScreenPnt = generalTransform.Transform(e.GetPosition(this.MyMap));
Rect rect = new Rect(transformScreenPnt, new Size(500, 500));
var graphics = graphicsLayer.FindGraphicsInHostCoordinates(rect );
... View more
02-04-2011
03:01 PM
|
0
|
0
|
546
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-10-2026 12:13 PM | |
| 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 |
07-13-2026
09:07 AM
|