Select to view content in your preferred language

url map services

1057
6
07-26-2010 08:54 AM
AgatinoLa_Rosa
Emerging Contributor
I have a map with three layers defined as below.

<esri:Map Name="baseMap">
<esri:ArcGISTiledMapServiceLayer ID="BaseLayer" Url="http://worldmap/MapServer"/>
<esri:ArcGISDynamicMapServiceLayer ID="SelectedService" />
<esri:GraphicsLayer ID="myGraphics" />
</esri:Map>

The dynamic service URL is defined in the c# code according to users' selection. The graphics are also added dynamically using the code.

I can clear the graphics in the graphiclayer, how can I clear the dynamic map service before reassigning a new url or should I redraw the whole map. Any suggestion to improve caching problems with many services to be visualized. Thanks.
0 Kudos
6 Replies
DominiqueBroux
Esri Frequent Contributor
In my opinion, you have only to reassign the url.
0 Kudos
AgatinoLa_Rosa
Emerging Contributor
It is working now I am not sure what could be wrong. Thanks anyway.
One more question. The zoom functionality is working using the wheel, I don't get the pan working using the mouse. Any idea?
0 Kudos
DominiqueBroux
Esri Frequent Contributor

One more question. The zoom functionality is working using the wheel, I don't get the pan working using the mouse. Any idea?

This can happen if your map is inside a scroll viewer. Is it your case?
0 Kudos
AgatinoLa_Rosa
Emerging Contributor
sorry for the late reply. Yes, I have also seen another case in the forum and the scrollview is the cause. However I have added a navigator on the map so somehow I solved the problem.

Thanks
0 Kudos
AgatinoLa_Rosa
Emerging Contributor
When I started this thread I had three layers. Now users can select either a cached or dynamic layer from a list of Layers. So either one between SelectedDynamicService or SelectedCachedService would be displayed.

<esri:Map Name="baseMap">
<esri:ArcGISTiledMapServiceLayer ID="BaseLayer" Url="http://worldmap/MapServer"/>
<esri:ArcGISDynamicMapServiceLayer ID="SelectedDynamicService" />
<esri:ArcGISTiledMapServiceLayer ID="SelectedCachedService" />
<esri:GraphicsLayer ID="myGraphics" />
</esri:Map>

If I set the map layers as above I get problems at run time when either one url is not assigned. Is there a way I can set a generic Layer at design time and then assign a dynamic or cached url at run time?
0 Kudos
DominiqueBroux
Esri Frequent Contributor

Is there a way I can set a generic Layer at design time and then assign a dynamic or cached url at run time?


No way to define a generic layer at desin time.

You might consider to create the layer by code after the user selection.
0 Kudos