|
POST
|
Hi Nathalie, I am sorry, there was no documentation on how include the controls in a new project. I just posted a new version with a Readme (readme.txt under MapPrintingControls) and a few bugs/enhancements to simplify the user experience with Blend. Please download this new version and let me know if you get any problem with. Thanks
... View more
10-06-2010
11:18 PM
|
0
|
0
|
2252
|
|
POST
|
Did you look at this sample ? http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#GeoRSS The data are coming from an XML feed instead a JSON feed but it looks close of what you need.
... View more
10-05-2010
04:56 AM
|
0
|
0
|
1213
|
|
POST
|
If I understand well, your _Parent should be the current main page and not one created with the new keyword. If you are sure that the map is inside the root control you can use _Parent = (Mainpage)System.Windows.Application.Current.RootVisual; Or, more elegant, you can add a 'Map' property to your switch control in order to get the map buddied to your control. In switch.cs add :
#region Map
/// <summary>
/// Gets or sets the map that the switch control is buddied to.
/// </summary>
/// <value>The map.</value>
public ESRI.ArcGIS.Client.Map Map
{
get { return GetValue(MapProperty) as Map; }
set { SetValue(MapProperty, value); }
}
/// /// <summary>
/// Identifies the <see cref="Map"/> dependency property.
/// </summary>
public static readonly DependencyProperty MapProperty =
DependencyProperty.Register("Map", typeof(Map), typeof(Switch),null);
#endregion
In switch.cs, replace all '_Parent.MyMap' by 'Map' In MainPage.xaml, bind the Map property of your Switch control :
<Switch Map={Binding ElementName=MyMap} ...... />
... View more
10-05-2010
04:49 AM
|
0
|
0
|
1005
|
|
POST
|
Using the Silverlight print API, you can print any control. If the printed control contains a map with several dynamic layer,feature layer, graphics layer... , all these layers will be printed. It becomes a little more difficult if you want a print preview or if you want to print at scale. In this case you may need to clone the map, and so you need to clone all the layers as well. A little time ago,I posted a print sample allowing: - print preview - print at scale - print on multi pages - templatable print pages This sample can be tested here. The silverlight limitation I noticed is that SL don't allow to print using large format and high resolution (probably because Silverlight's print implementation is done by printing to a bitmap and this bitmap could become huge). For example to print in A0 I have to reduce the the printer resolution to 150dpi.
... View more
10-05-2010
04:14 AM
|
0
|
0
|
2252
|
|
POST
|
Are you talking about this sample : http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#LocationToAddress? I didn't notice any crashes. I just get an error message (not very explicit) when the service don't find any address with the given tolerance (20meters in this sample). Note that the tolerance can be changed in the code. Please give more details about your issue if it's not related to this tolerance value.
... View more
10-05-2010
03:32 AM
|
0
|
0
|
497
|
|
POST
|
I am trying to get the MapTips control to work. Is it a maptip issue or didn't you get any feature displayed? Could it have to do with the Geometry envelope in the C#? ESRI.ArcGIS.Client.Tasks.Query query = new ESRI.ArcGIS.Client.Tasks.Query() { Geometry = new ESRI.ArcGIS.Client.Geometry.Envelope(-180, 0, 0, 90) }; Possibly a spatial reference issue. If your service or your map is using WebMercator coordinates, the envelope you gave is very small. Also, I cannot seem to change the damn color of my scale bar text. There is a 'TextColor' property which should do the job.
... View more
09-29-2010
08:48 AM
|
0
|
0
|
562
|
|
POST
|
It's not possible to use ArcObjects dlls in a silverlight application. The silverlight dlls that you can use are ESRI.ArcGIS.Client.dll and ESRI.ArcGIS.Client.*.dll
... View more
09-28-2010
09:43 AM
|
0
|
0
|
885
|
|
POST
|
You might also be interested by a centerAndZoom function:
private void centerAndZoom(ESRI.ArcGIS.Client.Map map, ESRI.ArcGIS.Client.Geometry.MapPoint mapPoint, double resolution)
{
double ratio = 1.0;
if (map.Resolution != 0.0)
ratio = resolution / map.Resolution;
if (ratio == 1.0)
map.PanTo(mapPoint);
else
{
ESRI.ArcGIS.Client.Geometry.MapPoint mapCenter = map.Extent.GetCenter();
double X = (mapPoint.X - ratio * mapCenter.X) / (1 - ratio);
double Y = (mapPoint.Y - ratio * mapCenter.Y) / (1 - ratio);
map.ZoomToResolution(resolution, new ESRI.ArcGIS.Client.Geometry.MapPoint(X, Y));
}
}
You can use it to center on a point and zoom to a given resolution. For example centerAndZoom(MyMap, pt, MyMap.MinimumResolution * 4);
... View more
09-28-2010
09:32 AM
|
0
|
0
|
3089
|
|
POST
|
There is an example of GraphicsLayer serialization here : http://forums.arcgis.com/threads/8774-save-layer-to-xml-file?highlight=serialize+graphics but there are some limitations : for example the symbols are not serialized.
... View more
09-28-2010
09:24 AM
|
0
|
0
|
2643
|
|
POST
|
Likely because the Url of your geometry server is not right. The 'rest' part is missing. Should be http://myserver.the.domain/ArcGIS/rest/services/Geometry/GeometryServer The same request on arcgis online is working well: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer/project?inSR=26913&outSR=4617&geometries=555776%2c6651833&f=json&
... View more
09-28-2010
09:11 AM
|
0
|
0
|
634
|
|
POST
|
UniqueValueRender.Infos property is read-only but you can add/remove items to it.
myUniqueValueRenderer.Infos.Add(new UniqueValueInfo() { Value="California", Symbol=.......});
... View more
09-28-2010
08:54 AM
|
0
|
0
|
691
|
|
POST
|
From SL4, you can access items of a dictionary by using the notation [<key>]. In your case, the binding should be: "{Binding Path=Attributes[Hoek]}"
... View more
09-28-2010
08:45 AM
|
0
|
0
|
514
|
|
POST
|
Hi DAshton, If you want only one layer visible among 3, it means that each time the user clicks a radio button you have to set the visibility of one layer and unset the visibility of the 2 others. So my 3 lines of xaml code had be duplicated for each button with the visible values modified appropriately. <RadioButton Content="Streets" IsChecked="True" ToolTipService.ToolTip="Worldwide Street Map" GroupName="BaseLayer" Margin="0" FontSize="11" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="Checked">
<actions:SetLayerVisibilityAction TargetName="Map" LayerID="BaseLayer" Visible="True"/>
<actions:SetLayerVisibilityAction TargetName="Map" LayerID="ImageLayer" Visible="False"/>
<actions:SetLayerVisibilityAction TargetName="Map" LayerID="ImageLayer2" Visible="False"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</RadioButton>
<RadioButton Content="Topo" GroupName="BaseLayer" ToolTipService.ToolTip="United States Topographic Map" Margin="5,0,0,0" FontSize="11" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="Checked">
<actions:SetLayerVisibilityAction TargetName="Map" LayerID="BaseLayer" Visible="False"/>
<actions:SetLayerVisibilityAction TargetName="Map" LayerID="ImageLayer" Visible="True"/>
<actions:SetLayerVisibilityAction TargetName="Map" LayerID="ImageLayer2" Visible="False"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</RadioButton>
<RadioButton Content="Imagery" ToolTipService.ToolTip="Worldwide Satellite Imagery Map" GroupName="BaseLayer" Margin="5,0,0,0" FontSize="11" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="Checked">
<actions:SetLayerVisibilityAction TargetName="Map" LayerID="BaseLayer" Visible="False"/>
<actions:SetLayerVisibilityAction TargetName="Map" LayerID="ImageLayer" Visible="False"/>
<actions:SetLayerVisibilityAction TargetName="Map" LayerID="ImageLayer2" Visible="True"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</RadioButton>
You might also initialize your map with only one layer visible by setting the visible property: <esri:ArcGISTiledMapServiceLayer ID="BaseLayer"
Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" Initialized="ArcGISTiledMapServiceLayer_Initialized" />
<esri:GraphicsLayer ID="MySelectionGraphicsLayer" />
<esri:ArcGISTiledMapServiceLayer ID="ImageLayer2" Visible="False" Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer" />
<esri:ArcGISTiledMapServiceLayer ID="ImageLayer" Visible="False" Url="http://services.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer" />
My first post was not enough clear. Sorry about that.
... View more
09-15-2010
09:59 AM
|
0
|
0
|
1523
|
|
POST
|
You can't use the toggle visibility action for this: <actions:ToggleVisibilityAction TargetName="Map" LayerID="ImageLayer2" /> This action allows to toggle the visibility (collapsed/visible) of an UI element. It's not designed to toggle a layer visible property (because: ToggleVisibilityAction has no layerID property, a layer is not an UI element, visible property of a layer is not (collapsed/visible) but (true/false)). The action Morten was talking about was 'ToggleLayerAction' provided in the ESRI.ArcGIS.Client.Behaviors dll (need to add a reference in your project). That being said if you want to be able to see multiple services at the same time (looks to be the case since your radiobuttons are not from the same group), you can simply use a checkbox and a simple binding: <CheckBox Content="Imagery" ToolTipService.ToolTip="Worldwide Satellite Imagery Map" Margin="5,0,0,0" FontSize="11" IsChecked="{Binding Layers[ImageLayer2].Visible, ElementName=Map, Mode=TwoWay}" /> If you want to get only one visible, Radio buttons are the right choice (in the same group). But if there is more than 2 layers in your group, I think you can't get the result with the existing 'ToggleLayerAction'. You need to write a SetLayerVisibilityAction:
namespace ESRI.ArcGIS.SilverlightMapApp.Actions
{
public class SetLayerVisibilityAction : TargetedTriggerAction<Map>
{
/// <summary>
/// Invokes the action.
/// </summary>
/// <param name="parameter">The parameter to the action. If the Action does not require a parameter, the parameter may be set to a null reference.</param>
protected override void Invoke(object parameter)
{
if (!string.IsNullOrEmpty(LayerID))
{
Layer l = Target.Layers[LayerID];
l.Visible = Visible;
}
}
/// <summary>
/// Gets or sets the ID of layer to work with.
/// </summary>
/// <value>The layer ID.</value>
public string LayerID
{
get { return (string)GetValue(LayerIDProperty); }
set { SetValue(LayerIDProperty, value); }
}
/// <summary>
/// Identifies the <see cref="LayerID"/> dependency property.
/// </summary>
public static readonly DependencyProperty LayerIDProperty =
DependencyProperty.Register("LayerID", typeof(string), typeof(SetLayerVisibilityAction), null);
/// <summary>
/// Gets or sets the visibility of the layer.
/// </summary>
/// <value>The layer ID.</value>
public bool Visible
{
get { return (bool)GetValue(VisibleProperty); }
set { SetValue(VisibleProperty, value); }
}
/// <summary>
/// Identifies the <see cref="Visible"/> dependency property.
/// </summary>
public static readonly DependencyProperty VisibleProperty =
DependencyProperty.Register("Visible", typeof(bool), typeof(SetLayerVisibilityAction), null);
}
}
Then in your XAML you can set/unset visibility of layers:
<i:Interaction.Triggers>
<i:EventTrigger EventName="Checked">
<actions:SetLayerVisibilityAction TargetName="Map" LayerID="BaseLayer" Visible="False"/>
<actions:SetLayerVisibilityAction TargetName="Map" LayerID="ImageLayer1" Visible="False"/>
<actions:SetLayerVisibilityAction TargetName="Map" LayerID="ImageLayer2" Visible="True"/>
</i:EventTrigger>
</i:Interaction.Triggers>
... View more
09-14-2010
01:03 AM
|
0
|
0
|
1523
|
|
POST
|
1. Is it possible to group the TOC by individual Groups, so that the List box consists of some kind of TreeView, and not all Sublayer-Checkboxes are shown at once?? It is possible but it needs some developments to create the hierarchical data. From version 2.1, a legend/TOC control will be provided. 2. Is it possible to create a Slider to change the Opacity of the Sublayers, like one can do it with the Layers?? No that's not possible. The opacity of sublayers is defined when publishing the service and can't be changed by the REST API.
... View more
09-14-2010
12:33 AM
|
0
|
0
|
913
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-12-2025 03:01 AM | |
| 1 | 10-14-2025 09:24 AM | |
| 1 | 06-13-2013 09:22 AM | |
| 1 | 04-29-2022 02:21 AM | |
| 1 | 04-29-2022 02:28 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-30-2025
08:06 AM
|