SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the main class of the mapsuite javascript API.
Constructor Summary | |
IWMap(mapContainer)
Creates a new map in the container element with the specified id. |
Method Summary | |
void
|
addLayer(layer)
Adds a new layer or group of layers to the map. |
void
|
addWindowOverlay(windowOverlay)
Adds a new window overlay in front of the map. |
void
|
changeStyle(style)
Changes the style of the current mapType. |
void
|
createPrintMap()
Creates the print image for the visible map area. |
|
getBackdrop()
undocumented |
IWBounds
|
getBounds()
Returns the coordinate bounds of the currently visible part of the map. |
number
|
getBoundsZoomlevel(bounds)
Returns the minimum zoom level at which the specified coordinate bounds fit in the map. |
IWCoordinate
|
getCenter()
Returns the center coordinate of the map. |
HTMLDivElement
|
getClippingContainer()
Returns the clipping container of the map. |
HTMLDivElement
|
getContainer()
Returns the map container. |
HTMLDivElement
|
getControlContainer()
Returns the map container for the controls. |
IWCopyrightControl
|
getCopyrightControl()
Returns the copyright control for this map. |
IWMapType
|
getCurrentMapType()
Returns the current map type. |
HTMLDivElement
|
getDrawingContainer()
Returns the drawing container for SVG and VML. |
IWLayerInterface
|
getLayerByLayerName(layerName)
Returns a layer by its layer name. Example: If you have created a layer like this:
you can obtain it by map.getLayerByName('ROUTE')
|
IWLayerInterface
|
getLayerByTitle(title)
Returns a layer by its title. Example: If you have created a layer like this:
you can obtain it by map.getLayerByName('My Route')
|
IWLayerInfoManager
|
getLayerInfoManager()
Returns the layer info manager for the map. |
IWLayerInterface[]
|
getLayers()
Returns all layers. |
IWLayoutManager
|
getLayoutManager()
Returns the layout manager for the map. |
number
|
getMapHeightInMeter()
Returns the height of the visible map area in meter. |
number
|
getMapWidthInMeter()
Returns the width of the visible map area in meter. |
number
|
getMeterPerPixel()
Returns the meter per pixel. |
IWMapOptions
|
getOptions()
Returns the options used by this map. |
HTMLDivElement
|
getOverlayContainer()
Returns the map container for the overlays. |
IWOverlayManager
|
getOverlayManager()
Returns the overlay manager for the map. |
|
getSerialId()
undocumented |
String
|
getSessionId()
Returns the id for the current session. |
HTMLDivElement
|
getTilesContainer()
Returns the tile container for the map tiles. |
HTMLDivElement
|
getWindowOverlayContainer()
Returns the WindowOverlay container of the map. |
IWWindowOverlayManager
|
getWindowOverlayManager()
Returns the WindowOverlayManager |
number
|
getZoom()
Returns the current zoom level. |
number
|
getZoomByMeter(meter, mapType)
Returns the optimal zoomlevel by meter. |
HTMLDivElement
|
getZoomingAndDraggingContainer()
Returns the ZoomingAndDragging container of the map. |
void
|
openInfoBalloon(coordinate, content)
Opens a new infoballoon at the specified coordinate on the map. |
IWWindowOverlay
|
openTooltip(coordinate, text, properties)
Opens a new IWTooltip at the specified coordinate on the map.
|
void
|
panBy(offset, undoable)
Moves the map by the specified offset in pixels. If the target coordinate is already visible the map is moved in a smooth animation. |
void
|
panTo(coordinate, undoable)
Moves the map to the specified coordinate. If the target coordinate is already visible the map is moved in a smooth animation; otherwise the result is the same as from a call to {@link #setCenter} without the optional parameters. |
|
readObject(json)
undocumented |
void
|
redo()
If the last user action was a call to {@link #undo} the effect is cancelled; otherwise nothing is done. |
void
|
redraw()
Redraws the layers on the map. |
|
refreshTiles()
undocumented |
void
|
removeInfoBalloon()
Removes the infoballoon from the map. |
void
|
removeLayer(layer)
Removes the layer from the map. |
IWLayerInterface
|
removeLayerByName(layerName)
Removes the layer from the map by its name. |
void
|
removeTooltip()
Removes the IWTooltip from the map.
|
void
|
removeWindowOverlay(windowOverlay)
Removes the window overlay from the map. |
void
|
returnToSavedPosition()
Restores the last saved map view. |
void
|
savePosition()
Saves the current map view (the map position and zoom level). |
void
|
setCenter(coordinate, zoom, mapType)
Sets the map center to the specified coordinate. |
void
|
setRemovalStrategy(strategy)
Sets a removal strategy. |
|
simulateClick(event)
undocumented |
String
|
toString()
Returns a string prepresentation of this map. |
|
triggerOnMapStyleChange(event)
The onmapstylechange event is fired when the style of current maptype is changed. Register an event listener with IWEventManager.addListener(yourMapObject, 'onmapstylechange', yourHandlerMethod(event)); to receive the event. |
void
|
undo()
Reverts the effect of the last user action if there is one on the stack. |
|
writeObject()
undocumented |
boolean
|
zoom(level, center, adjustToCenter, animation)
Zooms the map to the specified level and screen position. There are two zoom modes which can be toggled by adjustToCenter. adjustToCenter is true the map center after zooming is the coordinate at the center parameter. This is used for double click actions in the map to center the map on this position. If adjustToCenter is false the coordinate at the center parameter stays on the same screen position. This behavior is used for mouse wheel zooming: A city at the mouse position is still at the mouse position after zooming. |
boolean
|
zoomIn(undoable)
Zooms in a level unless the map is on the highest zoom level. |
boolean
|
zoomOut(undoable)
Zooms out a level unless the map is on the lowest zoom level. |
Event Summary | |
void
|
dblclick(event)
The ondblclick event is fired when the user double clicks with the mouse. Register an event listener with IWEventManager.addListener(yourMapObject, 'ondblclick', yourHandlerMethod(event)); to receive the IWMouseEvent. |
void
|
triggerOnAddLayer(event)
The addlayer event is fired when a layer is added to the map. The event has a single property named layer (containing the IWLayerInterface object). Register an event listener with IWEventManager.addListener(yourMap, 'onaddlayer', yourHandlerMethod(event)); to receive this event. |
void
|
triggerOnCenter(event)
The onCenter event is fired after the map has been centered. Register an event listener with IWEventManager.addListener(yourMapObject, 'oncenter', yourHandlerMethod(event)); to receive the IWMapCenterEvent. |
void
|
triggerOnClick(event)
The onclick event is fired when the mouse button is clicked. Register an event listener with IWEventManager.addListener(yourMapObject, 'onclick', yourHandlerMethod(event)); to receive the IWMouseEvent. |
void
|
triggerOnCopyrightChange(event)
The onCopyrightChange event is fired after the copyright text has been changed.
Register an event listener with
|
void
|
triggerOnInitialize(event)
The initialize event is fired when the map has been loaded the first time. Register an event listener with IWEventManager.addListener(yourMapObject, 'oninitialize', yourHandlerMethod(event)); to receive the event. |
void
|
triggerOnLanguageChange(event)
The onLanguageChange event is fired after the language has been changed. Register an event listener with IWEventManager.addListener(yourMapObject, 'onlanguagechange', yourHandlerMethod(event)); to receive the IWLanguageChangeEvent. |
void
|
triggerOnMapControlChange(event)
The onMapControlChange event is fired after the map control has been changed. Register an event listener with IWEventManager.addListener(yourMapObject, 'onmapcontrolchange', yourHandlerMethod(event)); to receive the IWMapControlChangeEvent. |
void
|
triggerOnMapTypeAvailabilityChange(event)
The onMapTypeAvailabilityChange event is fired after the availability of a map type has been changed. Register an event listener with IWEventManager.addListener(yourMapObject, 'onmaptypeavailabilitychange', yourHandlerMethod(event)); to receive the IWMapTypesChangeEvent. |
void
|
triggerOnMapTypeChange(event)
The onMapTypeChange event is fired after the map type has been changed. Register an event listener with IWEventManager.addListener(yourMapObject, 'onmaptypechange', yourHandlerMethod(event)); to receive the IWMapTypeChangeEvent. |
void
|
triggerOnMapTypeChangeStart(event)
The onMapTypeChangeStart event is fired before the map type changed. Register an event listener with IWEventManager.addListener(yourMapObject, 'onmaptypechangestart', yourHandlerMethod(event)); to receive the IWMapTypeChangeEvent. |
void
|
triggerOnMapTypesChange(event)
The onMapTypesChange event is fired after the map types have been changed. Register an event listener with IWEventManager.addListener(yourMapObject, 'onmaptypeschange', yourHandlerMethod(event)); to receive the IWMapTypesChangeEvent. |
void
|
triggerOnMouseDown(event)
The onMouseDown event is fired when the mouse button is pressed. Register an event listener with IWEventManager.addListener(yourMapObject, 'onmousedown', yourHandlerMethod(event)); to receive the IWMouseEvent. |
void
|
triggerOnMouseStop(event)
The onMouseStop event is fired when the mouse has been stopped. Register an event listener with IWEventManager.addListener(yourMapObject, 'onmousestop', yourHandlerMethod(event)); to receive the IWMouseEvent. |
void
|
triggerOnMouseUp(event)
The onMouseUp event is fired when the mouse button is released. Register an event listener with IWEventManager.addListener(yourMapObject, 'onmouseup', yourHandlerMethod(event)); to receive the IWMouseEvent. |
void
|
triggerOnMove(event)
The onMove event is continuously fired while the map is moved around. Register an event listener with IWEventManager.addListener(yourMapObject, 'onmove', yourHandlerMethod(event)); to receive the IWMoveEvent. |
void
|
triggerOnMoveEnd(event)
The onMoveEnd event is fired when the map has been moved. Register an event listener with IWEventManager.addListener(yourMapObject, 'onmoveend', yourHandlerMethod(event)); to receive the IWMoveEvent. |
void
|
triggerOnMoveStart(event)
The onMoveStart event is fired before the map is moved. Register an event listener with IWEventManager.addListener(yourMapObject, 'onmovestart', yourHandlerMethod(event)); to receive the event object. |
void
|
triggerOnOverlayInvisible()
The onoverlayinvisible event is fired when the overlays are not rendered because of e.g. Register an event listener with IWEventManager.addListener(yourMap, 'onoverlayinvisible', yourHandlerMethod(event)); to receive this event. |
void
|
triggerOnOverlayVisible()
The onoverlayvisible event is fired when the overlays are rendered visible because there is a valid projection and no optical zoom in progress. Register an event listener with IWEventManager.addListener(yourMap, 'onoverlayvisible', yourHandlerMethod(event)); to receive this event. |
void
|
triggerOnProjectionInitialize(event)
The onProjectionInitialize event is fired after the projection for the current map type has been initialized. Register an event listener with IWEventManager.addListener(yourMapObject, 'onprojectioninitialize', yourHandlerMethod(event)); to receive this event. |
void
|
triggerOnProjectionInvalid()
The onProjectionInvalid event is fired before the projection for the current map type is loaded. Register an event listener with IWEventManager.addListener(yourMapObject, 'onprojectioninvalid', yourHandlerMethod(event)); to receive this event. |
void
|
triggerOnRemoveLayer(event)
The removelayer event is fired when a layer is removed from the map. The event has a single property named layer (containing the IWLayerInterface object). Register an event listener with IWEventManager.addListener(yourMap, 'onremovelayer', yourHandlerMethod(event)); to receive this event. |
void
|
triggerOnResize(event)
The onResize event is fired after the map has been resized. Register an event listener with IWEventManager.addListener(yourMapObject, 'onresize', yourHandlerMethod(event)); to receive this event. |
void
|
triggerOnZoom(event)
The onZoom event is fired after the new zoomlevel has been calculated. Register an event listener with IWEventManager.addListener(yourMapObject, 'onzoom', yourHandlerMethod(event)); to receive the IWZoomEvent. |
void
|
triggerOnZoomEnd(event)
The onZoomEnd event is fired after the map has been zoomed. Register an event listener with IWEventManager.addListener(yourMapObject, 'onzoomend', yourHandlerMethod(event)); to receive the IWZoomEvent. |
void
|
triggerOnZoomStart()
The onZoomStart event is fired before the map is zoomed. Register an event listener with IWEventManager.addListener(yourMapObject, 'onzoomstart', yourHandlerMethod(event)); to receive the IWZoomEvent. |
Constructor Detail |
IWMap(mapContainer)
HTMLDivElement mapContainer
- the div element to be used as parent for the map
Method Detail |
void addLayer(layer)
IWLayerInterface layer
- (e.g. IWLayer
or IWLayerGroup
)
void
void addWindowOverlay(windowOverlay)
IWWindowOverlay windowOverlay
- the window overlay
void
void changeStyle(style)
String style
- one of IWMapType constants (IWMapType.STYLE_XXX)
void
void createPrintMap()
void
getBackdrop()
IWBounds getBounds()
IWBounds
number getBoundsZoomlevel(bounds)
IWBounds bounds
- a section of the visible map area
number
IWCoordinate getCenter()
IWCoordinate
HTMLDivElement getClippingContainer()
HTMLDivElement
the clipping container.
HTMLDivElement getContainer()
HTMLDivElement
HTMLDivElement getControlContainer()
HTMLDivElement
the control container.
IWCopyrightControl getCopyrightControl()
IWCopyrightControl
IWMapType getCurrentMapType()
IWMapType
HTMLDivElement getDrawingContainer()
HTMLDivElement
IWLayerInterface getLayerByLayerName(layerName)
var layer = new IWLayer(map, 'My Route', 'ROUTE');
map.addLayer(layer);
you can obtain it by map.getLayerByName('ROUTE')
layerName
IWLayerInterface
IWLayerInterface getLayerByTitle(title)
var layer = new IWLayer(map, 'My Route', 'ROUTE');
map.addLayer(layer);
you can obtain it by map.getLayerByName('My Route')
title
IWLayerInterface
IWLayerInfoManager getLayerInfoManager()
IWLayerInfoManager
IWLayerInterface[] getLayers()
IWLayerInterface[]
IWLayoutManager getLayoutManager()
IWLayoutManager
number getMapHeightInMeter()
number
number getMapWidthInMeter()
number
number getMeterPerPixel()
number
IWMapOptions getOptions()
IWMapOptions
HTMLDivElement getOverlayContainer()
HTMLDivElement
the overlay container.
IWOverlayManager getOverlayManager()
IWOverlayManager
getSerialId()
String getSessionId()
String
the session id
HTMLDivElement getTilesContainer()
HTMLDivElement
the tile container
HTMLDivElement getWindowOverlayContainer()
HTMLDivElement
the WindowOverlay container.
IWWindowOverlayManager getWindowOverlayManager()
IWWindowOverlayManager
number getZoom()
number
number getZoomByMeter(meter, mapType)
number meter
IWMapType mapType
- a map type (optional, default is the current map type)
number
the zoomlevel
HTMLDivElement getZoomingAndDraggingContainer()
HTMLDivElement
the ZoomingAndDragging container.
void openInfoBalloon(coordinate, content)
IWCoordinate coordinate
- the coordinate of the infoballoon
Object content
- the content of the infoballoon
void
IWWindowOverlay openTooltip(coordinate, text, properties)
IWTooltip
at the specified coordinate on the map.
IWCoordinate coordinate
String text
Object properties
- properties for this tooltip, so far only duration (in ms)
IWWindowOverlay
the tooltip
void panBy(offset, undoable)
IWPoint offset
- the offset in pixels
boolean undoable
- true, if this action should be undoable, otherwise false.
void
void panTo(coordinate, undoable)
IWCoordinate coordinate
- the new center
boolean undoable
- true, if this action should be undoable, otherwise false.
void
readObject(json)
json
void redo()
void
void redraw()
void
refreshTiles()
void removeInfoBalloon()
void
void removeLayer(layer)
IWLayerInterface layer
- (e.g. IWLayer
or IWLayerGroup
)
void
IWLayerInterface removeLayerByName(layerName)
String layerName
IWLayerInterface
layer (e.g. IWLayer
or IWLayerGroup
)
void removeTooltip()
IWTooltip
from the map.
void
void removeWindowOverlay(windowOverlay)
IWWindowOverlay windowOverlay
- the window overlay
void
void returnToSavedPosition()
void
void savePosition()
void
void setCenter(coordinate, zoom, mapType)
IWCoordinate coordinate
- the new map center
number zoom
- the new zoom level (optional)
IWMapType mapType
- a map type (optional)
void
void setRemovalStrategy(strategy)
IWTilesRemovalStrategy strategy
void
simulateClick(event)
event
String toString()
String
triggerOnMapStyleChange(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onmapstylechange', yourHandlerMethod(event)); to receive the event.
event
void undo()
void
writeObject()
boolean zoom(level, center, adjustToCenter, animation)
number level
- the new zoom level
IWPoint center
- the zoom center (optional, defaults to the center of the screen)
boolean adjustToCenter
- the zoom mode as described above
boolean animation
- true to animate the zoom effect (e.g. double click), false to skip the animation (e.g. slider step)
boolean
false if the map cannot be zoomed (because the level is not available), true otherwise (optional, defaults to false)
boolean zoomIn(undoable)
boolean undoable
- true or empty, if this action should be undoable, otherwise false.
boolean
true
if zoom was successful, else false
.
boolean zoomOut(undoable)
boolean undoable
- true or empty, if this action should be undoable, otherwise false.
boolean
true
if zoom was successful, else false
.
Event Detail |
void dblclick(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'ondblclick', yourHandlerMethod(event)); to receive the IWMouseEvent.
IWMouseEvent event
- the mouse event
void
void triggerOnAddLayer(event)
The event has a single property named layer (containing the IWLayerInterface object).
Register an event listener with IWEventManager.addListener(yourMap, 'onaddlayer', yourHandlerMethod(event)); to receive this event.
event
void
void triggerOnCenter(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'oncenter', yourHandlerMethod(event)); to receive the IWMapCenterEvent.
IWMapCenterEvent event
- the map centered event
void
void triggerOnClick(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onclick', yourHandlerMethod(event)); to receive the IWMouseEvent.
IWMouseEvent event
- the mouse event
void
void triggerOnCopyrightChange(event)
Register an event listener with
IWEventManager.addListener(yourMapObject, 'oncopyrightchange', yourHandlerMethod(event));
to
receive the IWCoyprightChangedEvent
.
IWCopyrightChangeEvent event
- the event
void
void triggerOnInitialize(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'oninitialize', yourHandlerMethod(event)); to receive the event.
object event
- the map initialized event
void
void triggerOnLanguageChange(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onlanguagechange', yourHandlerMethod(event)); to receive the IWLanguageChangeEvent.
IWLanguageChangeEvent event
- the event
void
void triggerOnMapControlChange(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onmapcontrolchange', yourHandlerMethod(event)); to receive the IWMapControlChangeEvent.
IWMapControlChangeEvent event
- the event
void
void triggerOnMapTypeAvailabilityChange(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onmaptypeavailabilitychange', yourHandlerMethod(event)); to receive the IWMapTypesChangeEvent.
IWMapTypeAvailabilityChangeEvent event
- the event
void
void triggerOnMapTypeChange(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onmaptypechange', yourHandlerMethod(event)); to receive the IWMapTypeChangeEvent.
IWMapTypeChangeEvent event
- the event
void
void triggerOnMapTypeChangeStart(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onmaptypechangestart', yourHandlerMethod(event)); to receive the IWMapTypeChangeEvent.
IWMapTypeChangeEvent event
- the event
void
void triggerOnMapTypesChange(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onmaptypeschange', yourHandlerMethod(event)); to receive the IWMapTypesChangeEvent.
IWMapTypesChangeEvent event
- the event
void
void triggerOnMouseDown(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onmousedown', yourHandlerMethod(event)); to receive the IWMouseEvent.
IWMouseEvent event
- the mouse event
void
void triggerOnMouseStop(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onmousestop', yourHandlerMethod(event)); to receive the IWMouseEvent.
IWMouseEvent event
- the mouse event
void
void triggerOnMouseUp(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onmouseup', yourHandlerMethod(event)); to receive the IWMouseEvent.
IWMouseEvent event
- the mouse event
void
void triggerOnMove(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onmove', yourHandlerMethod(event)); to receive the IWMoveEvent.
IWMoveEvent event
- the move event
void
void triggerOnMoveEnd(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onmoveend', yourHandlerMethod(event)); to receive the IWMoveEvent.
IWMoveEvent event
- the move event
void
void triggerOnMoveStart(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onmovestart', yourHandlerMethod(event)); to receive the event object.
object event
- the move event
void
void triggerOnOverlayInvisible()
Register an event listener with IWEventManager.addListener(yourMap, 'onoverlayinvisible', yourHandlerMethod(event)); to receive this event.
void
void triggerOnOverlayVisible()
Register an event listener with IWEventManager.addListener(yourMap, 'onoverlayvisible', yourHandlerMethod(event)); to receive this event.
void
void triggerOnProjectionInitialize(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onprojectioninitialize', yourHandlerMethod(event)); to receive this event.
event
void
void triggerOnProjectionInvalid()
Register an event listener with IWEventManager.addListener(yourMapObject, 'onprojectioninvalid', yourHandlerMethod(event)); to receive this event.
void
void triggerOnRemoveLayer(event)
The event has a single property named layer (containing the IWLayerInterface object).
Register an event listener with IWEventManager.addListener(yourMap, 'onremovelayer', yourHandlerMethod(event)); to receive this event.
event
void
void triggerOnResize(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onresize', yourHandlerMethod(event)); to receive this event.
IWResizeEvent event
- the resize event
void
void triggerOnZoom(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onzoom', yourHandlerMethod(event)); to receive the IWZoomEvent.
IWZoomEvent event
- the zoom event
void
void triggerOnZoomEnd(event)
Register an event listener with IWEventManager.addListener(yourMapObject, 'onzoomend', yourHandlerMethod(event)); to receive the IWZoomEvent.
IWZoomEvent event
- the zoom event
void
void triggerOnZoomStart()
Register an event listener with IWEventManager.addListener(yourMapObject, 'onzoomstart', yourHandlerMethod(event)); to receive the IWZoomEvent.
void