Select to view content in your preferred language

question about dynamic maplayer url

770
3
01-19-2011 09:22 AM
SangamLama
Emerging Contributor
Hello all,

I've been following the tutorial in ESRI Interactive SDK, where the map URL is hardcoded in the xaml side of SL page.

Now let's say there's a scenario where the map server is different for different users. In such a case, how can I add the map layer into my SL page?

As far as my attempt is concerned, I tried binding the map layer url as such:

<esri:ArcGISTiledMapServiceLayer x:Name="MapLayerUrl" ID="StreetMapLayer" Url="{Binding mapUrl}"/>

Its not working. InitializeComponent() in the constructor receives error from ESRI.ArcGIS.Client, which I'm assumig is expecting an absolute url string.

Any ideas?
0 Kudos
3 Replies
JMcNeil
Deactivated User
0 Kudos
JenniferNery
Esri Regular Contributor
Url is not a DependencyProperty that's why you cannot Bind to it. In addition to J's sample, you can also look at : http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SwitchMap. The ArcGISTiledMapServiceLayer.Url is updated in code-behind.
0 Kudos
SangamLama
Emerging Contributor
Url is not a DependencyProperty that's why you cannot Bind to it. In addition to J's sample, you can also look at : http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SwitchMap. The ArcGISTiledMapServiceLayer.Url is updated in code-behind.


easy enough. thanks to you both!!
0 Kudos