Select to view content in your preferred language

Problem with Layer Definitions 2.1 Beta

873
8
11-04-2010 05:26 AM
RobChouinard
Frequent Contributor
If there is a forum/forms to submit bugs please let me know. I couldn't find it.

I switched my project from 2.0 to 2.1 Beta and I immediately realized that my layer definitions were not working. No code was changed. I made the move to 2.1 beta to test the layer defs because I was running into a problems with the layer defs length limitation in 2.0.

I started a new 2.1 beta project to test out the examples in the "Layer Definitions Property" in the 2.1 beta API reference. I couldn't get any of the examples to work. Setting the layer defs in XAML or C# did not work.

Possibly a bug?

Thanks,

Rob
0 Kudos
8 Replies
JenniferNery
Esri Regular Contributor
Can you share the code you used for LayerDefintions?  When you say they do not work, what do you mean exactly?  Do you mean the layer shows more than it should?  Can you run Fiddler to see the difference between the calls made with API v2.0 and v2.1 beta?

You can either report the bug here in the forums as we check them periodically or you can also go to http://support.esri.com/en/ to submit a bug.
0 Kudos
RobChouinard
Frequent Contributor
By worked I mean nothing is being "filtered". It is the same as a blank layer def. I ran fiddler and I think I found the bug.

The layer definition I set was on layer 0 = Magnitude > 6 so it should look like "0:Magnitude > 6;" before switching the special chars to char code. Below is what I get from both 2.0 and 2.1 Beta.

This is pulled from the GET HTTP request:

v2.0
layerDefs=0%3aMagnitude+%3e+6%3b
which equals
layerDefs=0:Magnitude > 6;

v2.1b
layerDefs=0%253aMagnitude%2b%253e%2b6%253b
which equals
layerDefs=0%3aMagnitude+%3e+6%3b


Looking at this their are 3 extra "25"'s which mess up the character codes. Char code %25 = the % sign.

If these were removed like so:
layerDefs=0%253aMagnitude%2b%253e%2b6%253b

It would be the same as the 2.0 request which is correct.

v2.0 Raw Get Request:
GET /ArcGIS/rest/services/Earthquakes/Since_1970/MapServer/export?bbox=-34844537.1956065,-19971868.8804086,34844537.1956065,19971868.8804086&size=1148,658&format=png24&transparent=true&imageSR=102100&bboxSR=102100&layerDefs=0%3aMagnitude+%3e+6%3b&f=image HTTP/1.1

v2.1b Raw Get Request:
GET /ArcGIS/rest/services/Earthquakes/Since_1970/MapServer/export?bbox=-34844537.1956065%2c-19971868.8804086%2c34844537.1956065%2c19971868.8804086&size=1148%2c658&format=png24&transparent=true&imageSR=102100&bboxSR=102100&layerDefs=0%253aMagnitude%2b%253e%2b6%253b&f=image& HTTP/1.1
0 Kudos
RobChouinard
Frequent Contributor
MainPage.xaml.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Browser;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Markup;
using System.Windows.Shapes;
using System.ComponentModel;
using ESRI.ArcGIS.Client;
using System.Windows.Controls.Primitives;

namespace ESRIStandardMapApplication1
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void myMenuItem1_Click(object sender, RoutedEventArgs e)
        {
            // The myArcGISDynamicMapServiceLayer (an ArcGISDynamicServiceLayer object) and TextBlock_LayerDefinitions
            // (a TextBlock object) were defined previously in the XAML or code-behind.

            // Get the layer in the LayerInfo collection. 
            ArcGISDynamicMapServiceLayer myArcGISDynamicMapServiceLayer = (ArcGISDynamicMapServiceLayer)Map.Layers[1];

            // LayerDefinition (Read/Write)

            // This is how to set (i.e. Write) a LayerDefinition.
            // --------------------------------------------------
            // Set the .LayerDefinition for the .LayerID = 0 (the Earthquakes1970 layer). By default no LayerDefinition 
            // is set unless explicitly set on the server.
            ESRI.ArcGIS.Client.LayerDefinition myDefinition = new ESRI.ArcGIS.Client.LayerDefinition();
            myDefinition.LayerID = 0;

            // The Definition only displays earth quakes that have an Magnitude greater than 6. 
            // The field Magnitude is of type esriFieldTypeDouble.
            myDefinition.Definition = "Magnitude > 6";

            // Another example where the Name of the earth quake event is to contains the letters 'CHINA'.
            // Note: the Definition is case sensitive. The field Name is of type esriFieldTypeString.
            //myDefinition.Definition = "Name LIKE 'CHINA'";

            // Another example where the Name of the earth quake event is exactly matches the letters 'VENEZUELA'.
            // Note: the Definition is case sensitive. The field Name is of type esriFieldTypeString.
            //myDefinition.Definition = "Name = 'VENEZUELA'";

            // Another example where the earth quake events are displayed if they occured after January 15, 2008. 
            // The field Date_ is of type esriFieldTypeDate.
            //myDefinition.Definition = "Date_ > DATE '1/15/2008'";

            // Create an ObservableCollection and add the .Definition to it.
            System.Collections.ObjectModel.ObservableCollection<LayerDefinition> myObservableCollection2 =
               new System.Collections.ObjectModel.ObservableCollection<LayerDefinition>();
            myObservableCollection2.Add(myDefinition);

            // Apply the custom LayerDefinition
            myArcGISDynamicMapServiceLayer.LayerDefinitions = myObservableCollection2;
            myArcGISDynamicMapServiceLayer.Refresh();


            

        }

        private void myMenuItem2_Click(object sender, RoutedEventArgs e)
        {
            // The myArcGISDynamicMapServiceLayer (an ArcGISDynamicServiceLayer object) and TextBlock_LayerDefinitions
            // (a TextBlock object) were defined previously in the XAML or code-behind.

            // Get the layer in the LayerInfo collection. 
            ArcGISDynamicMapServiceLayer myArcGISDynamicMapServiceLayer = (ArcGISDynamicMapServiceLayer)Map.Layers[1];

            // LayerDefinition (Read/Write)

            // This is how to set (i.e. Write) a LayerDefinition.
            // --------------------------------------------------
            // Set the .LayerDefinition for the .LayerID = 0 (the Earthquakes1970 layer). By default no LayerDefinition 
            // is set unless explicitly set on the server.
            ESRI.ArcGIS.Client.LayerDefinition myDefinition = new ESRI.ArcGIS.Client.LayerDefinition();
            myDefinition.LayerID = 0;

            // The Definition only displays earth quakes that have an Magnitude greater than 6. 
            // The field Magnitude is of type esriFieldTypeDouble.
            myDefinition.Definition = "Name = 'VENEZUELA'";

            // Another example where the Name of the earth quake event is to contains the letters 'CHINA'.
            // Note: the Definition is case sensitive. The field Name is of type esriFieldTypeString.
            //myDefinition.Definition = "Name LIKE 'CHINA'";

            // Another example where the Name of the earth quake event is exactly matches the letters 'VENEZUELA'.
            // Note: the Definition is case sensitive. The field Name is of type esriFieldTypeString.
            //myDefinition.Definition = "Name = 'VENEZUELA'";

            // Another example where the earth quake events are displayed if they occured after January 15, 2008. 
            // The field Date_ is of type esriFieldTypeDate.
            //myDefinition.Definition = "Date_ > DATE '1/15/2008'";

            // Create an ObservableCollection and add the .Definition to it.
            System.Collections.ObjectModel.ObservableCollection<LayerDefinition> myObservableCollection2 =
               new System.Collections.ObjectModel.ObservableCollection<LayerDefinition>();
            myObservableCollection2.Add(myDefinition);

            // Apply the custom LayerDefinition
            myArcGISDynamicMapServiceLayer.LayerDefinitions = myObservableCollection2;
            myArcGISDynamicMapServiceLayer.Refresh();
        }

        void ReadLayerDefs()
        {
            // This is how to get (i.e. Read) a LayerDefiniton.
            // The TextBlock_LayerDefinitions (a TextBlock object) was previously set in XAML or code-behind.
            // ----------------------------------------------------------------------------------------------
            // Get the existing LayerDefinitions collection.
            ArcGISDynamicMapServiceLayer myArcGISDynamicMapServiceLayer = (ArcGISDynamicMapServiceLayer)Map.Layers[1];
            System.Collections.ObjectModel.ObservableCollection<LayerDefinition> myObservableCollection =
                myArcGISDynamicMapServiceLayer.LayerDefinitions;

            if (myObservableCollection.Count > 0)
            {
                // Get the first LayerDefinition 
                ESRI.ArcGIS.Client.LayerDefinition myLayerDefinition = myObservableCollection[0];

                // Display some textual information about the LayerDefinition.
                MessageBox.Show("For Layer: " + myLayerDefinition.LayerID.ToString() + ". The Defintion is: " + myLayerDefinition.Definition);
            }
            else
            {
                MessageBox.Show("[NO LayerDefinitions SET]");
            }
        }

        private void myMenuItem3_Click(object sender, RoutedEventArgs e)
        {

            // Get the layer in the LayerInfo collection. 
            ArcGISDynamicMapServiceLayer myArcGISDynamicMapServiceLayer = (ArcGISDynamicMapServiceLayer)Map.Layers[1];

            // Create an ObservableCollection and add the .Definition to it.
            System.Collections.ObjectModel.ObservableCollection<LayerDefinition> myObservableCollection2 =
               new System.Collections.ObjectModel.ObservableCollection<LayerDefinition>();
           // myObservableCollection2.Add(myDefinition);

            // Apply the custom LayerDefinition
            myArcGISDynamicMapServiceLayer.LayerDefinitions = myObservableCollection2;
            myArcGISDynamicMapServiceLayer.Refresh();
        }
    }
}
0 Kudos
RobChouinard
Frequent Contributor
MainPage.xaml:
<UserControl x:Class="ESRIStandardMapApplication1.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" 
    mc:Ignorable="d" d:DesignWidth="780" d:DesignHeight="480"
 xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:ei="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
    xmlns:userControls="clr-namespace:ESRI.ArcGIS.SilverlightMapApp"
    xmlns:actions="clr-namespace:ESRI.ArcGIS.SilverlightMapApp.Actions">
    <Grid x:Name="LayoutRoot">
        <!-- Map Control -->
        <esri:Map x:Name="Map" Background="White">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseEnter">
                    <ei:ChangePropertyAction TargetName="myMenuItems" PropertyName="Visibility">
                        <ei:ChangePropertyAction.Value>
                            <Visibility>Collapsed</Visibility>
                        </ei:ChangePropertyAction.Value>
                    </ei:ChangePropertyAction>
                </i:EventTrigger>
            </i:Interaction.Triggers>
         <esri:ArcGISTiledMapServiceLayer ID="BaseLayer" 
          Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
            <esri:ArcGISDynamicMapServiceLayer Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/Since_1970/MapServer">
                <esri:ArcGISDynamicMapServiceLayer.LayerDefinitions>

                    <!-- LayerID="0" is the Earthquakes1970 layer. The Definition only displays earth quakes that have an
                              Magnitude greater than 6. The field Magnitude is of type esriFieldTypeDouble. -->
                    <!-- <esri:LayerDefinition LayerID="0" Definition="Magnitude > 6" /> -->

                    <!-- Another example where the Name of the earth quake event is to contains the letters 'CHINA'.
                              Note: the Definition is case sensitive. The field Name is of type esriFieldTypeString. -->
                    <!-- <esri:LayerDefinition LayerID="0" Definition="Name LIKE 'CHINA'" /> -->

                    <!-- Another example where the Name of the earth quake event is exactly matches the letters 'VENEZUELA'.
                              Note: the Definition is case sensitive. The field Name is of type esriFieldTypeString. -->
                    <!-- <esri:LayerDefinition LayerID="0" Definition="Name = 'VENEZUELA'" /> -->

                    <!-- Another example where the earth quake events are displayed if they occured after January 15, 2008. 
                              The field Date_ is of type esriFieldTypeDate. -->
                    <!-- <esri:LayerDefinition LayerID="0" Definition="Date_ > DATE '1/15/2008'" />-->

                </esri:ArcGISDynamicMapServiceLayer.LayerDefinitions>
            </esri:ArcGISDynamicMapServiceLayer>
            <!--<esri:ArcGISDynamicMapServiceLayer ID="Base Map"
                    Url="http://ccmcd-gis/ArcGIS/rest/services/Citrus_Base/MapServer" />-->
        </esri:Map>
        
        <!-- Main Menu -->
        <Grid HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10" >
            <userControls:CollapsiblePanel x:Name="MainManu" IsExpanded="True" 
                                           RenderTransformOrigin="0,0"
                                           VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
                <Border Style="{StaticResource CommonBorder}">
                    <StackPanel Margin="3">

                        <Grid x:Name="BannerGrid" Grid.Row="0" Margin="30,0">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="30" />
                                <RowDefinition Height="3" />
                                <RowDefinition Height="17" />
                            </Grid.RowDefinitions>
                            <!-- Application Title -->
                            <TextBlock x:Name="title" Margin="0,0,15,0" Style="{StaticResource Title}" 
                                       Text="{StaticResource ApplicationTitle}" Grid.Row="0" />
                            <Rectangle x:Name="separatorBar" Fill="CornflowerBlue" Grid.Row="1" />
                            <!-- Application Subtitle -->
                            <TextBlock x:Name="subtitle" Style="{StaticResource Subtitle}" 
                                       Text="{StaticResource ApplicationSubtitle}" Grid.Row="2" />
                        </Grid>

                        <Canvas HorizontalAlignment="Left" Height="25" Width="Auto"
                                VerticalAlignment="Bottom" Margin="10,10,10,-5">
                            <StackPanel Orientation="Horizontal">
                                <Button x:Name="myMenu" Style="{StaticResource MenuButton}" 
                                        ToolTipService.ToolTip="Menu">
                                    <Button.Content>
                                        <Image Source="Images/i_globe.png" Stretch="Fill" />
                                    </Button.Content>
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="MouseEnter">
                                            <ei:ChangePropertyAction TargetName="myMenuItems" PropertyName="Visibility">
                                                <ei:ChangePropertyAction.Value>
                                                    <Visibility>Visible</Visibility>
                                                </ei:ChangePropertyAction.Value>
                                            </ei:ChangePropertyAction>
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </Button>

                                <Button x:Name="btnAbout" Style="{StaticResource MenuButton}" 
                                        ToolTipService.ToolTip="About ESRI ArcGIS Mapping Application">
                                    <Button.Content>
                                        <Image Source="Images/i_about.png" Stretch="Fill" />
                                    </Button.Content>
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="MouseEnter">
                                            <ei:ChangePropertyAction TargetName="myMenuItems" PropertyName="Visibility">
                                                <ei:ChangePropertyAction.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </ei:ChangePropertyAction.Value>
                                            </ei:ChangePropertyAction>
                                        </i:EventTrigger>
                                        <i:EventTrigger EventName="Click">
                                            <actions:ToggleVisibilityAction TargetName="AboutWindow" />
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </Button>
                            </StackPanel>
                        </Canvas>
                    </StackPanel>
                </Border>
            </userControls:CollapsiblePanel>
            <Image Source="Images/logo.png" HorizontalAlignment="Left" VerticalAlignment="Top" 
                   Stretch="Fill" Height="40" Width="40" Margin="-10" 
                   ToolTipService.ToolTip="Expand/Collapse Menu Bar">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="MouseLeftButtonDown">
                        <actions:ToggleCollapseAction TargetName="MainManu" />
                    </i:EventTrigger>
                    <i:EventTrigger EventName="MouseLeftButtonDown">
                        <ei:ChangePropertyAction TargetName="myMenuItems" PropertyName="Visibility">
                            <ei:ChangePropertyAction.Value>
                                <Visibility>Collapsed</Visibility>
                            </ei:ChangePropertyAction.Value>
                        </ei:ChangePropertyAction>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Image>
        </Grid>
0 Kudos
RobChouinard
Frequent Contributor
MainPage.xaml continued
        <!-- The SubMenus -->
        <Grid x:Name="myMenuItems" HorizontalAlignment="Left" VerticalAlignment="Top"
              Margin="30,112">
            <Border Style="{StaticResource CommonBorder}" Padding="10,3,10,3">
                <StackPanel>
                    <Button x:Name="myMenuItem1" 
                            Style="{StaticResource MenuItem}" 
                            ToolTipService.ToolTip="Your First Menu Here!" Content="LayerDef 1" Click="myMenuItem1_Click" />
                    <Button x:Name="myMenuItem2" 
                            Style="{StaticResource MenuItem}" 
                            ToolTipService.ToolTip="Your Second Menu Here!" 
                            Content="LayerDef 2" Click="myMenuItem2_Click" />
                    <Button x:Name="myMenuItem3" 
                            Style="{StaticResource MenuItem}" 
                            ToolTipService.ToolTip="Your Third Menu Here!" 
                            Content="Clear LayerDef" Click="myMenuItem3_Click" />
                </StackPanel>
            </Border>
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseLeave">
                    <ei:ChangePropertyAction TargetName="myMenuItems" PropertyName="Visibility">
                     <ei:ChangePropertyAction.Value>
                      <Visibility>Collapsed</Visibility>
                     </ei:ChangePropertyAction.Value>
                    </ei:ChangePropertyAction>
                </i:EventTrigger>
                <i:EventTrigger EventName="Loaded">
                 <ei:ChangePropertyAction TargetName="myMenuItems" PropertyName="Visibility">
                  <ei:ChangePropertyAction.Value>
                   <Visibility>Collapsed</Visibility>
                  </ei:ChangePropertyAction.Value>
                 </ei:ChangePropertyAction>
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Grid>

        <!-- StackPanel containing the Base Map Switcher and the Application Toolbar -->
        <StackPanel Orientation="Horizontal" 
                    HorizontalAlignment="Right" Margin="0,5,5,0" VerticalAlignment="Top" >
            <!-- Base Map Switcher -->
   <Border x:Name="BaseMapSwitcher"  Style="{StaticResource CommonBorder}"  VerticalAlignment="Top" HorizontalAlignment="Right" Margin="5">
    <StackPanel Orientation="Horizontal" Margin="5">
     <RadioButton Content="Streets" IsChecked="True"
       ToolTipService.ToolTip="Worldwide Street Map"
       GroupName="BaseLayer"
       Margin="5,0,0,0" Foreground="White" FontSize="11" >
      <i:Interaction.Triggers>
       <i:EventTrigger EventName="Checked">
        <actions:SetLayerUrlAction TargetName="Map" LayerID="BaseLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
       </i:EventTrigger>
      </i:Interaction.Triggers>
     </RadioButton>
     <RadioButton Content="Topo"
       GroupName="BaseLayer"
       ToolTipService.ToolTip="United States Topographic Map"
       Margin="5,0,0,0" Foreground="White" FontSize="11" >
      <i:Interaction.Triggers>
       <i:EventTrigger EventName="Checked">
        <actions:SetLayerUrlAction TargetName="Map" LayerID="BaseLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer"/>
       </i:EventTrigger>
      </i:Interaction.Triggers>
     </RadioButton>
     <RadioButton Content="Imagery"
       ToolTipService.ToolTip="Worldwide Satellite Imagery Map"
       GroupName="BaseLayer"
       Margin="5,0,0,0" Foreground="White" FontSize="11" >
      <i:Interaction.Triggers>
       <i:EventTrigger EventName="Checked">
        <actions:SetLayerUrlAction TargetName="Map" LayerID="BaseLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>
       </i:EventTrigger>
      </i:Interaction.Triggers>
     </RadioButton>
    </StackPanel>
   </Border>
           
            <!-- Toolbar -->
            <Grid Margin="5">
                <userControls:CollapsiblePanel x:Name="MainToolbar" IsExpanded="True" 
                                               RenderTransformOrigin="1,0"
                                               VerticalContentAlignment="Stretch"
                                               HorizontalContentAlignment="Stretch" Margin="0,0,5,0">
                        <Grid HorizontalAlignment="Left" Effect="{StaticResource dropShadow}">
                            <Border Style="{StaticResource CommonBorder}" Margin="0,0,0,18" Effect="{x:Null}" />
                            <StackPanel Orientation="Horizontal" Margin="0,7,15,0">
                                <Button x:Name="btnToggleBaseMapSwitcher" Style="{StaticResource ToolbarButton}" 
                                        ToolTipService.ToolTip="Toggle visibility of the base map switcher">
                                    <Button.Content>
                                        <Image Source="Images/i_clickglobe.png" Stretch="Fill" />
                                    </Button.Content>
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="Click">
                                            <actions:ToggleVisibilityAction TargetName="BaseMapSwitcher" />
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </Button>

                            <Button x:Name="btnToggleOverviewMap" Style="{StaticResource ToolbarButton}" 
                                    ToolTipService.ToolTip="Toggle visibility of the overview map">
                                    <Button.Content>
                                        <Image Source="Images/i_overview.png" Stretch="Fill" />
                                    </Button.Content>
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="Click">
                                            <actions:ToggleVisibilityAction TargetName="OverviewMapPanel" />
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </Button>

                            <Button x:Name="btnToggleMagnifyingGlass" Style="{StaticResource ToolbarButton}" 
                                    ToolTipService.ToolTip="Toggle visibility of the magnifying glass">
                                <Button.Content>
                                        <Image Source="Images/i_magnifyglass.png" Stretch="Fill" />
                                    </Button.Content>
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="Click">
                                            <actions:ToggleVisibilityAction TargetName="MagnifyingGlass" />
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </Button>
                            </StackPanel>
                        </Grid>
                </userControls:CollapsiblePanel>
                <Image Source="Images/i_tools.png" HorizontalAlignment="Right" 
                   VerticalAlignment="Top" Stretch="Fill" Height="30" Width="30" Margin="-5" 
                   ToolTipService.ToolTip="Expand/Collapse Toolbar">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="MouseLeftButtonDown">
                            <actions:ToggleCollapseAction TargetName="MainToolbar" />
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </Image>
            </Grid>
        </StackPanel>

        <!-- Navigator -->
        <esri:Navigation  x:Name="Navigator" HorizontalAlignment="Left" VerticalAlignment="Bottom" 
                                 Margin="40,0,0,30"
         Map="{Binding ElementName=Map}" />

        <!-- Scale Bar -->
        <userControls:ScaleBar x:Name="ScaleBar" MapUnit="Meters" Map="{Binding ElementName=Map}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="20,0,0,10" />
0 Kudos
RobChouinard
Frequent Contributor
MainPage.xaml continued
        <!-- Overview Map Window -->
        <userControls:WindowPanel x:Name="OverviewMapPanel" Width="212" Height="231" 
          VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,89,10,0">
         <i:Interaction.Triggers>
          <i:EventTrigger EventName="Loaded">
           <ei:ChangePropertyAction PropertyName="Visibility">
            <ei:ChangePropertyAction.Value>
             <Visibility>Collapsed</Visibility>
            </ei:ChangePropertyAction.Value>
           </ei:ChangePropertyAction>
          </i:EventTrigger>
         </i:Interaction.Triggers>
            <esri:OverviewMap x:Name="OVMap" Margin="0" 
         Map="{Binding ElementName=Map}">
                <esri:OverviewMap.Layer>
                    <esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
                </esri:OverviewMap.Layer>
            </esri:OverviewMap>
            <userControls:WindowPanel.ContentTitle>
                <StackPanel Orientation="Horizontal">
                    <Image Source="Images/i_overview.png" 
                           HorizontalAlignment="Left" VerticalAlignment="Top" Stretch="Fill" 
                           Width="20" Height="20" Margin="5,2,0,0" />
                    <TextBlock Foreground="White" FontSize="12" 
                               Text="Overview Map" Width="100" TextWrapping="NoWrap" Height="Auto" 
                               HorizontalAlignment="Left" Margin="5,3,0,0" />
                </StackPanel>
            </userControls:WindowPanel.ContentTitle>
        </userControls:WindowPanel>

        <!-- Magnifying Glass -->
  <esri:MagnifyingGlass x:Name="MagnifyingGlass" HorizontalAlignment="Left" VerticalAlignment="Top"
           Map="{Binding ElementName=Map}" Margin="50,150,0,0" Visibility="Collapsed">
   <esri:MagnifyingGlass.Layer>
    <esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
   </esri:MagnifyingGlass.Layer>
  </esri:MagnifyingGlass>

        <!-- About Window -->
        <userControls:WindowPanel x:Name="AboutWindow" Width="375" Height="150" Visibility="Collapsed"  Effect="{StaticResource dropShadow}"
                                  Background="{StaticResource CommonBackgroundBrush}"
          VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
            <StackPanel Orientation="Vertical">
                <TextBlock Style="{StaticResource Title}" TextWrapping="NoWrap" 
                           Text="{StaticResource ApplicationTitle}" Width="Auto" Height="Auto" 
                           Margin="5,3,0,0" />
                <TextBlock Style="{StaticResource Subtitle}" TextWrapping="NoWrap" 
                           Text="{StaticResource ApplicationSubtitle}" Width="Auto" Height="Auto" 
                           Margin="5,1,0,0" />
                <Line X1="5" Y1="50" X2="355" Y2="50" Stroke="White" StrokeThickness="0.25" />
                <TextBlock Foreground="Yellow" FontSize="11" Width="Auto" TextWrapping="NoWrap" 
                           Text="{StaticResource ApplicationInfo}" Height="Auto" 
                           HorizontalAlignment="Left" Margin="5,3,0,0" />
            </StackPanel>
            <userControls:WindowPanel.ContentTitle>
                <StackPanel Orientation="Horizontal">
                    <Image Source="Images/logo.png" 
                           HorizontalAlignment="Left" VerticalAlignment="Top" Stretch="Fill" 
                           Width="20" Height="20" Margin="5,2,0,0" />
                    <TextBlock Foreground="White" FontSize="12" 
                               Text="About" Width="100" TextWrapping="NoWrap" Height="Auto" 
                               HorizontalAlignment="Left" Margin="5,3,0,0" />
                </StackPanel>
            </userControls:WindowPanel.ContentTitle>
        </userControls:WindowPanel>
    </Grid>
</UserControl>
0 Kudos
DominiqueBroux
Esri Frequent Contributor
This issue should be fixed in the Release Canditate available here : http://help.arcgis.com/en/webapi/silverlight/2.1/
0 Kudos
RobChouinard
Frequent Contributor
Thanks for your help. It is nice to see developers directly helping customers. Keep up the good work!

Rob
0 Kudos