• ArcGIS API for Silverlight overview


    1、a cross-browser, cross-platform development environment for building and delivering rich Internet applications (RIA) for the web

    2、You can also define the initial map extent and spatial reference in code-behind where you can use transformation logic to convert coordinates from one well-known spatial reference to another

    
    
    1 ESRI.ArcGIS.Client.Geometry.Envelope initialExtent = new
    2 ESRI.ArcGIS.Client.Geometry.Envelope(ESRI.ArcGIS.Client.Bing.Transform.GeographicToWebMercator( new
    3 ESRI.ArcGIS.Client.Geometry.MapPoint(-130, 20)),
    4 ESRI.ArcGIS.Client.Bing.Transform.GeographicToWebMercator(new ESRI.ArcGIS.Client.Geometry.MapPoint(-65, 55)));
    5  
    6 initialExtent.SpatialReference = new ESRI.ArcGIS.Client.Geometry.SpatialReference(102100);
    7  
    8 MyMap.Extent = initialExtent;
    View Code

    3、Map service layers come in two varieties, tiled and dynamic. Tiled service layers provide access to a set of map image tiles organized into predefined scale levels and hosted on a remote server. Dynamic service layers provide access to map and image services that generate map images on-the-fly.

    1 <esri:ArcGISDynamicMapServiceLayer ID="CaliforniaLayer"
    2   Url="http://serverapps.esri.com/ArcGIS/rest/services/California/MapServer"
    3   Initialized="CaliforniaLayer_Initialized" />
    1 private void CaliforniaLayer_Initialized(object sender, EventArgs e)
    2 {
    3   Layer layer = sender as Layer;
    4   MyMap.ZoomTo(layer.FullExtent);
    5 }
    <esri:ArcGISDynamicMapServiceLayer ID="CaliforniaLayer" 
      Url="http://serverapps.esri.com/ArcGIS/rest/services/California/MapServer"
      InitializationFailed="CaliforniaLayer_InitializationFailed" />
    private void CaliforniaLayer_InitializationFailed(object sender, EventArgs e) 
    {
      Layer layer = sender as Layer;
      string exceptionMessage = layer.InitializationFailure.Message;
      MyTextBlock.Text = exceptionMessage;
    }

    Map member

    Map action

    Extent property

    Set to an ESRI.ArcGIS.Client.Geometry.Envelope. The map extent changes to the defined extent without animation. The actual extent of the map may not match the Envelope defined because the aspect ratio of the map must be preserved. To discover the actual extent, handle the ExtentChanged event on the map and use the NewExtent property on the event arguments. See the following code:

     

     
    ESRI.ArcGIS.Client.Geometry.Envelope envelope = new
    ESRI.ArcGIS.Client.Geometry.Envelope(-120, 20, -100, 40);
    MyMap.Extent = envelope;
    

    Zoom(factor) method

    Zoom in or out based on the factor (ratio) provided.

    > 1 = zoom in

    < 1 = zoom out

    See the following code:

     

     
    MyMap.Zoom(2);
    

    ZoomTo(geometry) method

    Zoom to an extent that includes the ESRI.ArcGIS.Client.Geometry passed to the method. The geometry cannot be of type MapPoint. Map animation operates during the extent change. See the following code:

     

     
    MyMap.ZoomTo(myPolygon);
    

    ZoomToResolution(double) method

    Zoom to a resolution defined as the number of map units per pixel. If you know the number of screen pixels per inch (for example, dots per inch [dpi] or pixels per inch [ppi]), you can accurately calculate map scale for the respective client. See the following code:

     

     
    TiledMapServiceLayer tiledLayer = 
    MyMap.Layers["StreetMapLayer"] as TiledMapServiceLayer;
    Lod lod = tiledLayer.TileInfo.Lods[5];
    MyMap.ZoomToResolution(lod.Resolution);
    

    PanTo(geometry) method

    Pan to an extent that centers on the ESRI.ArcGIS.Client.Geometry instance passed to the method. The map scale will not change. Map animation operates during the operation. See the following code:

     

     
    MyMap.PanTo(myPoint);
    
  • 相关阅读:
    编写第一个 .NET 微服务
    Docker 基础知识编排在开发机上设置和使用 Kubernetes 环境
    将微服务部署到 Azure Kubernetes 服务 (AKS) 实践
    .NET Task.Run vs Task.Factory.StartNew
    Python上下文管理器
    Python可迭代的对象与迭代器的对比
    开发你的第一个SpringBoot应用
    Flask的Blueprints和Views
    Flask项目发布流程
    长篇大论Python生成器
  • 原文地址:https://www.cnblogs.com/rockman/p/3311424.html
Copyright © 2020-2023  润新知