Select to view content in your preferred language

Can't adding OpenStreetMapLayer

2247
1
04-11-2012 12:49 AM
AlexanderBelozerov
New Contributor
Hello.

Sorry, my English is so-so.

I trying add OSM contol at my silverlight App (SL 4, VS2010 SP1, Win7). I am install ESRI toolkit. When i place control "Map" from toolbox to my Grid, automaticly created next code:

<esri:Map Background="White" Name="map1" WrapAround="True" >
            <esri:Map.Layers>
                <esri:LayerCollection>
                    <esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
                </esri:LayerCollection>
            </esri:Map.Layers>
        </esri:Map>

I copy sample code from this page:
http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client.Toolkit.DataSources~ESRI.ArcG...

and see error:

The tag 'OpenStreetMapLayer' does not exist in XML namespace 'http://schemas.esri.com/arcgis/client/2009'

What I do wrong?

All xaml code:

<UserControl x:Class="UniformWins.Nav.MapViewer"
    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"
    mc:Ignorable="d"
    d:DesignHeight="500" d:DesignWidth="600" xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
   
    <Grid x:Name="LayoutRoot" Background="White">
        <esri:Map x:Name="MyMap">
            <esri:OpenStreetMapLayer Style="Mapnik" />
        </esri:Map>
    </Grid>
</UserControl>
0 Kudos
1 Reply
DominiqueBroux
Esri Frequent Contributor
OpenStreetMapLayer is defined in the ESRI.ArcGIS.Client.Toolikit.DataSources package so be sure that this dll is referenced in your project.
0 Kudos