POST
|
In the example, the datacontext of each item is the layer itself (it's why we can display the name, change the opacity....). So if you add a 'Delete' button, you have to write a code like: private void ButtonDelete_Click(object sender, System.Windows.RoutedEventArgs e)
{
FrameworkElement element = sender as FrameworkElement;
this.MyMap.Layers.Remove(element.DataContext as Layer);
} The layer will be removed from the map and the button/checkbox/slider will be removed automatically as well (thanks to the SL/WPF binding). Concerning your question about the layer removal through XAML, I don't think you can do that out of the box.
... View more
05-18-2010
09:41 AM
|
0
|
0
|
763
|
POST
|
Something simple like: double ratio = 200/200.5;
p2.X = p1.X + ratio * (p2.X-p1.X);
p2.Y = p1.Y + ratio * (p2.Y-p1.Y);
or do you need to deal with geodesic precision?
... View more
05-18-2010
05:18 AM
|
0
|
0
|
99
|
POST
|
In this case, you can no more take advantage of the existing collection 'QueryTask.LastResults.Features'. You have to manage yourself a collection of graphics. When you get the result of a query, depending on your need, you can append/replace/combine/clear the collection.
... View more
05-18-2010
05:09 AM
|
0
|
0
|
171
|
POST
|
As your control is not visible, it's not loaded. You might try by making it visible and by collapsing it when loaded. Example in XAML: <i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<ei:ChangePropertyAction PropertyName="Visibility">
<ei:ChangePropertyAction.Value>
<Visibility>Collapsed</Visibility>
</ei:ChangePropertyAction.Value>
</ei:ChangePropertyAction>
</i:EventTrigger>
</i:Interaction.Triggers>
... View more
05-17-2010
06:58 AM
|
0
|
0
|
258
|
POST
|
Remove the layer from the layer collection associated to the map. Something like: myMap.Layers.Remove(myLayer);
... View more
05-15-2010
02:50 AM
|
0
|
0
|
763
|
POST
|
Which version of API are you working with? I forgot to mention that LayerInfo property was only existing from version 2.0. Links to documentation: LayerInfo property : http://help.arcgis.com/en/webapi/silverlight/apiref/topic316.html FeatureLayerInfo members : http://help.arcgis.com/en/webapi/silverlight/apiref/topic342.html If you are using the version 2.0 and don't get any description for your feature layer, check that your service is giving such information. Example of service giving a description and a copyright : http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/0?f=pjson
... View more
05-14-2010
02:43 AM
|
0
|
0
|
201
|
POST
|
The extension method 'ESRI.ArcGIS.Client.Bing.Transform.GeographicToWebMercator(this ESRI.ArcGIS.Client.Geometry.MapPoint)' should be helpful. /Dominique
... View more
05-13-2010
09:39 AM
|
0
|
0
|
1323
|
POST
|
For a featureLayer, Description and CopyrightText are given by the property layerInfo. A tooltip like: <ToolTipService.ToolTip>
<StackPanel MaxWidth="400">
<TextBlock FontWeight="Bold" Text="{Binding CopyrightText}" TextWrapping="Wrap" />
<TextBlock FontWeight="Bold" Text="{Binding LayerInfo.CopyrightText}" TextWrapping="Wrap" />
<TextBlock Text="{Binding Description}" TextWrapping="Wrap" />
<TextBlock Text="{Binding LayerInfo.Description}" TextWrapping="Wrap" />
</StackPanel>
</ToolTipService.ToolTip> should work in this case. /Dominique
... View more
05-13-2010
09:36 AM
|
0
|
0
|
201
|
POST
|
Get the rings of the polygon, each ring is a collection of point. For example, to get the points of the first ring of your polygon, you can use : ESRI.ArcGIS.Client.Geometry.PointCollection points = myPolygon.Rings[0]; /Dominique
... View more
05-13-2010
02:43 AM
|
0
|
0
|
311
|
POST
|
Looks working for me with something like : <Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="10" ></RowDefinition>
<RowDefinition Height="*" ></RowDefinition>
<RowDefinition Height="30" ></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250" />
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="10" />
</Grid.ColumnDefinitions>
<!-- Map Control -->
<esri:Map x:Name="Map" Background="White" Grid.Row="1" Grid.Column="1">
.......
Rows/Columns 0 and 2 have fixed sizes and the map in row 1/Column 1 is using the remaining space. /Dominique
... View more
05-13-2010
02:37 AM
|
0
|
0
|
185
|
POST
|
You are getting the same error than if your feature layer URL was incorrect. Verify what you get if you execute a query on your feature layer URL. With the sample, you get this : http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/0?f=pjson (pjson = format pretty json to be more readable). /Dominique
... View more
05-13-2010
02:32 AM
|
0
|
0
|
533
|
POST
|
You are right, it looks like there is an issue in this case. As a temporarly workaround, you can initialize the extent by code when the map is loaded : <esri:Map x:Name="MyMap" Layers="{Binding Layers, Mode=OneWay}" Loaded="MyMap_Loaded" />
void MyMap_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
MyMap.Extent = (ESRI.ArcGIS.Client.Geometry.Envelope)LayoutRoot.Resources["InitialExtent"];
} /Dominique
... View more
05-07-2010
04:43 AM
|
0
|
0
|
125
|
POST
|
If you have the version 2 of the API, another option you might consider is to create a FeatureLayer which will give you the list of fields after the initialization step. Example: Declare a feature layer in selection only mode in order not to request any data you don't need. <esri:FeatureLayer Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/0"
Mode="SelectionOnly" Initialized="FeatureLayer_Initialized">
Get the fields by handling 'Initialized' event : private void FeatureLayer_Initialized(object sender, EventArgs e)
{
FeatureLayer featureLayer = sender as FeatureLayer;
List<Field> fields = featureLayer.LayerInfo.Fields;
fields.ForEach(field => Debug.WriteLine(String.Format("Field Name = {0}, Alias = {1}, type = {2}", field.Name, field.Alias, field.Type)));
} /Dominique
... View more
05-07-2010
03:24 AM
|
0
|
0
|
802
|
POST
|
You have to edit the template : Open the project in Blend, rightclick the Toolbar and select to edit a copy of the template. Select the stackpanel called 'RootElement'. Change the orientation from Horizontal to Vertical. /Dominique
... View more
05-07-2010
03:18 AM
|
0
|
0
|
243
|
POST
|
From an ArcGISDynamicmapServiceLayer, you can use either 'Identify' which returns the features of the map service near a point (example : http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/samples/start.htm#Identify ) or a Query task which returns the features of a layer (example : http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/samples/start.htm#SpatialQuery). If you are using the version 2.0 of the API, you can also consider using a featureLayer in SelectionOnly mode (Example : http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerSelection). Hope this help. /Dominique
... View more
05-07-2010
03:13 AM
|
0
|
0
|
533
|
Title | Kudos | Posted |
---|---|---|
1 | 06-13-2013 09:22 AM | |
1 | 04-29-2022 02:21 AM | |
1 | 04-29-2022 02:28 AM | |
1 | 09-07-2021 03:12 AM | |
1 | 08-23-2021 03:47 AM |
Online Status |
Offline
|
Date Last Visited |
07-28-2022
12:26 PM
|