arcgis javascript api学习6

摘要:
类:ImageParameters描述表示调用ArcGISDynamicMapServiceLayer.exportMapImage、Geoprocessor.getResultImage和Geoprocessor.getResultImageLayer时使用的图像参数选项
Class: ImageParameters  

Description

Represents the image parameter options used when calling ArcGISDynamicMapServiceLayer.exportMapImage, Geoprocessor.getResultImage, and Geoprocessor.getResultImageLayer. 
(在调用ArcGISDynamicMapServiceLayer.exportMapImageGeoprocessor.getResultImage, and Geoprocessor.getResultImageLayer时表现图片参数的选项)

Class hierarchy

esri.layers.ImageParameters

Constructor

ConstructorDescription
esri.layers.ImageParameters()

  Creates a new ImageParameters object. The constructor takes no parameters.

Properties

PropertyTypeDescription
bboxExtent

Extent of map to be exported.

dpi Number

Dots per inch setting for an ArcGISDynamicMapServiceLayer.

format String

Map image format.

height Number

Requested image height in pixels.

imageSpatialReferenceSpatialReference

Spatial reference of exported map. See Projected Coordinate Systems and Geographic Coordinate Systems for the list of supported spatial references.

layerDefinitions String[]

Array of layer definition expressions that allows you to filter the features of individual layers in the exported map image. Layer definitions with semicolons or colons are supported if using a map service published using ArcGIS Server 10.

layerIds Number[]

A list of layer ID's, that represent which layers to include in the exported map.Use in combination with layerOption to specify how layer visiblity is handled. 

(一个图层ids的列表,用于表达哪些layer包含在导出的map中。常常和layerOption结合使用来指定layer的可视性如何处理)

layerOption String

The option for displaying or hiding the layer. See the Constants table for valid values. 

(用于表达展现或者隐藏的选项,请查看常量表来确认合法的值)

layerTimeOptionsLayerTimeOptions[]

Array of LayerTimeOptions objects that allow you to override how a layer is exported in reference to the map's time extent. There is one object per sub-layer.

timeExtentTimeExtent

The time extent for the map image.

transparent Boolean

Whether or not background of dynamic image is transparent.

width Number

Requested image width in pixels.

Constants

ConstantDescription
LAYER_OPTION_EXCLUDE

  Shows all layers visible by default except the specified layer ID's.

(默认展现所有的图层,除了指定的layer ids)

LAYER_OPTION_HIDE

  Shows all layers except the specified layer ID's. 

(展现所有的图层,除了指定的layer ids)

LAYER_OPTION_INCLUDE

  Shows specified layer ID's in addition to layers visible by default.

(展现指定的图层,除了默认的图层)

LAYER_OPTION_SHOW

  Shows only the specified layer ID's. 

(仅仅展现指定的layer ids)



————————————————————————————————————————————————————————————

Description

This sample demonstrates how to explicitly create a list of layers in a map service. The list is comprised of HTML checkboxes that you can use to toggle the layers' visibility.

The function updateLayerVisibility() contains the logic that turns the layers on and off. It loops through each layer in the list, records whether the layer should be visible depending on the checkbox status, and updates the visibility accordingly using ArcGISDynamicMapServiceLayer.setVisibleLayers().

If you are interested in creating a layer list automatically from all the layers in the map service, see the sample Dynamically create layer list.

Code

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <!--The viewport meta tag is used to improve the presentation and behavior of the samples
      on iOS devices-->
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
    <title>Explicitly Create Map Service Layer List</title>

    <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.1/js/dojo/dijit/themes/claro/claro.css">
    <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.1"></script>

    <script type="text/javascript">
      dojo.require("esri.map");

      var layer, map, visible = [];

      function init() {
        map = new esri.Map("map");

  //Use the ImageParameters to set the visible layers in the map service during ArcGISDynamicMapServiceLayer construction.

 (在ArcGISDynamicMapServiceLayer的构造函数中使用ImageParameters来设置map service中图层的可视性)
        var imageParameters = new esri.layers.ImageParameters();
        imageParameters.layerIds = [2];
        imageParameters.layerOption = esri.layers.ImageParameters.LAYER_OPTION_SHOW;
        

//can also be: LAYER_OPTION_EXCLUDE, LAYER_OPTION_HIDE, LAYER_OPTION_INCLUDE

(也可以是:LAYER_OPTION_EXCLUDE, LAYER_OPTION_HIDE, LAYER_OPTION_INCLUDE

 
        layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer", {"imageParameters":imageParameters});
        map.addLayer(layer);
      }

      function updateLayerVisibility() {
        var inputs = dojo.query(".list_item"), input;
        //in this application layer 2 is always on.
        visible = [2];
        for (var i=0, il=inputs.length; i<il; i++) {
          if (inputs[i].checked) {
            visible.push(inputs[i].id);
          }
        }
        layer.setVisibleLayers(visible);
      }

      dojo.addOnLoad(init);
    </script>


  </head>
  <body>
  This sample loads an ArcGISDynamicMapServiceLayer and presents check boxes for only the layers that should be toggled on and off by users.  <br />
    <br />
        Layer List : <span id="layer_list"><input type='checkbox' value=0 onclick='updateLayerVisibility();'/>Cities&nbsp;&nbsp;
          <input type='checkbox' value=1 onclick='updateLayerVisibility();'/>Rivers&nbsp;&nbsp;
        </span><br />
        <br />
    <div style="600px; height:400px; border:1px solid #000;"></div>
  </body>
</html>

______________________________________________________________________________________________________________________

Class: InfoTemplate  

Description

An InfoTemplate contains a title and content template string used to transform Graphic.attributes into an HTML representation(InfoTemplate包含标题和内容模板字符串,InfoTemplate用于把graphic.attributes翻译成html表达形式). The Dojo syntax ${<key>} performs the parameter substitution. In addition, a wildcard ${*} can be used as the template string. The wildcard prints out all of the attribute's name value pairs. The default behavior on a Graphic is to show the Map's InfoWindow after a click on the Graphic(graphic上默认的行为是展示map的infowindow在点击这个graphic之后). An InfoTemplate is required for this default behavior(对于默认的行为InfoTemplate是必须的).

Class hierarchy

esri.InfoTemplate

Constructor

ConstructorDescription
esri.InfoTemplate()Creates a new empty InfoTemplate object.
esri.InfoTemplate(title, content)Creates a new InfoTemplate object. All parameters are required and must be specified in the order given.
esri.InfoTemplate(json)Creates a new InfoTemplate object using a JSON object.

Properties

PropertyTypeDescription
contentStringThe template for defining how to format the content used in an InfoWindow.
titleStringThe template for defining how to format the title used in an InfoWindow.
(infotemplate定义在infowindow中使用的内容如何展现)
(infotemplate定义在infowindow中使用的标题如何展现)
————————————————————————————————————————————————————————————————————————————
Class: InfoWindow  

Description

An InfoWindow is an HTML popup(InfoWindow是一个HTML的弹出框). It often contains the attributes of a Graphic.(它常常包含一个graphic的attributes) The default behavior on a Graphic is to show the InfoWindow after a click on the Graphic(一个graphic的默认行为是在点击它之后展示infowindow). An InfoTemplate is required for this default behavior. In addition, the InfoWindow can be used to display custom content on the map(除此之外,infowindow能被用来在地图上展示客户化的内容).

Class hierarchy

esri.dijit.InfoWindow

免责声明:文章转载自《arcgis javascript api学习6》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇HTML5行业现状与未来springboot整合dubbo的简单案例下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

json编码格式化美化

有时候你想存储一个json到文件中,然后让别人调用或者读取或者作为临时存储,诸如此类。 但是php json_encode后数据是压缩的没有格式化,导致读起来有点费劲。 所以你可以这样(php 5.4以后)    代码如下: <?php $arr = array( 'status' => true, 'info' =&g...

WebService客户端调用常见5种方式

之前系统中使用到了webservice进行第三方通信,这里总结一下常见的5种客户端调用方式。 在此之前我们先简单搭建一个webservice服务端项目,发布一个webservice服务。我这里使用springboot快速搭建一个,项目结构如下: 创建一个springboot项目,导入maven依赖: <dependency> <...

写了一个 gorm 乐观锁插件

前言 最近在用 Go 写业务的时碰到了并发更新数据的场景,由于该业务并发度不高,只是为了防止出现并发时数据异常。 所以自然就想到了乐观锁的解决方案。 实现 乐观锁的实现比较简单,相信大部分有数据库使用经验的都能想到。 UPDATE `table` SET `amount`=100,`version`=version+1 WHERE `version` =...

ElementUI的el-select怎样实现下拉多选并实现给下拉框赋值和获取值

场景 要实现的效果如下 官方示例代码实现多选 为el-select设置multiple属性即可启用多选,此时v-model的值为当前选中值所组成的数组。 默认情况下选中值会以 Tag 的形式展现,你也可以设置collapse-tags属性将它们合并为一段文字。 <template> <el-select v-model="valu...

WPF自定义控件与样式(10)-进度控件ProcessBar自定义样

一.前言   申明:WPF自定义控件与样式是一个系列文章,前后是有些关联的,但大多是按照由简到繁的顺序逐步发布的等,若有不明白的地方可以参考本系列前面的文章,文末附有部分文章链接。   本文主要内容: ProcessBar自定义标准样式; ProcessBar自定义环形进度样式; 二.ProcessBar标准样式   效果图:     P...

在linux上oracle服务启动停止详细

转至:https://www.cnblogs.com/baihuitestsoftware/articles/6365431.html 在CentOS 6.3下安装完Oracle 10g R2,重开机之后,你会发现Oracle没有自行启动,这是正常的,因为在Linux下安装Oracle的确不会自行启动,必须要自行设定相关参数,首先先介绍一般而言如何启动or...