Resolution problem

1308
12
09-01-2010 07:22 AM
AgatinoLa_Rosa
Emerging Contributor
I have a map control in a silverlight 3 app with API 1.2 that shows dynamically users' map services. The first layer is an arcgisonline street layer, and on top of that a user's service. The first map displays ok and it shows a resolution of NaN(??), when reloading the map control with other services (dynamic and cached as well) I get "error on Page" and a resolution value of thousands.

How can I make this at work? Thanks.
0 Kudos
12 Replies
JenniferNery
Esri Regular Contributor
Are you using the ZoomSlider to update the map's resolution too? What exactly does ResolutionToValue() do? I suspect you use it to convert the double value to int? How are you setting the slider's Minimum and Maximum values? Your code-behind shows that you use the map's resolution to update the value on the ZoomSlider but are you using the slider to update the map's resolution too? Are you doing any binding in your XAML? I wonder if the error occurs before or after the ZoomSlider value is set. Try to debug through this and also look at the stack trace if there's any helpful information there. I'm sorry that I have more questions that answer, it's difficult to pin point the error without knowing the purpose of the slider and how it is used with the map.
0 Kudos
KeithNightlinger
Emerging Contributor
I would strongly advise against changing the Url at runtime. Depending on what service you change it to, weird things can happen.
Instead remove the layer, create a new instance and add that to the map.


Morton,
If this is not recommended, why is there a code sample provided in the interactive samples?

http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/samples/start.htm#SwitchMap

I guess the follow up question would be why doesn't the sample demonstrate switching between the tiled, image and dynamic services?

Keith
0 Kudos
dotMorten_esri
Esri Notable Contributor
Valid point.
0 Kudos