|
POST
|
Unfortunately these Envelope properties (XMin, YMin, XMax, YMax) are not dependency properties that's why you cannot bind to them. Jennifer
... View more
07-29-2010
08:15 PM
|
0
|
0
|
460
|
|
POST
|
You would usually use MouseLeftButtonDown event to do this, get the screen point and translate them to the actual map coordinates. System.Windows.Point screenPoint = args.GetPosition(MyMap); ESRI.ArcGIS.Client.Geometry.MapPoint mapPoint = MyMap.ScreenToMap(screenPoint); You can refer to this blog for Binding EventArgs to a Command http://silverlight-essentials.com/blog/ Jennifer
... View more
07-29-2010
08:03 PM
|
0
|
0
|
389
|
|
POST
|
After you've added the graphics to the layer in the DrawComplete event handler, you can disable the draw object explicitly setting its IsEnabled property to false or flipping its value like and setting DrawMode property to None if it is not already None. myDrawObject.IsEnabled = !myDrawObject.IsEnabled; if (myDrawObject.DrawMode != DrawMode.None) myDrawObject = DrawMode.None; Jennifer
... View more
07-28-2010
08:04 PM
|
0
|
0
|
428
|
|
POST
|
You need to call this after all layers have been added, that's the tricky part since you add the layers asynchronously and there's no guarantee that all layers will be added if credentials should fail, right? To test that you can change the order of the map layers in code, you can add them in a button click event. Once you know all layers were added, click the button and see that the order of layers have been modified. Jennifer
... View more
07-23-2010
08:18 PM
|
0
|
0
|
1228
|
|
POST
|
If I understood your question correctly, you want to be able to add to/remove from selection without clicking on any button and only using your keyboard and mouse. If that is the case, you can listen to KeyDown and pass the proper command parameter on the editor's Select command based on the pressed key.
public MainPage()
{
InitializeComponent();
this.KeyDown += new KeyEventHandler(MainPage_KeyDown);
editor = this.LayoutRoot.Resources["MyEditor"] as Editor;
}
Editor editor;
void MainPage_KeyDown(object sender, KeyEventArgs e)
{
if (editor == null) return;
if (e.Key == Key.Ctrl)
editor.Select.Execute("Add");
else if (e.Key == Key.Shift)
editor.Select.Execute("Remove");
else if (e.Key == Key.Escape)
editor.CancelActive.Execute(null);
}
Jennifer
... View more
07-23-2010
11:06 AM
|
0
|
0
|
357
|
|
POST
|
This feature is not currently supported in ArcGIS Silverlight/WPF API v2. Jennifer
... View more
07-23-2010
10:16 AM
|
0
|
0
|
1193
|
|
POST
|
Since you are adding the layers to the map based on an asynchronous event (DownloadStringCompleted), you cannot expect the order of the layers to be always the same. If you really have to modify the order of the layers in your map, once all layers have been added to your map you can modify the existing layer collection by doing the following:
Layer Aerials2005 = this.MyMap.Layers["Aerials2005"];
Layer Buildings = this.MyMap.Layers["Buildings"];
Layer Parcels = this.MyMap.Layers["Parcels"];
LayerCollection lc = this.MyMap.Layers;
lc.Clear();
if (Aerials2005 != null)
lc.Add(Aerials2005);
if (Buildings != null)
lc.Add(Buildings);
if (Parcels != null)
lc.Add(Parcels);
Jennifer
... View more
07-23-2010
10:11 AM
|
0
|
0
|
1228
|
|
POST
|
I tried this sample in both WPF and SL application. I placed debug break points to the EndSaveEdits and SaveEditsFailed too. It would help to familiarize yourself with the feature layer first, it's field names and expected values. http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/LandusePlanning/FeatureServer/2 XAML-code:
<UserControl.Resources>
<esri:SimpleFillSymbol x:Key="MyYellowFillSymbol"
Fill="YellowGreen"
BorderBrush="Transparent"
BorderThickness="2" />
<esri:SimpleFillSymbol x:Key="MyRedFillSymbol"
Fill="Red"
BorderBrush="Transparent"
BorderThickness="2" />
<esri:UniqueValueRenderer x:Key="MyUniqueValueRenderer"
Attribute="symbolname">
<esri:UniqueValueRenderer.Infos>
<esri:UniqueValueInfo Value="Residential - Very Low Density"
Symbol="{StaticResource MyRedFillSymbol}" />
<esri:UniqueValueInfo Value="Residential - Low Density"
Symbol="{StaticResource MyYellowFillSymbol}" />
</esri:UniqueValueRenderer.Infos>
</esri:UniqueValueRenderer>
</UserControl.Resources>
<Grid x:Name="LayoutRoot" Background="White">
<esri:Map x:Name="MyMap">
<esri:ArcGISTiledMapServiceLayer Url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
<esri:FeatureLayer ID="towers"
Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/LandusePlanning/FeatureServer/2"
Where="1=1"
Renderer="{StaticResource MyUniqueValueRenderer}"
EndSaveEdits="FeatureLayer_EndSaveEdits"
SaveEditsFailed="FeatureLayer_SaveEditsFailed"
MouseLeftButtonDown="FeatureLayer_MouseLeftButtonDown">
<esri:FeatureLayer.OutFields>
<sys:String>symbolname</sys:String>
</esri:FeatureLayer.OutFields>
</esri:FeatureLayer>
</esri:Map>
</Grid>
Code-Behind: private void FeatureLayer_MouseLeftButtonDown(object sender, ESRI.ArcGIS.Client.GraphicMouseButtonEventArgs e)
{
Graphic g = e.Graphic;
string currentValue = (string) g.Attributes["symbolname"];
if(currentValue.Contains("Very"))
g.Attributes["symbolname"] = "Residential - Low Density";
else
g.Attributes["symbolname"] = "Residential - Very Low Density";
}
private void FeatureLayer_EndSaveEdits(object sender, ESRI.ArcGIS.Client.Tasks.EndEditEventArgs e)
{
}
private void FeatureLayer_SaveEditsFailed(object sender, ESRI.ArcGIS.Client.Tasks.TaskFailedEventArgs e)
{
}
Jennifer
... View more
07-23-2010
09:14 AM
|
0
|
0
|
1038
|
|
POST
|
You can use a GraphicsLayer since these points will only be used to display on the map. And then maybe apply a SimpleRenderer to your GraphicsLayer so that each point uses the same marker symbol. In code-behind, you can add the graphics with a MapPoint geometry based on the lat/lon values retrieved from your table. Jennifer
... View more
07-23-2010
09:00 AM
|
0
|
0
|
294
|
|
POST
|
With ArcGIS Silverlight/WPF API v2.0, you can use QueryTask (similar to the JavaScript sample as Dominique cited below). QueryTask qt = new QueryTask(featureLayer.Url); qt.DisableClientCaching = true; RelationshipParameter rp = new RelationshipParameter(); rp.ObjectIds = new int[] { objectId }; //object id from featureLayer rp.OutFields = new string[] { "agree_with_incident" }; //fields from related table rp.RelationshipId = relationshipId; //can be retrieved from featureLayer's LayerInfo.Relationships qt.ExecuteRelationshipQueryCompleted += qt_ExecuteRelationshipQueryCompleted; qt.ExecuteRelationshipQueryAsync(rp); Jennifer
... View more
07-23-2010
08:30 AM
|
0
|
0
|
565
|
|
POST
|
Sure, in the same MouseLeftButtonDown event handler, you can do the following: GraphicsLayer l = sender as GraphicsLayer; IEnumerable<Graphic> graphics = l.FindGraphicsInHostCoordinates(e.GetPosition(null)); This gives you an enumerable of graphics contained in that cluster. Jennifer
... View more
07-23-2010
08:05 AM
|
0
|
0
|
626
|
|
POST
|
Looking at your code, you are trying to add graphics to a MapServer layer. This is read-only and any edits to it will not be applied, even if you refresh your dynamic layer. Jennifer
... View more
07-23-2010
07:50 AM
|
0
|
0
|
626
|
|
POST
|
If you add a MouseLeftButtonDown event on the GraphicsLayer with clusterer, e.Graphic is your node that represents the cluster and you can view its attributes (Count, Size, Color). Jennifer
... View more
07-22-2010
09:20 AM
|
0
|
0
|
626
|
|
POST
|
The idea for using "Keyboard" as CommandParameter is to allow user to use a single button for Add to/Remove from selection using hot keys to distinguish the selection mode (Ctrl for Add, Shift for Remove). But if you do not want to use keyboard, you can simply do two buttons: <Button x:Name="AddSelectButton" Content="Add" Command="{Binding Select}" CommandParameter="Add"/> <Button x:Name="RemoveSelectButton" Content="Remove" Command="{Binding Select}" CommandParameter="Remove"/> Jennifer
... View more
07-22-2010
09:09 AM
|
0
|
0
|
357
|
|
POST
|
Hi Xaria, I tried to replicate the issue using your code with minor tweaks. Changes to FeatureLayer: Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/LandusePlanning/FeatureServer/2" OutFields="symbolname." Changes to UniqueValueRenderer: Attribute="symbolname" Changed Value property of each UniqueValueInfo to code values the FeatureServer expects (see FeatureLayer's Url) <esri:UniqueValueInfo Value="Residential - Very Low Density" Symbol="{StaticResource MyRedFillSymbol}" /> <esri:UniqueValueInfo Value="Residential - Low Density" Symbol="{StaticResource MyYellowFillSymbol}" /> </esri:UniqueValueRenderer.Infos> In the code-behind (FeatureLayer_MouseLeftButtonDown) Graphic g = e.Graphic; g.Attributes["symbolname"] = "Residential - Very Low Density"; As soon as the symbolname attribute is changed, I see the graphic's fill color change from Yellow to Red if I clicked on a graphic that had Yellow/"Residential - Low Density". The only difference from your code is that you were using Url="http://MyMapURL/MapServer/0 (A MapServer). I also tried using MapServer and the fill color would still change dynamically after changing the attribute, but ofcourse on page refresh or application restart, the graphic changes back to its original color because the FeatureLayer is read-only. Do you not see the color change at all? It seems there's no problem with your code. The Attribute property of the UniqueValueRenderer must match a field in the FeatureServer and the Value property of each UniqueValueRender.Info must be a type/value that field accepts. You can also listen to EndSaveEdits and SaveEditsFailed to see if a graphic is updated. Jennifer
... View more
07-22-2010
08:37 AM
|
0
|
0
|
1038
|
| Title | Kudos | Posted |
|---|---|---|
| 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 | |
| 1 | 04-05-2024 06:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-03-2025
08:39 PM
|