Properties |
Type |
Description |
zoom |
number |
Map zoom level. Default zoom level is 1. |
center |
LngLat |
Map center position (in geo). |
draggable |
boolean |
Enable / disable dragging of the map. Enable by default. |
enableDefaultLogo |
boolean |
Enable / disable default SD.com logo on the map. Enable by default. |
showCopyright |
boolean |
Enable / disable default copyright text on the map. Enable by default. |
resize |
WidthHeight |
Resize size of the map in specific width and height. |
size |
WidthHeight |
Map size (in pixels). |
viewport |
object |
Instance of ViewportControl. |
viewportInfo |
object |
Instance of viewportInfo, detail information of map can be access from here. |
canvasInfo |
object |
Clone of viewportInfo, detail information of map can be access from here. |
infoWindow |
object |
Instance of SD.genmap.GInfoWindow. |
Methods |
Return Value |
Description |
refresh () |
none |
Rendering map and all layers. |
setDragging (boolean) |
none |
Enable / disable dragging of the map. |
fromLatLngToContainerPixel (geo) |
pixels |
Computes the pixel coordinates of the given geographical point. |
fromContainerPixelToLatLng (pixels) |
LngLat |
Computes the geographical coordinates of the given pixel point. |
setZoom (zoom, refresh) |
none |
Set zoom level of the map. |
getDom () |
dom |
Get dom information. |
setCenter (geo, zoom) |
none |
Set center position and zoom level of the map. |
getCenter () |
LngLat |
Get center of the map (in geo). |
setInfoWindow (info) |
none |
Set infoWindow. |
panBy (x, y) |
none |
Change the center of the map by the given distance in pixels.
If the change is less than both the width and height of the map, the transitions will be smoothly animated. |
panTo (geo) |
none |
Change the center of the map by the given distance in geo.
If the change is less than both the width and height of the map, the transitions will be smoothly animated. |
resizeViewport (width, height) |
none |
Resize size of the map in pixels. |
getBounds () |
LngLatBounds |
Get the LngLat bounds of the current viewpoint.
If the map is not initialized yet the result is false. |
addControl (navigation) |
none |
Add control to the map. A control instance must not be added more than once to the map.
Available navigation: MediumMapControl(), CompleteMapControl(), and DrawingMapControl().
|
addLogo (pathImg, size, position, targetUrl) |
none |
Add logo on the map. |
Properties |
Type |
Description |
map |
dom |
Map which to display the marker. |
icon |
object |
Instance of SD.genmap.MarkerImage, class for handle object image. |
position |
LngLat / vertex |
Position of the marker (can be in geo / vertex). |
positionPt |
Pixels |
Position of the marker (in pixels). |
projection |
string |
Projection of MarkerStatic. |
draggable |
boolean |
Enable / disable dragging of the marker. |
visible |
boolean |
The marker status (show / hide). |
hideOnLevel |
array |
Hide marker on the given level. |
zIndex |
number |
Set level of z-index of the marker. |
div |
dom |
Dom information about div marker. |
title |
string |
If marker title isn't set in MarkerImage, then use this title. |
enable |
boolean |
The marker status (enable / disable). |
Methods |
Return Value |
Description |
replaceIcon (icon) |
none |
Replace old icon with new one. |
getDom () |
dom |
Get dom object of MarkerStatic. |
getPtPosition () |
pixels |
Get position of MarkerStatic in pixels. |
getSize () |
pixels |
Get size of the MarkerStatic. |
updatePosition (ViewportInfo) |
none |
Update position of MarkerStatic. |
setPosition (position) |
none |
Set position of the MarkerStatic, can be in geo or vertex. |
setOffset (offset, scale) |
none |
Set offset, so this offset will calculated with current position. |
draw (ViewportInfo) |
none |
Draw MarketStatic. |
setEnable (condition) |
boolean |
Enable / disable this StaticMarker. |
setDisplay (condition) |
boolean |
Show / hide the StaticMarker. |
Properties |
Type |
Description |
div |
dom |
Dom information about div viewportInfo. |
scale |
number |
Ratio of a distance on the map to the corresponding distance on the ground. |
levelIndex |
number |
Map zoom level. |
lastCursorLatLon |
LngLat |
Last position of cursor (in geo). |
lastCursorPosDown |
pixels |
Last position of cursor when mouse down (in pixels). |
lastCursorPosUp |
pixels |
Position of cursor when mouse up (in pixels). |
lastCursorPosMove |
pixels |
Position of cursor when mouse move (in pixels). |
lastCursorPosOffset |
number |
Offset position of cursor. |
projection |
object |
Instance of projection, detail information of projection can be access from here. |
canvasSize |
WidthHeight |
Canvas size. |
centerGeo |
LngLat |
Center of map (in geo). |
centerMetric |
meter |
Center of map (in meter). |
centerScreen |
pixels |
Center of map (in pixels). |
topLeftGeo |
LngLat |
Top Left map position (in geo). |
topLeftMetric |
meter |
Top Left map position (in meter). |
topLeftScreen |
pixels |
Top Left map position (in pixels). |
screenView |
pixels |
Map rectangle information (in pixels). |
metricView |
meter |
Map rectangle information (in meter). |
geoView |
geo |
Map rectangle information (in geo). |
Methods |
Return Value |
Description |
recalculate () |
none |
Recalculate all viewport. |
getCanvasRect () |
pixels |
Get canvas rectangular position. |
getCanvasSize () |
WidthHeight |
Get canvas size. |
viewportScreenToGeo (x,y) |
LngLat |
Convert from screen viewport to geo. |
viewportGeoToScreen (geo) |
pixels |
Convert from geo viewport to screen. |
viewportScreenToMetric (x,y) |
meter |
Convert from screen viewport to vertex. |
canvasGeoToScreen (geo) |
pixels |
Convert from geo viewport to canvas. |
setCenterFromViewportScreenPosition (x, y) |
none |
Set center from viewport screen position. |
viewportScale (param) |
number |
If param set, than set viewport scale. If not, return viewport current scale. |
setCenter (offsetX, offsetY) |
none |
Set viewport center. |
getMetricPosDown () |
meter |
Get vertex position. |
getMetricPosMove () |
meter |
Get vertex position. |
Methods |
Return Value |
Description |
radToDeg (ang) |
number |
Convert from rad to deg. |
degToRad (ang) |
number |
Convert from deg to rad. |
mercX (lon) |
number |
Conver from lon to mercantor x. |
unMercX (x) |
lon |
Conver from mercantor x to lon. |
geoToMetric (longitude, latitude) |
vertex |
Convert from geo to mercantor. |
metricToGeo (x, y) |
geo |
Convert from mercantor to geo. |
unMercY (y) |
lat |
Convert from mercantor y to lat. |
mercY (lat) |
vertex |
Convert from lat to mercator y. |
geoToScreen (lon, lat, scale, topLeft) |
pixels |
Conver from geo to screen. |
screenToGeo (x, y, scale, topLeft) |
geo |
Convert from screen to geo. |
metricToScreen (x, y, scale, topLeft) |
pixels |
Convert from vertex to screen. |
screenToMetric (x, y, scale, topLeft) |
vertex |
Convert from screen to vertex. |
geoToPixel (lon, lat, scale) |
pixels |
Convert from geo to pixels. |
pixelToGeo (x, y, scale) |
LngLat |
Convert from pixels to geo. |
inflateGeo (centerGeo, x, y, scale) |
|
|
inflateVert (center, x, y, scale) |
|
|
metricToPixel (x, y, scale) |
pixels |
Convert from vertex to pixels. |
pixelToMetric (x, y, scale) |
vertex |
Convert from pixels to vertex. |
Properties |
Type |
Description |
arrowOption |
object |
Polyline / polygon arrowOption. |
color |
color code |
Polyline / polygon arrow color. |
size |
number |
Polyline / polygon arrow size. |
bgColor |
color code |
Polyline / polygon background color. |
boundGeo |
bounds |
Polyline / polygon bounds in geo. |
boundMetric |
bounds |
Polyline / polygon bounds in metric. |
boundScreen |
bounds |
Polyline / polygon bounds in pixel. |
bounds |
bounds |
Polyline / polygon bounds. |
centerGeo |
LngLat |
Polyline / polygon center position in geo. |
centerMetric |
metric |
Polyline / polygon center position in metric. |
color |
color code |
Polyline / polygon color. |
div |
dom |
Polyline / polygon dom. |
enable |
boolean |
Polyline / polygon enable status. |
fillOpacity |
number |
Polyline / polygon opacity. |
hideOnLevel |
array |
Polyline / polygon hide on level. |
index |
number |
Polyline / polygon index. |
points |
list point |
Polyline / polygon point list. |
scale |
number |
Polyline / polygon scale. |
size |
number |
Polyline / polygon line size. |