|
POST
|
Add.CommandParameter is specific to the service you are using as mentioned in this forum post: http://forums.arcgis.com/threads/19100-Silverlight-samples-from-ESRI.
... View more
01-05-2012
06:17 PM
|
0
|
0
|
1523
|
|
POST
|
This blog post might help: http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2009/08/24/Troubleshooting-blank-layers.aspx
... View more
01-05-2012
06:14 PM
|
0
|
0
|
802
|
|
POST
|
In this SDK sample (using FeatureLayer) http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#TimeFeatureLayer
<esri:TimeSlider x:Name="MyTimeSlider"
Height="20" TimeMode="TimeExtent"
MinimumValue="{Binding ElementName=MyMap, Path=Layers[EarthquakesLayer].TimeExtent.Start, Mode=OneWay}"
MaximumValue="{Binding ElementName=MyMap, Path=Layers[EarthquakesLayer].TimeExtent.End, Mode=OneWay}"
Value="{Binding ElementName=MyMap, Path=Layers[EarthquakesLayer].TimeExtent, Mode=OneWay}" >
</esri:TimeSlider>
Since you are using GraphicsLayer, there is no TimeExtent property that you can use. You would have to look at Time Info to know the TimeExtent where there would be data. For example: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/Since_1970/MapServer/0. And then use the static helper methods TimeSlider.CreateTimeStopsByTimeInterval or CreateTimeStopsByCount. In the Time Info, you will also find which field to use (i.e. "Date_"), so you might be able to use Linq query to get the oldest feature and use that as MinimumValue.
... View more
01-05-2012
06:13 PM
|
0
|
0
|
1308
|
|
POST
|
In this SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsAutoSave The following XAML-code for Add button is specific to the service: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/2. (See Types section).
<Button Command="{Binding Add}" Content="Add Polygon" Margin="2"
ToolTipService.ToolTip="Civil Disturbance">
<Button.CommandParameter>
<sys:Int32>10101</sys:Int32>
</Button.CommandParameter>
</Button>
When dealing with FeatureLayer, Add.CommandParameter is expected to be a FeatureType (defined by service). When dealing with GraphicsLayer, Add.CommandParameter is expected to be a symbol (matching geometry).
... View more
01-05-2012
05:34 PM
|
0
|
0
|
2252
|
|
POST
|
Can you run fiddler with your sample app? The service error could mean a number of things. It's possible that the geometry is not topologically correct or there were some missing attributes that need to be set. But first can you see if you are able to add feature and save edits using Editor (interactively)? If yes, you can try to see if you need to simpilify the geometry before saving: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Simplify
... View more
01-04-2012
03:26 PM
|
0
|
0
|
2375
|
|
POST
|
Oh I see. Yeah, you are right. The Selection state is not preserved when it goes back to Normal from MouseOver. This seem related thread: http://forums.silverlight.net/t/46749.aspx/1 You can use the following Symbol Template instead:
<esri:MarkerSymbol x:Key="SelectMarkerSymbol" >
<esri:MarkerSymbol.ControlTemplate>
<ControlTemplate>
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="SelectionStates">
<VisualState x:Name="Unselected" />
<VisualState x:Name="Selected">
<Storyboard>
<ColorAnimation Storyboard.TargetName="Element"
Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)"
To="Yellow" Duration="00:00:0.25"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimation Storyboard.TargetName="Element2"
Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)"
To="Red" Duration="00:00:0.25"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Ellipse x:Name="Element" Width="15" Height="15" Fill="Cyan" Stroke="Black" />
<Ellipse x:Name="Element2" Width="15" Height="15" Fill="Transparent" Stroke="Black" />
</Grid>
</ControlTemplate>
</esri:MarkerSymbol.ControlTemplate>
</esri:MarkerSymbol>
... View more
01-04-2012
10:32 AM
|
0
|
0
|
1564
|
|
POST
|
I added the following code in the SDK sample http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsGeometry on EditGeometry_GeometryEdit event handler.
if (e.Action == EditGeometry.Action.VextedMoved || e.Action == EditGeometry.Action.VertexAdded)
{
editGeometry.StopEdit();
editGeometry.StartEdit(editGraphic);
}
else if(e.Action == EditGeometry.Action.EditCompleted)
layer.Refresh();
However, I still cannot reproduce the NullRef exception. The stack trace you provided helps though. We'll add more null check in UpdateVertexPosition. Maybe you can share code-snippets or submit a bug to support? I see from your other post http://forums.arcgis.com/threads/46344-Graphic-disappear-on-save-edits that you are doing this to grab the intermediate geometry during edit, we'll look into making this information available in future versions of the API.
... View more
01-04-2012
09:50 AM
|
0
|
0
|
2083
|
|
POST
|
You might have better luck finding answers from Silverlight forum. This seems related: http://forums.silverlight.net/t/222292.aspx/1.
... View more
01-04-2012
08:58 AM
|
0
|
0
|
1305
|
|
POST
|
Sure, you can define both. For example, you can modify SelectMarkerSymbol in this SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SelectGraphics to include CommonStates (Normal and MouseOver). On MouseOver, the Symbol will turn red.
<esri:MarkerSymbol x:Key="SelectMarkerSymbol" >
<esri:MarkerSymbol.ControlTemplate>
<ControlTemplate>
<Ellipse x:Name="Element" Width="15" Height="15" Fill="Cyan" Stroke="Black" >
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="SelectionStates">
<VisualState x:Name="Unselected" />
<VisualState x:Name="Selected">
<Storyboard>
<ColorAnimation Storyboard.TargetName="Element"
Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)"
To="Yellow" Duration="00:00:0.25"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimation Storyboard.TargetName="Element"
Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)"
To="Red" Duration="00:00:0.25"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Ellipse>
</ControlTemplate>
</esri:MarkerSymbol.ControlTemplate>
</esri:MarkerSymbol>
... View more
01-04-2012
08:54 AM
|
0
|
0
|
1564
|
|
POST
|
You can look at the following SDK samples: Map.Extent updates on pan/zoom http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#MapExtent Screen point can be converted to map coordinates http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#MouseCoords You can compare Map.Resolution property against ArcGISTiledMapServiceLayer.TileInfo.Lods.Resolution to know what level you are currently zoomed in. http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ShowMapProperties
... View more
01-04-2012
08:46 AM
|
0
|
0
|
2184
|
|
POST
|
If you are using v2.3 and up, WMSLayer has ImageFormat and SupportedImageFormats property that you can use. You can select "image/jpeg" if it is one of the supported format.
... View more
01-04-2012
08:35 AM
|
0
|
0
|
987
|
|
POST
|
You can make the following changes to the old SDK sample: http://help.arcgis.com/en/webapi/silverlight/2.2/samples/start.htm#ToolBarWidget Use Image.Tag and MouseLeftButtonDown. Declare _previousExtentImage and _nextExtentImage in XAML instead.
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/images/i_zoomin.png" Stretch="UniformToFill" Margin="5" Tag="zoomin" MouseLeftButtonDown="Image_MouseLeftButtonDown"/>
<Image Source="/Assets/images/i_zoomout.png" Stretch="UniformToFill" Margin="5" Tag="zoomout" MouseLeftButtonDown="Image_MouseLeftButtonDown"/>
<Image Source="/Assets/images/i_pan.png" Stretch="UniformToFill" Margin="5" Tag="pan" MouseLeftButtonDown="Image_MouseLeftButtonDown"/>
<Image x:Name="_previousExtentImage" Source="/Assets/images/i_previous.png" IsHitTestVisible="False" Opacity="0.3" Stretch="UniformToFill" Margin="5" Tag="previousextent" MouseLeftButtonDown="Image_MouseLeftButtonDown"/>
<Image x:Name="_nextExtentImage" Source="/Assets/images/i_next.png" IsHitTestVisible="False" Opacity="0.3" Stretch="UniformToFill" Margin="5" Tag="nextextent" MouseLeftButtonDown="Image_MouseLeftButtonDown"/>
<Image Source="/Assets/images/i_globe.png" Stretch="UniformToFill" Margin="5" Tag="fullextent" MouseLeftButtonDown="Image_MouseLeftButtonDown"/>
<Image Source="/Assets/images/i_widget.png" Stretch="UniformToFill" Margin="5" Tag="fullscreen" MouseLeftButtonDown="Image_MouseLeftButtonDown"/>
</StackPanel>
private void Image_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
_toolMode = (sender as Image).Tag.ToString();
StatusTextBlock.Text = _toolMode;
MyDrawObject.IsEnabled = false;
switch (_toolMode)
{
case "zoomin": // ZoomIn Layers
MyDrawObject.IsEnabled = true;
_toolMode = "zoomin";
break;
case "zoomout": // Zoom Out
MyDrawObject.IsEnabled = true;
_toolMode = "zoomout";
break;
case"pan": // Pan
break;
case "previousextent": // Previous Extent
if (_currentExtentIndex != 0)
{
_currentExtentIndex--;
if (_currentExtentIndex == 0)
{
_previousExtentImage.Opacity = 0.3;
_previousExtentImage.IsHitTestVisible = false;
}
_newExtent = false;
MyMap.IsHitTestVisible = false;
MyMap.ZoomTo(_extentHistory[_currentExtentIndex]);
if (_nextExtentImage.IsHitTestVisible == false)
{
_nextExtentImage.Opacity = 1;
_nextExtentImage.IsHitTestVisible = true;
}
}
break;
case "nextextent": // Next Extent
if (_currentExtentIndex < _extentHistory.Count - 1)
{
_currentExtentIndex++;
if (_currentExtentIndex == (_extentHistory.Count - 1))
{
_nextExtentImage.Opacity = 0.3;
_nextExtentImage.IsHitTestVisible = false;
}
_newExtent = false;
MyMap.IsHitTestVisible = false;
MyMap.ZoomTo(_extentHistory[_currentExtentIndex]);
if (_previousExtentImage.IsHitTestVisible == false)
{
_previousExtentImage.Opacity = 1;
_previousExtentImage.IsHitTestVisible = true;
}
}
break;
case "fullextent": // Full Extent
MyMap.ZoomTo(MyMap.Layers.GetFullExtent());
break;
case "fullscreen": // Full Screen
Application.Current.Host.Content.IsFullScreen = !Application.Current.Host.Content.IsFullScreen;
break;
}
}
... View more
01-03-2012
05:02 PM
|
0
|
0
|
944
|
|
POST
|
This might be a question for the server team: http://forums.arcgis.com/forums/8-ArcGIS-Server-General or maybe support. They might be able to help with configurations.
... View more
01-03-2012
12:53 PM
|
0
|
0
|
473
|
|
POST
|
The API support for touch and gestures was added in 2.1 http://help.arcgis.com/en/webapi/silverlight/2.1/help/index.html#/What_s_new_in_2_1/016600000025000000/ so yes v2.3 still supports touch 🙂
... View more
01-03-2012
12:47 PM
|
0
|
0
|
851
|
|
POST
|
If you are not using Editor. You can add graphic and save edits using the following code. Note that FeatureLayer l is already Initialized and UpdateCompleted. If FeatureLayer.AutoSave=False (True by default), you need to call SaveEdits() to commit the edits.
Graphic g = new Graphic()
{
Geometry = new MapPoint(x, y, MyMap.SpatialReference),
Symbol = LayoutRoot.Resources["MySymbol"] as Symbol
};
foreach(var f in l.LayerInfo.Fields)
{
if (f.Editable)
g.Attributes[f.Name] = f.Nullable ? null : somedefaultvalue;
}
l.Graphics.Add(g);
l.SaveEdits();
... View more
01-03-2012
11:29 AM
|
0
|
0
|
2375
|
| 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
|