Select to view content in your preferred language

ElementLayer Childer Render at the same location

502
1
04-13-2013 01:09 PM
StergiosIsaakidis
New Contributor
[ATTACH=CONFIG]23476[/ATTACH]Hello,

I'm using the following code (similar to the approach used in the online example), to render custom controls on different locations of the map:

<esri:Map x:Name="Map" Background="{StaticResource BaseColor}" WrapAround="true">
                <esri:ArcGISTiledMapServiceLayer ID="BaseLayer"
            Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" />
                <esri:ElementLayer>         
                        <local:Site x:Name="SiteA" SiteName="Site A" esri:ElementLayer.Envelope="-117,34,-117,34" />
                    <local:Site x:Name="SiteB" SiteName="Site B" esri:ElementLayer.Envelope="39,22,39,22" />
                </esri:ElementLayer>
            </esri:Map>

My problem is that both SiteA and SiteB controls appear on the same location!


I've also tried to directly copy and paste the xaml from the online example, but the result is exactly the same! All the ElementLayer children appear on the same location (somewhere in the middle of the screen - see attachment).

Am I missing something?

Thank you in advance
0 Kudos
1 Reply
DominiqueBroux
Esri Frequent Contributor
Your basemap uses a web Mercator spatial reference, so your map uses the same SR and you have to set the coordinates of your elements in these coordinates (instead of geographical coordinates).
You can use the WebMercator class to transform your WGS84 coordinates to web Mercator.
0 Kudos