<< Click to Display Table of Contents >>
new sg.layers.FeatureLayer()
Description
新增一個feature layer來展示SuperGIS Server發佈的圖徵服務
Position
FeatureLayer.js
Parameters
Parameter |
Type |
Description |
|||||||||
SuperGIS |
String |
Server服務網址 |
|||||||||
options |
Object |
設定物件
|
Constants
Constants |
Description |
MODE_ONDEMAND |
當FeatureLayer為ONDEMAND模式時,每次地圖範圍改變,如進行平移動作時,重新抓取範圍內的圖徵。 |
MODE_SELECTION |
當FeatureLayer為SELECTION模式時,只有被選取的Feature才會從Server抓取下來。 |
MODE_SNAPSHOT |
當FeatureLayer為SNAPSHOT模式時,會將FeatureService中所有的圖徵全部抓取下來。 |
SELECTION_ADD |
加入到現有的集合。 |
SELECTION_NEW |
建立新的集合。 |
SELECTION_SUBTRACT |
從集合中移除。 |
Properties
Properties |
Type |
Description |
extent |
sg.geometry.Extent |
圖層範圍 |
graphics |
Array.<sg.Graphic> |
Graphic的陣列 |
infoTemplate |
sg.InfoTemplate |
Graphic顯示在訊息視窗的訊息樣板 |
loadError |
Error |
如果圖層載入失敗,此欄位有值 |
map |
MapBase |
圖層被加入的MapBase |
maxScale |
Number |
可顯示的最大比例尺 |
minScale |
Number |
可顯示的最小比例尺 |
mode |
String |
FeatureLayer的模式 |
mouseEventEnabled |
Error |
是否啟用滑鼠事件 |
name |
String |
圖層名稱 |
fields |
String |
屬性欄位 ex: pointLayer.fields[5] |
node |
DOMNODE |
圖層html節點 |
opacity |
Number |
透明度 |
renderer |
sg.renderers.Render |
圖層的Renderer |
surface |
Object |
圖層的繪圖表面 |
svgContainer |
DOMNODE |
圖層的div |
title |
String |
圖層標題 |
visible |
Boolean |
圖層是否可見 True: 可見 |
Methods
Methods |
Type |
Description |
|||||||||||||||
add(graphic) |
sg.Graphic |
加入Graphic到GraphicsLayer
|
|||||||||||||||
clear() |
清除所有Graphic |
||||||||||||||||
clearSelection() |
Clear selection |
||||||||||||||||
disableMouseEvents() |
停用圖層中的所有滑鼠事件 |
||||||||||||||||
enableMouseEvents() |
啟用圖層中的所有滑鼠事件 |
||||||||||||||||
getMap() |
Returns: MapBase |
取得圖層所屬的地圖控制項。 Returns:
|
|||||||||||||||
getName() |
Returns: String |
取得圖層名稱 Returns:
|
|||||||||||||||
getNode() |
Returns: DOMNODE |
取得圖層html節點 Returns:
|
|||||||||||||||
getResource(index) |
index:Number Returns:String |
取得symbol icon
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 |
設定圖層可見度
|
|||||||||||||||
queryRelatedFeatures(index, query, callback, errBack) |
index:Number query:sg.tasks.RelationshipQuery callback:sg.tasks.QueryTask~queryCallback |
Get features related to this layer
|
|||||||||||||||
RebuildElement() |
重繪圖層 |
||||||||||||||||
redraw() |
重繪圖層 |
||||||||||||||||
remove(graphic) |
sg.Graphic |
移除指定Graphic
|
|||||||||||||||
RemoveSelf() |
移除圖層 |
||||||||||||||||
selectFeatures(query, method, callback, errCallback) |
query:sg.tasks.Query method: String callback: sg.layers.FeatureLayer~successCallback |
Select features
|
|||||||||||||||
setInfoTemplate(temp) |
sg.InfoTemplate |
設定訊息樣版
|
|||||||||||||||
setMaxScale(maxScale) |
Number |
設定圖層可見的最大比例尺
|
|||||||||||||||
setMinScale(minScale) |
Number |
設定圖層可見的最小比例尺
|
|||||||||||||||
setOpacity(opacity) |
Number |
設定圖層透明度
|
|||||||||||||||
setRenderer(renderer) |
sg.renderers.Renderer |
設定圖層Renderer
|
|||||||||||||||
setVisibility(newVal) |
Boolean |
設定圖層可見度
|
|||||||||||||||
show() |
顯示圖層 |
||||||||||||||||
UpdateElement() |
更新圖層 |
Type Definitions
Type Definition |
Type |
Description |
successCallback(results) |
Object |
執行成功時所觸發的方法
|
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上放開時引發 |
update-start |
當更新開始時引發 |
update-end |
當更新結束時引發 |
selection-complete |
當選取完成時引發 |
selection-clear |
當清除選取時引發 |
edits-complete |
當編輯完成時引發 |
Example
|
©2015 Supergeo Technologies Inc.