Select to view content in your preferred language

Controlling Map Resolution Limits

1754
8
04-30-2010 08:54 AM
TonyBacon
Deactivated User
Given a map containing image service layers (tiled), how does one control the map resolutions upper limit?

From what I have read in various posts a map that only contains dynamic services or feature layers can scale from epsilon to infinity but as soon as tiled layers are present the highest resolution tiled layer sets the upper limit. Is this true and if so then the only way to allow a user to zoom in closer would be to include a tiled layer that supports the higher resolution?

Where does one find this sort of information? The online documentation and samples that I know of do not provide such detailed information. I spend quite a bit of time hunting.
0 Kudos
8 Replies
DominiqueBroux
Esri Frequent Contributor
The Minimum/Maximum Resolutions of the map are initialized automatically from the tiled layers, but you can override these values by your own values without adding a dummy tiled layer.


/Dominique
0 Kudos
TonyBacon
Deactivated User
Thank you.
0 Kudos
GavinMcGhie
Regular Contributor
Dominique
If you're still linked to this thread, any chance you could point to documentation describing "how" to override the limits? I found another thread
http://forums.esri.com/thread.asp?c=158&f=2455&t=283054
simply stating that you use something like
<esri:Map MinimumResolution="0.00000001" />
but where the heck does it go? We're just starting to play with SL and it seems that it goes in the map.xml file, but trial & error has gotten me nowhere in trying to improve the zoom level. I sure wish I had a programmer on hand...  =:o)
Thanks, Gavin
0 Kudos
JenniferNery
Esri Regular Contributor
    <Grid x:Name="LayoutRoot" Background="White">
        <esri:Map x:Name="MyMap" WrapAround="True" >
            <esri:ArcGISTiledMapServiceLayer 
                Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
            <esri:FeatureLayer ID="SF311" Url="http://servicesbeta2.esri.com/arcgis/rest/services/SF311/FeatureServer/0" 
                               MinimumResolution="3.5895263819922" MaximumResolution="117.2893181475264"
      Mode="OnDemand" DisableClientCaching="True"/>
        </esri:Map>
        <TextBlock Text="{Binding ElementName=MyMap, Path=Resolution}" VerticalAlignment="Top" HorizontalAlignment="Center"/>
    </Grid>


Try the code above. Minimum/MaximumResolution had been set on the layer. When you zoom in to San Francisco area and the MaximumResolution is hit, the layer becomes visible and as you zoom in more and the MinimumResolution is hit, the layer becomes invisible again. Map's resolution is displayed in the TextBlock to guide you.
0 Kudos
GavinMcGhie
Regular Contributor
Thanks Jennifer
If I interpret your code correctly, it looks like you've inserted a tiled map service in which you did not apply a minimum resolution and then a "FeatureLayer" in which you apply the desired resolution range (presumable to work independently from the max/min of the tiled service?). I am assuming the "FeatureLayer" is a single layer pulled from a dynamic map service?

To be more specific about my issue, I created a map using the SL application builder. I added a tiled map service from esri (code below), 2 dynamic map services (local) and a featurelayer from one of our local dynamic services. As we see, there is a minimum resolution set with the tiled service, but it seems to just be a placeholder since changing the value or removing the code has no effect on zooming. The min zoom level of the tiled service seems to control the zoom scale of the map, even though the dynamic services can be zoomed much closer (as we do in the web ADF maps).

Your example seems to imply that adding a "FeatureLayer" and setting a min resolution range on that will take over once the tiled service turns off? This doesn't seem to be the case for me. I removed the min resolution code from the tiled service and added a min resolution of 0.00000001 to the feature layer. I still can't zoom in past the extent of a very large parcel (same as before). My goal is to be able to zoom in very tight so users can see things like valve clusters in an intersection. Forgive my ignorance, but what am I missing?
Thanks, Gavin

  <esri:ArcGISTiledMapServiceLayer ID="Topographic" Url="http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer" MinimumResolution="0">
    <esriExtensibility:Document.IsBaseMap>true</esriExtensibility:Document.IsBaseMap>
    <esriMapping:LayerExtensions.LayerName>Light Gray Canvas</esriMapping:LayerExtensions.LayerName>
    <esriMapping:LayerExtensions.LayerInfos />
    <esriExtensibility:LayerProperties.IsPopupEnabled>true</esriExtensibility:LayerProperties.IsPopupEnabled>
    <esriExtensibility:LayerProperties.IsVisibleInMapContents>true</esriExtensibility:LayerProperties.IsVisibleInMapContents>
  </esri:ArcGISTiledMapServiceLayer>
0 Kudos
DominiqueBroux
Esri Frequent Contributor
There are 2 different things:

  • for a layer : MinimumResolution/maximumResolution drive the visibility of the layer depending on the scale (but doesn't impact the zoom limits for the map)

  • for a map : MinimumResolution/maximumResolution constraint the zoom limits for the map. If your map contains tiled layers, see also the SnapToLevels property that constraints the zoom levels to those defined by the tiled layer;

Hope that helps.
0 Kudos
GavinMcGhie
Regular Contributor
Thanks Dominique- Feeling a bit undergunned here, but I'm just not getting it in case anyone is willing to spell it out for me.

The SnapToLevels property defaults to off, which is good because I don't want to constrain zooming to the tiles.

I've read in numerous places that you can "override the MinimumResolution" of a TiledMapService to control the Min resolution of the Map (not the layer). Anyone want to confirm whether this is actually possible without writing a whole block of code? Is it done within the code block for the TiledMapService? I assume not since changing the MinimumResolution from 0 to something really small in that block seems to have no effect on the map. Seems like it's supposed to be as easy as a single line setting a new value for MinimumResolution. My coding is basically trial by fire, but nothing I've tried has worked to this point.
Thanks, Gavin

PS- below is the entire map.xml file. Seems like it should be easy enough, but the format is far different than examples I've seen- assuming due to being created in the application builder:
=-=-=-=-=-=-=-=
<esri:Map
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:sys="clr-namespace:System;assembly=mscorlib"
  xmlns:esri="http://schemas.esri.com/arcgis/client/2009"
  xmlns:esriBing="clr-namespace:ESRI.ArcGIS.Client.Bing;assembly=ESRI.ArcGIS.Client.Bing"
  xmlns:esriMapping="http://schemas.esri.com/arcgis/mapping/2009"
  xmlns:esriExtensibility="http://schemas.esri.com/arcgis/client/extensibility/2010"
  xmlns:esriFSSymbols="clr-namespace:ESRI.ArcGIS.Client.FeatureService.Symbols;assembly=ESRI.ArcGIS.Client"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<esriMapping:ScaleBarExtensions.ScaleBarMapUnit>Meters</esriMapping:ScaleBarExtensions.ScaleBarMapUnit>
<esri:Map.IsLogoVisible>False</esri:Map.IsLogoVisible>
<esri:Map.Extent>
  <esri:Envelope XMin="-13641187.7156398" XMax="-13638471.3364929" YMin="4569668.5" YMax="4571234.5">
   <esri:Envelope.SpatialReference>
    <esri:SpatialReference WKID="102100" />
   </esri:Envelope.SpatialReference>
  </esri:Envelope>
</esri:Map.Extent>
<esri:ArcGISTiledMapServiceLayer ID="b5cf0f4129ea4bac9ce08db7ad830804" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" MinimumResolution="0">
  <esriExtensibility:Document.IsBaseMap>true</esriExtensibility:Document.IsBaseMap>
  <esriMapping:LayerExtensions.LayerName>Streets</esriMapping:LayerExtensions.LayerName>
  <esriMapping:LayerExtensions.LayerInfos />
  <esriExtensibility:LayerProperties.IsPopupEnabled>true</esriExtensibility:LayerProperties.IsPopupEnabled>
  <esriExtensibility:LayerProperties.IsVisibleInMapContents>true</esriExtensibility:LayerProperties.IsVisibleInMapContents>
</esri:ArcGISTiledMapServiceLayer>
</esri:Map>
=-=-=-=-=-=-=-=
0 Kudos
GavinMcGhie
Regular Contributor
Just in case anyone else is struggling with this, ESRI support helped out with a simple solution that works great for overriding the Min Resolution. I still want to find a way to turn off the basemap at some scale, but big step in the right direction.   cheers
-----
The DEV team actually put this online as a sample. There's a good description of the tools purpose.

Map Scale Settings Add-In
http://www.arcgis.com/home/item.html?id=0b2c8fcac5624bdd92f9fef15fdb96ef

This is an add in that will allow you to set the minumum and maximum scale on a per-layer basis.

For clear directions, see:
Extending the ArcGIS Viewer for Silverlight
http://help.arcgis.com/en/webapps/silverlightviewer/help/#/Extending_the_ArcGIS_Viewer_for_Silverlig...
-----
0 Kudos