zoukankan      html  css  js  c++  java
  • ArcGIS Server Flex API 自定义缩放控件的级数[代码]

    直接上代码,首先,在map控件中增加Load事件函数,代码如下:

    <esri:Map id="myMap" width="100%" height="100%" level="6" load="addLODs()">

    对应的addLODs()函数定义如下:

    private function addLODs():void
    {
    // make sure the resolution makes sense for tile schema of the base layer
    // both resolution and scale are required fields
    // About NaN: The lods are automatically sorted based on scale, so setting level isn't necessary.
    var lods:Array = myMap.lods;
    // 下面注释代码为增加缩放级数
    /*
       lods.push(new LOD(NaN, 0.6, 3000));
    lods.push(new LOD(NaN, 0.3, 1500));
    lods.push(new LOD(NaN, 0.1, 500));
    */
       // 下面代码为删除缩放级数
    lods.splice(
    0, 5);
    myMap.lods
    = lods;
    }
    1 private function addLODs():void
    2 {
    3 // make sure the resolution makes sense for tile schema of the base layer
    4 // both resolution and scale are required fields
    5 // About NaN: The lods are automatically sorted based on scale, so setting level isn't necessary.
    6 var lods:Array = myMap.lods;
    7 /*lods.push(new LOD(NaN, 0.6, 3000));
    8 lods.push(new LOD(NaN, 0.3, 1500));
    9 lods.push(new LOD(NaN, 0.1, 500));
    10 lods.pop();
    11 lods.pop(); */
    12 lods.splice(0, 5);
    13 myMap.lods = lods;
    14 }v的
  • 相关阅读:
    一种client同步server数据的方案
    nodejs package.json解释
    node.js JS对象和JSON字符串之间的转换
    setInterval的用法
    ActiveMQ 入门Nodejs版
    ActiveMQ + NodeJS + Stomp 极简入门
    为什么 ++[[]][+[]]+[+[]] = 10?
    Child Process模块
    phantomjs 解码url
    PhantomJSのメモいろいろ
  • 原文地址:https://www.cnblogs.com/gis9/p/2103185.html
Copyright © 2011-2022 走看看