new sg.layers.MapImage()
Description
建立一個MapImage 物件。
Position
MapImage.js
Parameters
Parameter
|
Type
|
Description
|
param
|
Object
|
初始化設定
set object
Name
|
Type
|
Description
|
width
|
Number
|
圖片寬度(pixel)
|
height
|
Number
|
圖片高度(pixel)
|
extent
|
sg.geometry.Extent
|
圖片範圍
|
href
|
String
|
圖片的URL
|
opacity
|
Number
|
圖片透明度,範圍為0到1
0:透明
1:不透明
|
|
Properties
Properties
|
Type
|
Description
|
extent
|
sg.geometry.Extent
|
圖片範圍
|
height
|
Number
|
圖片高度(pixel)
|
herf
|
String
|
圖片的URL
|
width
|
Number
|
圖片寬度(pixel)
|
opacity
|
Number
|
圖片透明度,範圍為0到1
0:透明
1:不透明
|
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.