Navigation Control doesn't show slider

3125
4
Jump to solution
02-07-2013 06:07 AM
Labels (1)
AndrewPurkis
New Contributor III
Hi

I'm having problems with the navigation control, when using a local map package.  The map loads correctly, but the navigation control doesn't display a zoom slider (see attached [ATTACH=CONFIG]21551[/ATTACH]).

I've tried this in code behind (preferred solution) and xaml.

XAML:
<Window x:Class="navtest2.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esri="http://schemas.esri.com/arcgis/client/2009
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    d:DesignWidth="337" SizeToContent="WidthAndHeight"
    d:DesignHeight="287" mc:Ignorable="d"
    Loaded="Window_Loaded">
<Grid x:Name="LayoutRoot" >
  <Grid.Resources>
   <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
  </Grid.Resources>
  <esri:Map x:Name="MyMap" WrapAround="True"
       Extent="-15000000,2000000,-7000000,8000000"
       Background="#FFE3E3E3" MinimumResolution="2445.98490512499">
   <esri:ArcGISLocalDynamicMapServiceLayer Path="./USCitiesStates.mpk"/>
  </esri:Map>
  <esri:Navigation Margin="5" HorizontalAlignment="Left"
           VerticalAlignment="Bottom"
                     Map="{Binding ElementName=MyMap}"  />
</Grid>
</Window>

C# Behind Code:
   LocalMapService localMapService = new LocalMapService()
    {
    Path = "./USCitiesStates.mpk",
    MaxRecords = 100000
    };
   localMapService.StartAsync(localService =>
    {
    if (localService.Error != null)
     return;
    ArcGISLocalDynamicMapServiceLayer layer = new ArcGISLocalDynamicMapServiceLayer(localMapService);
    MyMap.Layers.Add(layer);
    });

Any help would be appreciated.

Thanks

Andrew Purkis
0 Kudos
1 Solution

Accepted Solutions
norie
by
New Contributor III
The zoom slider will only be displayed if the Map.MinimumResolution and Map.MaximumResolution resolution on the Map control have been defined. If a ESRI.ArcGIS.Client.TiledMapServiceLayer is present in the Map's layer collection, in most cases the minimum and maximum resolution will be set for you. If a Map only contains ESRI.ArcGIS.Client.DynamicLayer, you must set the minimum and maximum resolution explicitly.



ESRI.ArcGIS.Client.Toolkit.Navigation

View solution in original post

0 Kudos
4 Replies
norie
by
New Contributor III
The zoom slider will only be displayed if the Map.MinimumResolution and Map.MaximumResolution resolution on the Map control have been defined. If a ESRI.ArcGIS.Client.TiledMapServiceLayer is present in the Map's layer collection, in most cases the minimum and maximum resolution will be set for you. If a Map only contains ESRI.ArcGIS.Client.DynamicLayer, you must set the minimum and maximum resolution explicitly.



ESRI.ArcGIS.Client.Toolkit.Navigation
0 Kudos
AndrewPurkis
New Contributor III
Thanks a lot!
0 Kudos
Cristian_Galindo
Occasional Contributor III
I'm facing the same issue, despite the fact that I set up the resolution, furthermore, I only have a tiled layer from ArcGIS online.

I was looking for the template that decribes the appearance of the navigation control, but it does not help me a lot

Any other suggestion?

I just discover that the rotation capability is disable 😞
0 Kudos
Cristian_Galindo
Occasional Contributor III
I am using a MVVM framework

the load of the base map occurs afther the objects are created, due a lazy loading strategy. the slider is not showed because at the moment that map is linked to the navigation control (XAML declaration), neither the map does not have resolution defined, nor the base map has been loaded.

So...my solution was to set up the map to the navigation control after the basemap is initialized (ArcGISTiledMapServiceLayer.initialized event), in that way the navigation found the parameters required.

Rotation is not enabled...maybe for the custom style applied:(
0 Kudos