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)
使用方法:
var myMap = new ("mapDiv", { extent: new
(-124.71, 31.89, -113.97, 42.63) });
(3)
(4)
(5)
(6)
单击Graphics就会出现InfoWindow,默认为:true
(7)
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


发布评论