|
POST
|
In your previous post, you mentioned you wanted to modify the following sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Identify. IdentifyComboBox exists in this sample. The relevant code for ShowFeatures() is in the code-behind. From my understanding, you want to add InfoWindow that contains what the IdentifyComboBox contain (layer name) and base on this selection, you want to display information on the Grid. If I understood you correctly, I think what you need to do then is first modify the Identify sample and then use InfoWindow sample as guideline on how to update its template and use in your application. Basically, learn both samples, tweak for your need and merge 🙂
... View more
02-16-2011
09:37 AM
|
0
|
0
|
2054
|
|
POST
|
You have to choose one or the other as noted in this help doc: http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.GraphicsLayer~Renderer.html. You can, however try to clone the existing renderer as defined by the service and modify the symbol base on your preference. Your custom symbol will then have VisualStates for MouseOver or Selected.
void l_Initialized(object sender, EventArgs e)
{
FeatureLayer l = sender as FeatureLayer;
if (l.Renderer is UniqueValueRenderer)
{
var current = l.Renderer as UniqueValueRenderer;
var renderer = new UniqueValueRenderer() { Attribute = current.Attribute };
foreach (var info in current.Infos)
{
var newInfo = new UniqueValueInfo()
{
Description = info.Description,
Label = info.Label,
Value = info.Value,
//TODO: clone existing symbol or overwrite with new symbol
Symbol = this.LayoutRoot.Resources["MyCustomSymbol"] };
renderer.Infos.Add(newInfo);
}
l.Renderer = renderer;
}
}
This sample shows how to create custom symbols: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#CustomSymbols
... View more
02-16-2011
09:29 AM
|
0
|
0
|
479
|
|
POST
|
UniqueValueRenderer only checks against one attribute. If you need to check against multiple attribute, you need to write your own renderer. Implementation should be similar to that of UniqueValueRenderer but in your GetSymbol() you will be checking for more attributes.
... View more
02-16-2011
09:14 AM
|
0
|
0
|
1452
|
|
POST
|
Your Where clause would be something like fcode in (10201, 11201) where fcode is field name and 10201 and 11201 are elements of your number array. You can use the following conversion from array to comma-delimited string.
int[] numbers = new int[] { 10201, 11201 };
string where = string.Format("fcode in ({0})", string.Join(",", Array.ConvertAll(numbers, i => i.ToString())));
... View more
02-16-2011
09:12 AM
|
0
|
0
|
830
|
|
POST
|
Yup that is weird. I have never seen Fiddler interfere with my apps except when I worked with Windows Phone 7 Beta before. But you are using WPF and no issue with Fiddler comes to mind.
... View more
02-16-2011
08:25 AM
|
0
|
0
|
2275
|
|
POST
|
Before you zip the file can you Clean Solution first? Maybe that will reduce the file size. Are you able to reproduce the issue using this sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#DrawGraphics just by adding SnapToLevels, Minimum and MaximumResolution?
... View more
02-15-2011
02:21 PM
|
0
|
0
|
1378
|
|
POST
|
Sure, you can apply ScaleTransform to your symbol as shown in this sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#CustomSymbols Look for this "Enlarge gradient marker symbol" in XAML. You can use similar code in your Selected state.
... View more
02-15-2011
12:54 PM
|
0
|
0
|
974
|
|
POST
|
Sure. In that sample, you can put IdentifyComboBox in your InfoWindow template. This contains the layers that were underneath the mouse click. Look at where ShowFeatures() is called.
... View more
02-15-2011
12:50 PM
|
0
|
0
|
2054
|
|
POST
|
Copy and paste the code snippet in Post# 6 to a new application. I don't think you copied it correctly. The linq query does not have "Into r()", but "Into r" and the MessageBox.Show() is inside a For Each. I think the range variable name error might be caused by "r()".
... View more
02-15-2011
12:42 PM
|
0
|
0
|
2095
|
|
POST
|
With AutoSave="True" on the FeatureLayer, FeatureDataGrid's Commit button is disabled because it does not require calling SaveEdits(). Any change to the layer are automatically pushed to the server. You need to set this to False if you want to explicitly perform the save with the Commit button. FeatureDataForm Apply button only means you are done editing but it does not commit a save (unless AutoSave is true) unlike FeatureDataGrid's Commit button. With AutoSave="False", you need to explicitly call SaveEdits() on FeatureDataForm's EditEnded. FeatureDataGrid on the other hand, will handle the save when you click "Commit".
... View more
02-15-2011
12:26 PM
|
0
|
0
|
1593
|
|
POST
|
I'm sorry about that. I was testing against the latest source code. I did not know we had a bug fix for this. Unfortunately, it still exists in v2.1 but is fixed for future version of the API. What you can do for now is use a client-side renderer to override the renderer defined by your service.
... View more
02-15-2011
12:21 PM
|
0
|
0
|
1412
|
|
POST
|
Are you able to see the symbol when you view in ArcGIS.com Map? Similar to this: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/MapServer (click View in ArcGIS.com Map). When you query the layer where renderer field = 4 with return geometry set to true, similar to this query: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/MapServer/2/query?text=&geometry=&geometryType=esriGeometryPoint&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&objectIds=&where=ftype+%3D+10701&time=&returnIdsOnly=false&returnGeometry=true&maxAllowableOffset=&outSR=&outFields=&f=html do you get valid geometry (not empty)? We tried to replicate this by using the same symbol on the feature service and we could not reproduce it. Do other features show in your map? If not, maybe the map's SpatialReference does not match the layer's SpatialReference? Does your renderer have a default symbol? Maybe value="4" is not matched, it should use the default symbol if there's any.
... View more
02-15-2011
09:28 AM
|
0
|
0
|
1412
|
|
POST
|
Sure. I just added it as attachment to this post in case other dev will need to do something similar. Kindly see attached WPF project.
... View more
02-15-2011
09:10 AM
|
0
|
0
|
1979
|
|
POST
|
Are you using FeatureDataGrid? If yes, do you have GraphicsLayer property bound to a FeatureLayer from feature service? Is this FeatureLayer set to AutoSave=False? Sorry, I have more questions than answers. Basically, FDG decides to enable Commit based on these settings. If FeatureLayer is read-only (using map service) or if AutoSave is true (by default it is true), then Commit will be disabled.
... View more
02-15-2011
09:06 AM
|
0
|
0
|
1593
|
|
POST
|
Does the attribute "Officer" exist in your query OutFields? Can it be type casted to string? The C# code I was using was: (string) g.Attributes["Officer"] I'm not sure if I wrote the correct VB syntax. My previous post is meant for demonstration purposes only. You are free to use, tweak or not use it. I don't know how else I could help. You know your data more, you just need to learn how to use Linq. Start small, do short and simpler samples with different attributes and types. Once you got your code working, tweak it for your query.
... View more
02-15-2011
08:59 AM
|
0
|
0
|
2095
|
| 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
|