<< Click to Display Table of Contents >>

SuperGIS Server JavaScript API

 

new sg.layers.MapImageLayer()

 

 

Description

建立一個MapImageLayer 物件。

 

Position

MapImageLayer.js

 

 

Properties

 

Properties

Type

Description

extent

sg.geometry.Extent

圖層範圍

images

sg.layers.MapImage

MapImage的陣列

loadError

Error

如果圖層載入失敗,此欄位有值

map

MapBase

圖層被加入的MapBase

maxScale

Number

可顯示的最大比例尺

minScale

Number

可顯示的最小比例尺

name

String

圖層名稱

node

DOMNODE

圖層html節點

opacity

Number

透明度,範圍0(透明)~1(不透明)

title

String

圖層標題

visible

Boolean

圖層是否可見

True: 可見
False: 不可見

 

 

 

Methods

 

Methods

Type

Description

addImage(image)

sg.layers.MapImage

將MapImage 加到圖層當中

getMap()

Returns:

MapBase

取得圖層所屬的地圖控制項。

Returns:

Type

Description

MapBase

圖層所屬的地圖控制項。

getName()

Returns:

String

取得圖層名稱

Returns:

Type

Description

String

圖層名稱

getNode()

Returns:

DOMNODE

取得圖層html節點

Returns:

Type

Description

DOMNODE

圖層html節點

getTitle()

Returns:

String

取得圖層標題

Returns:

Type

Description

String

圖層標題

getVisible()

Returns:

Boolean

取得圖層可見度

Returns:

Type

Description

Boolean

圖層可見度

True: 可見
False: 不可見

hide()


隱藏圖層

Initialize()


圖層被加入MapBase時所呼叫的初始化方法

putName(newVal)

String

設定圖層名稱

Name

Type

Description

newVal

String

圖層名稱

putTitle(newVal)

String

設定圖層標題

Name

Type

Description

newVal

String

圖層標題

putVisible(newVal)

Boolean

設定圖層可見度

Name

Type

Description

newVal

Boolean

圖層可見度

True: 可見
False: 不可見

RebuildElement()


重繪圖層

removeAllImages()


由圖層當中移除所有 MapImages

RemoveSelf()


移除圖層

setMaxScale(maxScale)

Number

設定圖層可見的最大比例尺

Name

Type

Description

maxScale

Number

最大比例尺

setMinScale(minScale)

Number

設定圖層可見的最小比例尺

Name

Type

Description

minScale

Number

最小比例尺

setOpacity(opacity)

Number

設定圖層透明度

Name

Type

Description

opacity

Number

圖層透明度0~1

0: 透明
1: 不透明

show()


顯示圖層

UpdateElement()


更新圖層

 

 

Events

 

Event

Description

load

當圖層讀取完成時觸發

 

Example

 

<script type="text/javascript" src="scripts/Layer.js"></script>

<script type="text/javascript" src="scripts/Geometry.js"></script>

 

//Create the extent of MapImage

var pmapExt = new sg.geometry.Extent(13277608.9807431, 2449664.06609527, 13640272.4782023, 2972946.29177018);

//Create the MapImage

var option = {

extent: pmapExt,

width:430,        //the width of this image

height:620,        //the height of this image

opacity:0.7,

href:"images/TaiwanHistoricMap.png" // the source of the imape. Could be a URL.

};

var MapImg = new sg.layers.MapImage(option);

 

 

 

See live example

 


©2015 Supergeo Technologies Inc.