MapWrapper Reference Guide
Map
▾ Methods
constructor
or
A JavaScript object containing the following:addEventListener
addMarker
or
A JavaScript object containing the following:fitMarkersToMap
Finds a center point and zoom level that will fit all the markers on the map at its current size
getBoundary
getCenter
getDomElement
getId
getMarkers
getProvider
getWrappedMap
IMPORTANT: this should only be used if there is some functionality that is needed but not provided by MapWrapper. you should expect to have to update any related code if you decide to change providers.
getZoom
removeEventListener
removeMarker
setBoundary
setCenter
Sets the center of the map to the specified point
setMarkers
or
A JavaScript object containing the following:Removes all markers currently on the map, adds the specified markers to the map
setScrollWheelZoomEnabled
Enables/disables scrollwheel zoom
setZoom
Sets the zoom of the map to the specified zoom
setZoomControlPosition
Not currently supported by Bing
▾ Events
BOUNDS_CHANGED
Fired when the map bounds change
CENTER_CHANGED
Fired when the map center changes
CLICK
Fired when a user clicks on the map
DRAG
Fired repeatedly while the map is being dragged
RIGHT_CLICK
Fired when a user right clicks on the map
ZOOM_CHANGED
Fired when the map zoom changes
Marker
▾ Methods
constructor
or
A JavaScript object containing the following:addEventListener
addFeatures
We currently support GeoJSON of type "Feature" or "FeatureCollection", with the following geometries: "Point", "LineString", "MulitLineString", "Polygon" and "MultiPolygon"
addInfoWindow
or
A JavaScript object containing the following:closeInfoWindow
Closes the info window associated with the marker
getData
Returns the data object that was set on the marker
getMap
getPosition
Returns the current latitude and longitude of the marker
getProvider
getWrappedMarker
IMPORTANT: this should only be used if there is some functionality that is needed but not provided by MapWrapper. You should expect to have to update any related code if you decide to change providers.
isDraggable
openInfoWindow
Opens the info window associated with the marker
removeEventListener
removeFeatures
setColor
Sets the color of the marker
setData
Stores arbitrary data with the marker
setDraggable
setIcon
Attaches the specified image to the marker
setPosition
Sets the marker to the specified position
setZIndex
Sets the marker to the specified zIndex (not currently supported by Bing)
updateInfoWindow
or
A JavaScript object containing the following:▾ Events
CLICK
Fires when the marker is clicked on
DOUBLE_CLICK
DRAG
Fired repeatedly while the marker is being dragged
DRAG_END
Fires when the marker has finished being dragged
DRAG_START
Fires when the marker starts being dragged
MOUSEOVER
Fires when the mouse enters the marker
Point
▾ Methods
constructor
Constants
Event
RIGHT_CLICK
DRAG
CLICK
ZOOM_CHANGED
CENTER_CHANGED
BOUNDS_CHANGED
MOUSEOVER
DRAG_START
DRAG_END
DOUBLE_CLICK
InfoWindowOrientation
TOP
BOTTOM
LEFT
RIGHT
PositionRelativeToMap
TOP_LEFT
BOTTOM_LEFT
TOP_RIGHT
BOTTOM_RIGHT
Provider
BING
OPENLAYERS
TileSource
NETTOOLKIT
OPENSTREETMAP
MAPBOX