2024年6月1日发(作者:)

1 map类和Navigation类小结

1.1 Map类

1.1.1 概述

类是一种容器,其中可以放置layer(图层),Graphic(),

infowindow(动态信息窗口)。

其在网页中可以加载到DIV中,其高度宽度位置等有DIV决定。

其方法事件在第一个图层加载完成后激发,因此,

onloadhandler事件经常用来初始化map的一些参数和加载图层。

1.1.2 引用方式

引用方式为:(divID,options?)

divID为显示地图的层的ID;

options为地图相关参数设置,主要的参数设置有:

(1)bool displayGraphicsOnPan:设置地图浏览时是否显示图形,设置为

false可以提高运行效率和效果;

使用方法:

var myMap = new ("mapDiv", { displayGraphicsOnPan:false });

(2) extent:设置地图的显示范围;

使用方法:

var myMap = new ("mapDiv", { extent: new

(-124.71, 31.89, -113.97, 42.63) });

(3) layer:用来加载图层,初始化地图。格式为:{type, url}

(4) lods:待研究

(5) nav:地图可以pan,默认为True

(6) showInfoWindowOnClick:当Graphic有InfoTemplate时,

单击Graphics就会出现InfoWindow,默认为:true

(7) slider:控制放大缩小滑块的显示,默认为True

var myMap = new ("mapDiv", { slider:false, nav:false });

1.1.3 属性

Property

extent

Type

Extent

Description

The current extent of the map

in map units. This property is

read-only.

graphicsGraphicsLaye

r

Add and remove graphics from

the GraphicsLayer.

heightNumber Current height of the map in

screen pixels.

idString Reference to HTML DIV or

other element where the map is

placed on the page. This property

is set in the Map constructor.

infoWindowInfoWindowDisplays the InfoWindow on a

map.

isClickRecenterBoolean When true, the key sequence

of shift then click to recenter

the map is enabled.

isDoubleClickZoomBoolean When true, double click zoom

is enabled. This allows a user to

zoom and recenter the map by

double clicking the mouse.

isKeyboardNavigati

on

Boolean When true, keyboard

navigation is enabled. This

本文发布于:2024-06-01,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:地图图层显示

发布评论

评论列表(有0条评论)
    福州电脑网_福州电脑维修_福州电脑之家_福州iThome

    福州电脑网_福州电脑维修_福州电脑之家_福州iThome

    福州电脑维修网(fzithome.com)专业的电脑维修,笔记本维修,上门维修各种电脑,笔记本,平板等,快速上门.电脑知识频道内容覆盖:计算机资讯,电脑基础应用知识,各种电脑故障维修学习,电脑外设产品维修维护,病毒,软件,硬件,常识.