固定比例尺进行缩放
方法一:设置Map控件的公共属性:
public double ZoomFactor {get; set;}
Depending on the ArcGIS API SDK, the user interaction that triggers a zoom consists of:
ArcGIS API for Silverlight and ArcGIS API for WPF:
- Left Mouse Double-click
- Left Mouse Double-click + Shift Key
- Scroll the Mouse Wheel
- + Key
- - Key
- Double-tap Gesture
ArcGIS API for Windows Phone:
- Double-tap Gesture
方法二:根据瓦片图层确定缩放级别
Snap to tile levels
The Silverlight platform includes efficient image resampling capabilities for a rich Web client environment. The ArcGIS Silverlight API Map control utilizes the Silverlight resampling engine to render map images associated with a map service layer such as cache tiles (e.g. ArcGISTiledMapServiceLayer) or dynamic map images (e.g. ArcGISDynamicMapServiceLayer). This provides a smooth flexible user experience and permits a client to view cached tiles are a scale of choice. You can choose to force the map to snap to a level of detail (LOD) in the first tiled map service layer using the SnapToLevels property. Note, once you set it to true the map can only be viewed at a scale (LOD) defined by the tiled map service layer.
<esri:Map x:Name="MyMap" SnapToLevels="True"> <esri:Map.Layers> <esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" /> </esri:Map.Layers> </esri:Map>
如果需要显示到瓦片图层指定一级的比例尺使用Map.ZoomToResolution
Zoom to a resolution defined as the number of map units per pixel. If you know the number of screen pixels per inch (e.g. DPI or PPI) you can accurately calculate map scale for the respective client.
TiledMapServiceLayer tiledLayer = MyMap.Layers["StreetMapLayer"] as TiledMapServiceLayer; Lod lod = tiledLayer.TileInfo.Lods[5]; MyMap.ZoomToResolution(lod.Resolution);