<UserControl x:Class="MapApp.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:esri="http://schemas.esri.com/arcgis/client/2009" xmlns:esriSymbols="clr-namespace:ESRI.ArcGIS.Client.Symbols;assembly=ESRI.ArcGIS.Client" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <esri:Map x:Name="MyMap" MouseLeftButtonDown="MyMap_MouseLeftButtonDown"> <esri:Map.Layers> <esri:ArcGISDynamicMapServiceLayer ID="StreetMapLayer" Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer" /> </esri:Map.Layers> </esri:Map> <Canvas> <esri:Magnifier x:Name="MyMagnifier" ZoomFactor="2" Map="{Binding ElementName=MyMap}" Canvas.ZIndex="10"> <esri:Magnifier.Layers> <esri:ArcGISDynamicMapServiceLayer ID="MagnifyImageLayer" Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0" /> </esri:Magnifier.Layers> </esri:Magnifier> </Canvas> </Grid> </UserControl>
using System; using System.Net; using System.Windows.Controls; using System.Windows.Input; namespace MapApp { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); } private void MyMap_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { MyMagnifier.Enabled = !MyMagnifier.Enabled; } } }
Line: 56 Error: Unhandled Error in Silverlight Application Code: 4004 Category: ManagedRuntimeError Message: System.ArgumentException: Service URL does not contain any layer. at ESRI.ArcGIS.Client.Layer.OnInitializationFailed(EventArgs e) at ESRI.ArcGIS.Client.Layer.Initialize() at ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer.<>n__FabricatedMethod8() at ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer.<>c__DisplayClass6.<MapServiceInfoInitFailed>b__4()
<esri:ArcGISDynamicMapServiceLayer ID="MagnifyImageLayer" Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0" />
<esri:ArcGISDynamicMapServiceLayer ID="MagnifyImageLayer" Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0" /> <esri:ArcGISDynamicMapServiceLayer ID="MagnifyImageLayer" Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/1" />
This works when pointing at all layers but not one layer i.e. Mapserver/0
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.