zoukankan      html  css  js  c++  java
  • 2010年8月18日周三_insideTheAPI_usingMap_6.2

    /**********************************************************************************************/

    //Using Map

    //Version 2.0  

    //2010年8月18日周三

    /**********************************************************************************************/

    Tutorial overview

    This tutorial shows you how to create an application with a map zoomed in to a specific location, illustrating how the ArcGIS API for Flex is used in an MXML page.

    The following is the sample MXML code in its entirety:

    <?xml version="1.0" encoding="utf-8"?>

    <s:Application

        xmlns:fx="http://ns.adobe.com/mxml/2009"

        xmlns:s="library://ns.adobe.com/flex/spark"

        xmlns:mx="library://ns.adobe.com/flex/halo"

        xmlns:esri="http://www.esri.com/2008/ags"

        pageTitle="A tiled map service"

        >

        <esri:Map>

            <esri:ArcGISTiledMapServiceLayer

                url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>

        </esri:Map>

    </s:Application>

    向导预览

    这个向导将向你展示如何创建一个应用程序并将地图放到到指定的位置,下面解释了ArcGIS API FOR Flex 如何在一个MXML页中使用

    下面是例子的部分MXML代码

    View this sample.

    Your code should always contain the same two parts:

    The namespace

    ActionScript code and/or MXML tags

    预览这个例子

    你的代码应该总是包含相同的两部分。

    命名空间

    ActionScript code and/or MXML tags

    How to create a map

    If desired, add a page title inside the <s:Application> tag. This name will appear in your Web browser title bar.

    Add the map to your application by inserting the following code:

    如何创建一个地图

    如何需要,将一个页面的标题添加到<s:Application>标签。 这个标题将会出现在你的web 浏览器中的标题栏中。

    插入下面的代码,向你的应用中添地图。

    <esri:Map>

    When you first use the esri namespace, Flash Builder automatically adds the namespace to the application tag. When you add <esri:Map>, Flash Builder automatically creates its matching end tag </esri:Map>.

    Add a layer from ArcGIS Online. For instance, add the following inside the Map tag:

    <esri:ArcGISTiledMapServiceLayer

        url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />

    The StreetMap service, a tiled MapService layer, is initialized using the ArcGISTiledMapServiceLayer constructor. The URL is the endpoint for this service. This endpoint is a reference to a service that you can find out using Services Directory.

    Set an extent. In this instance, you will add an extent with a specific bounding box to zoom in to Africa.

    <esri:extent>

        <esri:Extent xmin="-1788000" ymin="-4177000" xmax="10044000" ymax="4511000">

            <esri:SpatialReference wkid="102100"/>

    </esri:extent>

    Compile your complete application. You should see a map centered on Africa.

     

    如果你是第一次使用ESRI命名空间,Flash builder 自动向你的应用程序标签中添加命名空间。 当你添加<esri:Map>,Flash builder 自动的为你生成匹配的结束标签</esri:Map>.

    从在线的ArcGIS 中添加一个图层,比如:见下面的代码添加到Map标签。

    <esri:ArcGISTiledMapServiceLayer

        url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />

    这个街道地图,是一个缓存地图,使用ArcGISTiledMapServiceLayer构造函数进行初始化。 这个URL是这个服务的endpoint(——)。这个endpoint是一个服务的引用,通过它你可以找到使用的服务的地址。

    设置一个范围。 在这个例子中,你将要添加一个包含特殊边缘的范围,使地图放大到到非洲。

  • 相关阅读:
    LOL 战斗力查询
    D3js-对柱状图的增,删,排序
    我的项目7 js 实现歌词同步(额,小小的效果)
    为什么电脑启动任务管理器会这样
    OpenCV求取轮廓线
    leetcode-Reverse Words in a String
    Linux lvs DR配置
    p2p网贷3种运营模式
    T4308 数据结构判断
    1080 线段树练习
  • 原文地址:https://www.cnblogs.com/xingchen/p/1802996.html
Copyright © 2011-2022 走看看