<< Click to Display Table of Contents >>
new sg.layers.GraphicsLayer()
Description
新增一個GraphicLayer 物件。
Position
GraphicLayer.js
Properties
Properties |
Type |
Description |
extent |
sg.geometry.Extent |
圖層範圍 |
graphics |
Array.<sg.Graphic> |
Graphic的陣列 |
infoTemplate |
sg.InfoTemplate |
Graphic顯示在訊息視窗的訊息樣版 |
loadError |
Error |
如果圖層載入失敗,此欄位有值 |
maxScale |
Number |
可顯示的最大比例尺 |
minScale |
Number |
可顯示的最小比例尺 |
mouseEventEnabled |
Boolean |
是否啟用滑鼠事件 |
name |
String |
圖層名稱 |
node |
DOMNODE |
圖層html節點 |
opacity |
Number |
透明度,範圍為0到1 |
renderer |
sg.renderers.Render |
圖層繪製定義 |
surface |
Object |
圖層的繪圖表面 |
svgContainer |
DOMNODE |
圖層的div |
title |
String |
圖層標題 |
visible |
Boolean |
圖層是否可見 True: 可見 |
Methods
Methods |
Type |
Description |
||||||||||
add(graphic) |
sg.Graphic |
加入Graphic到GraphicsLayer
|
||||||||||
clear() |
清除所有Graphic |
|||||||||||
disableMouseEvents() |
停用圖層中的所有滑鼠事件 |
|||||||||||
enableMouseEvents() |
啟用圖層中的所有滑鼠事件 |
|||||||||||
getMap() |
Returns: MapBase |
取得圖層所屬的地圖控制項。 Returns:
|
||||||||||
getName() |
Returns: String |
取得圖層名稱 Returns:
|
||||||||||
getNode() |
Returns: DOMNODE |
取得圖層html節點 Returns:
|
||||||||||
getTitle() |
Returns: String |
取得圖層標題 Returns:
|
||||||||||
getVisible() |
Returns: Boolean |
取得圖層可見度 Returns:
|
||||||||||
hide() |
隱藏圖層 |
|||||||||||
Initialize() |
圖層被加入MapBase時所呼叫的初始化方法 |
|||||||||||
isVisibleAtScale(scale) |
scale:number Returns:Boolean |
計算圖層在指定比例尺下是否可見
Returns:
|
||||||||||
putName(newVal) |
String |
設定圖層名稱
|
||||||||||
putTitle(newVal) |
String |
設定圖層標題
|
||||||||||
putVisible(newVal) |
Boolean |
設定圖層可見度
|
||||||||||
RebuildElement() |
重繪圖層 |
|||||||||||
redraw() |
重繪圖層 |
|||||||||||
remove(graphic) |
sg.Graphic |
移除指定Graphic
|
||||||||||
RemoveSelf() |
移除圖層 |
|||||||||||
setInfoTemplate(temp) |
sg.InfoTemplate |
設定訊息樣版
|
||||||||||
setMaxScale(maxScale) |
Number |
設定圖層可見的最大比例尺
|
||||||||||
setMinScale(minScale) |
Number |
設定圖層可見的最小比例尺
|
||||||||||
setOpacity(opacity) |
Number |
設定圖層透明度
|
||||||||||
setRenderer(renderer) |
sg.renderers.Renderer |
設定圖層Renderer
|
||||||||||
setVisibility(newVal) |
Boolean |
設定圖層可見度
|
||||||||||
show() |
顯示圖層 |
|||||||||||
UpdateElement() |
更新圖層 |
Events
Event |
Description |
click |
當滑鼠點擊Graphic時引發 |
dbl-click |
當滑鼠雙擊Graphic時引發 |
graphic-add |
當Graphic被加入時引發 |
graphic-clear |
當所有Graphic被清除時引發 |
graphic-remove |
當Graphic被移除時引發 |
load |
當圖層讀取完成時觸發 |
mouse-down |
當滑鼠在Graphic上按下時引發 |
mouse-move |
當滑鼠在Graphic上移動時引發 |
mouse-out |
當滑鼠離開Graphic時引發 |
mouse-over |
當滑鼠移入Graphic時引發 |
mouse-up |
當滑鼠在Graphic上放開時引發 |
Example
|
©2015 Supergeo Technologies Inc.