<< Click to Display Table of Contents >>

 

MapBase (pParentElem, pTrans, locX, locY, locWidth, locHeight)

 

 

Description

The main map object is the main function of Ultra version map webpage and it manages all building, displaying, updating, and destruction of map element.

 

Position

MapBase.js

 

 

Parameters

 

Parameter

Description

pParentElem

The webpage DOM Container Object in which the map is built, is usually div elementbut it can be span or other similar container objects as well.

pTrans

To set to use ScaleTransformation or CachedLevelTransformation object.

locX

The map is located on the upper left corner of the container object and the unit is pixel or percentage.

locY

The map is located on the upper left corner of container object and the unit is pixel or percentage.

IocWidth

The unit of the width of map in container object is pixel or percentage.

locHeight

The unit of the height of map in container object is pixel or percentage.

 

 

Properties

 

Property

Description

none

none

 

 

Methods

 

Method

Description

FinalRelease()

The destruction function of main map object,  it calls FinalRelease to release the built map and its map element.

getHObject()

To get the map DOM object for displaying the geometry objects, like displaying the polygon object of polygon selection and the geometry object of selection result.

getHPackage()

To get the map container object for placing other info dialogs, like query result dialog and overview dialog, etc.

getClientWidth()

To get the visible width of map and the unit is pixel.

getClientHeight()

To get the visible height of map and the unit is pixel.

getCenterX()

To get the X coordinate of map center point.

putCenterX(newVal)

To set the X coordinate of map center point.

getCenterY()

To get the Y coordinate of map center point.

putCenterY(newVal)

To set the Y coordinate of map center point.

getScale()

To get the map scale.

putScale(newVal)

To set the map scale.

getCellSizeX()

To get the real map size of one single pixel  on the screen. (X direction)

getCellSizeY()

To get the real map size of one single pixel  on the screen. (Y direction)

MoveMapTo(centerX, centerY)

To set the map coordinate of map center.

ZoomMapTo(pEnvelope)

To zoom the map to the extent of pEnvelope variable.

getCursorPosition(tEvent)

To get the current position of mouse cursor.

ToMapPoint(dX, dY)

To convert the screen coordinate of visible map to corresponding map coordinate.

FromMapPoint(dX, dY)

To convert the map coordinate of visible map to corresponding screen coordinate.

ToMapDistX(dX)

To convert the distance of screen coordinate to that of map coordinate. (X direction)

ToMapDistY(dY)

To convert the distance of screen coordinate to that of map coordinate. (Y direction)

FromMapDistX(dX)

To convert the distance of map coordinate to that of screen coordinate. (X direction)

FromMapDistY(dY)

To convert the distance of map coordinate to that of screen coordinate. (Y direction)

SelectMapTool(pMapEvent)

To set the current tool to use on the map. To end the current tool and initialize the assigned tool.

getLayers()

To get the sub-layer array of service layer.

AddLayer(pElem)

To add layer to the map.

RemoveLayer(pLayer)

To remove the assigned layer.

RemoveAllLayers()

To remove all layers.

getElements(nIndex)

To get the map element array.

AddElement(pElem)

To add a new map element to the map element array.

RemoveElement(pElem)

To remove a map element from map element array.

RemoveAllElements()

To remove all elements.

getExtent()

To get the map extent.

RefreshMap(bClearAll)

To refresh the map.

MoveToAnimation(MapPT, MapScale, pFinalFunc)

To move the map to the assigned map coordinate in certain scale with animation style, and call pFinalFunc when the move is finished. pFinalFunc is the function object.

 

 

Events

 

Event

Description

load

載入地圖時觸發

layer-add

加入Layer時觸發

layer-remove

移除單一Layer時觸發

layers-removed

同時移除多個Layer時觸發

mousedown

按下滑鼠時觸發

mouseup

放開滑鼠時觸發

mouseover

滑鼠移過時觸發

dblclick

連續點擊滑鼠時觸發

drag-start

開始拖曳地圖時觸發

drag

拖曳地圖時觸發

drag-end

拖曳地圖結束時觸發

angle-changed

地圖角度改變時(地圖被旋轉時)觸發

zoom-start

開始縮放地圖時觸發

zoom-end

縮放地圖結束時觸發

zoom

縮放地圖中觸發

 


©2015 Supergeo Technologies Inc.