How to add overview map

2972
3
02-18-2012 11:25 PM
ErnejunCorvera
New Contributor III
i  would like to ask if there's a way to add overview map in the viewer..if there is, how?...
0 Kudos
3 Replies
DerekLaw
Esri Esteemed Contributor
Hi Ernejun,

Adding an overview map is not available "out-of-the-box" in the Silverlight Viewer App Builder. You will have to do some development work and create an add-in to enable this.

Hope this helps,
0 Kudos
KatherineDalton
Esri Regular Contributor
Yep, this will require a bit of development work. I've posted a sample of migrating the Magnifying Glass on this" rel="nofollow" target="_blank">http://forums.arcgis.com/threads/50984-Magnify-and-Magnifying-G... forum. Migrating the Overview Map is an identical process, since they are both in the ArcGIS API for Silverlight Toolkit library. There are several options:
1. Include the control in the layout of the Viewer application and use a button to toggle the visibility. You can see an example of this in the Control" rel="nofollow" target="_blank">http://help.arcgis.com/en/webapps/silverlightviewer/samples/... in Layout with Toggle Tool sample.
2. Include the xaml as below for displaying the UI and use MapApplication.Current.Show. The only drawback with this is that with something like the Magnfying Glass, it always shows a background window that hosts the xaml. But this approach would likely work just fine for the Overview Map. Then implement IToggleCommand (instead of ICommand) to toggle the visibility. You could use ICommand, but for this type of tool it is probably better practice to use IToggleCommand.
3. Include the xaml as below for displaying the UI, but use FloatingWindow to display the UI. You can edit the FloatingWindow style to set everything to be transparent as I've done in the Magnifying Glass sample, so that just the Glass shows. In that sample I also use IToggleCommand instead of ICommand.

Here's is the xaml. Notice the use of MapApplicationBindingSource as a Resource.

<UserControl x:Class="OverviewMap.AddIns.MyConfigDialog"
    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:esriExt="http://schemas.esri.com/arcgis/client/extensibility/2010"
             xmlns:esri="http://schemas.esri.com/arcgis/client/2009"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <UserControl.Resources>
        <esriExt:MapApplicationBindingSource x:Key="MapApplication"/>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <esri:OverviewMap Map="{Binding Map, Source={StaticResource MapApplication}}" Height="250" Width="300">
            <esri:OverviewMap.Layer>
                <esri:ArcGISTiledMapServiceLayer ID="Topo" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer" />
            </esri:OverviewMap.Layer>
        </esri:OverviewMap>
    </Grid>
</UserControl>


Hope that helps,
Katy
Katy Dalton | Technical Consultant
THE SCIENCE OF WHERE™
0 Kudos
JamilNawaz
New Contributor II

<UserControl x:Class="OverviewMap.AddIns.MyConfigDialog"
    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:esriExt="http://schemas.esri.com/arcgis/client/extensibility/2010"
             xmlns:esri="http://schemas.esri.com/arcgis/client/2009"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <UserControl.Resources>
        <esriExt:MapApplicationBindingSource x:Key="MapApplication"/>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <esri:OverviewMap Map="{Binding Map, Source={StaticResource MapApplication}}" Height="250" Width="300">
            <esri:OverviewMap.Layer>
                <esri:ArcGISTiledMapServiceLayer ID="Topo" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer" />
            </esri:OverviewMap.Layer>
        </esri:OverviewMap>
    </Grid>
</UserControl>



Hi You have overview map layer url hard coded, what if I want to configure it when adding tool? I have tried to remove url from and while loading the tool, it get it's layer and try to set url but it did not work? Any body can help?

Regards,
JAMIL
0 Kudos