|
Mapstraction | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--Mapstraction
Defined in mapstraction.js
| Field Summary | |
Object |
addControlsArgs
|
Object |
api
|
Object |
currentElement
|
Object |
debug
|
Object |
eventListeners
|
Object |
images
|
Object |
layers
|
Object |
loaded
|
Object |
maps
|
Object |
markers
|
Object |
onload
|
Object |
polylines
|
Object |
svn_revision_string
|
<static> Object |
HYBRID
|
<static> Object |
ROAD
|
<static> Object |
SATELLITE
|
| Constructor Summary | |
Mapstraction(<String> element,<String> api,<Bool> debug)
Mapstraction instantiates a map with some API choice into the HTML element given |
|
| Method Summary | |
void
|
addAPI(<Object> element,<String> api)
|
void
|
addControls( <array> args )
addControls adds controls to the map. |
void
|
addEventListener()
Add a listener for an event. |
void
|
addFilter(field, operator, value)
addFilter adds a marker filter |
void
|
addImageOverlay(id, src, <opacity> opacity, <west> west, <south> south, <east> east, <north> north)
addImageOverlay layers an georeferenced image over the map |
Object
|
addJSON(json)
|
void
|
addLargeControls()
addLargeControls adds a large map panning control and zoom buttons to the map Supported by: yahoo, google, openstreetmap, multimap, mapquest, openspace |
Object
|
addMapListener(<String> event, <Function> callback)
Ties a callback function to a map event Currently only implemented for google maps |
void
|
addMapTypeControls()
addMapTypeControls adds a map type control to the map (streets, aerial imagery etc) Supported by: yahoo, google, openstreetmap, multimap, mapquest |
void
|
addMarker(<Marker> marker, <Boolean> old)
Adds a marker pin to the map |
void
|
addMarkerWithData(<Marker> marker, <Object> data)
addMarkerWithData will addData to the marker, then add it to the map |
void
|
addOverlay(url, autoCenterAndZoom)
addOverlay adds a GeoRSS or KML overlay to the map some flavors of GeoRSS and KML are not supported by some of the Map providers |
void
|
addPolygon(<object> polygon)
Add a polygon to the map, based on addPolyline and accepts a polyline as the template Currently only implemented in Google |
void
|
addPolyline(<Polyline> polyline, <Boolean> old)
Add a polyline to the map |
void
|
addPolylineWithData(<Polyline> polyline, <Object> data)
addPolylineWithData will addData to the polyline, then add it to the map |
void
|
addSmallControls()
addSmallControls adds a small map panning control and zoom buttons to the map Supported by: yahoo, google, openstreetmap, openlayers, multimap, mapquest, openspace |
Object
|
addTileLayer(tile_url, <opacity> opacity, copyright_text, min_zoom, max_zoom)
Adds a Tile Layer to the map |
Object
|
applyFilter(o, f)
|
void
|
autoCenterAndZoom()
autoCenterAndZoom sets the center and zoom of the map to the smallest bounding box containing all markers |
void
|
callEventListeners(<String> sEventType, <Object> oEventArgs)
Call listeners for a particular event. |
void
|
centerAndZoomOnPoints(points)
centerAndZoomOnPoints sets the center and zoom of the map from an array of points |
void
|
clickHandler(lat, lon, me)
|
void
|
declutterMarkers(<Object> opts)
Declutter the markers on the map, group together overlapping markers. |
Int
|
doFilter(<Function> showCallback, <Function> hideCallback)
doFilter executes all filters added since last call Now supports a callback function for when a marker is shown or hidden |
void
|
dragging(<Boolean> on)
Enable/disable dragging of the map Supported by: yahoo, google, openstreetmap, multimap, openspace |
void
|
enableScrollWheelZoom()
Enable scroll wheel zooming Currently only supported by Google |
array
|
getAttributeExtremes(field)
getAttributeExtremes returns the minimum/maximum of "field" from all markers |
BoundingBox
|
getBounds()
getBounds gets the BoundingBox of the map |
{LatLonPoint} The center point of the map
|
getCenter()
getCenter gets the central point of the map |
Object
|
getMap()
getMap returns the native map object that mapstraction is talking to |
Object
|
getMapType()
getMapType gets the imagery type for the map. |
Float
|
getPixelRatio()
Returns a ratio to turn distance into pixels based on current projection |
{Integer} The zoom level of the map
|
getZoom()
getZoom returns the zoom level of the map |
{Integer} The closest zoom level that contains the bounding box
|
getZoomLevelForBoundingBox( bbox )
getZoomLevelForBoundingBox returns the best zoom level for bounds given |
{Boolean} The state of the map loading
|
isLoaded(<String> api)
Returns the loaded state of a Map Provider |
void
|
mousePosition(element)
|
void
|
moveendHandler(me)
|
void
|
polylineCenterAndZoom(<Int> radius)
Automatically sets center and zoom level to show all polylines Takes into account radious of polyline |
void
|
removeAllFilters()
removeAllFilters |
void
|
removeAllMarkers()
removeAllMarkers removes all the Markers on a map |
void
|
removeAllPolylines()
Removes all polylines from the map |
void
|
removeFilter(<Object> field, <Object> operator, <Object> value)
Remove the specified filter |
void
|
removeMapListener(<Object> handler)
Removes an event handler from the map Currently only implemented for google maps |
void
|
removeMarker(<Marker> marker)
removeMarker removes a Marker from the map |
void
|
removePolyline(<Polyline> polyline)
Remove the polyline from the map |
void
|
resizeTo(<Integer> width,<Integer> height)
Resize the current map to the specified width and height (since it is actually on a child div of the mapElement passed as argument to the Mapstraction constructor, the resizing of this mapElement may have no effect on the size of the actual map) |
void
|
setBounds(bounds)
setBounds sets the map to the appropriate location and zoom for a given BoundingBox |
void
|
setCenter(<LatLonPoint> point)
setCenter sets the central point of the map |
void
|
setCenterAndZoom(<LatLonPoint> point, <Integer> zoom)
Centers the map to some place and zoom level |
{Boolean} The state of debugging
|
setDebug(<Boolean> debug)
Set the debugging on or off - shows alert panels for functions that don't exist in Mapstraction |
void
|
setImageOpacity(id, opacity)
|
void
|
setImagePosition(id)
|
void
|
setMapType(<int> type)
setMapType sets the imagery type for the map. |
void
|
setZoom(<int> zoom)
setZoom sets the zoom level for the map MS doesn't seem to do zoom=0, and Gg's sat goes closer than it's maps, and MS's sat goes closer than Y!'s TODO: Mapstraction.prototype.getZoomLevels or something. |
void
|
swap(element,<String> api)
Change the current api on the fly |
void
|
toggleFilter(<Object> field, <Object> operator, <Object> value)
Delete the current filter if present; otherwise add it |
void
|
toggleTileLayer(tile_url)
Turns a Tile Layer on or off |
void
|
visibleCenterAndZoom()
Sets the center and zoom of the map to the smallest bounding box containing all visible markers and polylines will only include markers and polylines with an attribute of "visible" |
<static> Object
|
_getScriptLocation()
|
<static> void
|
writeInclude(api, key, version)
|
| Field Detail |
Object addControlsArgs
Object api
Object currentElement
Object debug
Object eventListeners
Object images
Object layers
Object loaded
Object maps
Object markers
Object onload
Object polylines
Object svn_revision_string
<static> Object HYBRID
<static> Object ROAD
<static> Object SATELLITE
| Constructor Detail |
Mapstraction(<String> element,<String> api,<Bool> debug)
element - The HTML element to replace with a map
api - The API to use, one of 'google', 'yahoo', 'microsoft', 'openstreetmap', 'multimap', 'map24', 'openlayers', 'mapquest'
debug - optional parameter to turn on debug support - this uses alert panels for unsupported actions
| Method Detail |
void addAPI(<Object> element,<String> api)
element -
api -
void addControls( <array> args )
args - Which controls to switch on
void addEventListener()
type - Event type to attach listener to
func - Callback function
caller - Callback object
void addFilter(field, operator, value)
name - of attribute to filter on
presently - only "ge" or "le"
the - value to compare against
void addImageOverlay(id, src, <opacity> opacity, <west> west, <south> south, <east> east, <north> north)
opacity - 0-100
west - boundary
south - boundary
east - boundary
north - boundary
unique - DOM identifier
url - of image
Object addJSON(json)
void addLargeControls()
Object addMapListener(<String> event, <Function> callback)
event -
callback -
void addMapTypeControls()
void addMarker(<Marker> marker, <Boolean> old)
marker - The marker to add
old - If true, doesn't add this marker to the markers array. Used by the "swap" method
void addMarkerWithData(<Marker> marker, <Object> data)
marker - The marker to add
data - A data has to add
void addOverlay(url, autoCenterAndZoom)
GeoRSS - or KML feed URL
set - true to auto center and zoom after the feed is loaded
void addPolygon(<object> polygon)
polygon -
void addPolyline(<Polyline> polyline, <Boolean> old)
polyline - The Polyline to add to the map
old - If true replaces an existing Polyline
void addPolylineWithData(<Polyline> polyline, <Object> data)
polyline - The polyline to add
data - A data has to add
void addSmallControls()
Object addTileLayer(tile_url, <opacity> opacity, copyright_text, min_zoom, max_zoom)
opacity - of the tile layer - 0 is transparent, 1 is opaque. (default=0.6)
template - url of the tiles.
copyright - text to use for the tile layer. (default=Mapstraction)
Minimum - (furtherest out) zoom level that tiles are available (default=1)
Maximum - (closest) zoom level that the tiles are available (default=18)
Object applyFilter(o, f)
void autoCenterAndZoom()
void callEventListeners(<String> sEventType, <Object> oEventArgs)
sEventType - Call listeners of this event type
oEventArgs - Event args object to pass back to the callback
void centerAndZoomOnPoints(points)
void clickHandler(lat, lon, me)
void declutterMarkers(<Object> opts)
opts - Declutter options
Int doFilter(<Function> showCallback, <Function> hideCallback)
showCallback -
hideCallback -
void dragging(<Boolean> on)
on -
void enableScrollWheelZoom()
array getAttributeExtremes(field)
name - of "field" to query
BoundingBox getBounds()
{LatLonPoint} The center point of the map getCenter()
Object getMap()
Object getMapType()
Float getPixelRatio()
{Integer} The zoom level of the map getZoom()
{Integer} The closest zoom level that contains the bounding box getZoomLevelForBoundingBox( bbox )
boundingBox - the bounds to fit
{Boolean} The state of the map loading isLoaded(<String> api)
api - Optional API to query for. If not specified, returns state of the originally created API
void mousePosition(element)
void moveendHandler(me)
void polylineCenterAndZoom(<Int> radius)
radius -
void removeAllFilters()
void removeAllMarkers()
void removeAllPolylines()
void removeFilter(<Object> field, <Object> operator, <Object> value)
field -
operator -
value -
void removeMapListener(<Object> handler)
handler -
void removeMarker(<Marker> marker)
marker - The marker to remove
void removePolyline(<Polyline> polyline)
polyline - The Polyline to remove from the map
void resizeTo(<Integer> width,<Integer> height)
width - The width the map should be.
height - The width the map should be.
void setBounds(bounds)
the - bounding box you want the map to show
void setCenter(<LatLonPoint> point)
point - The point at which to center the map
void setCenterAndZoom(<LatLonPoint> point, <Integer> zoom)
point - Where the center of the map should be
zoom - The zoom level where 0 is all the way out.
{Boolean} The state of debugging setDebug(<Boolean> debug)
debug - true to turn on debugging, false to turn it off
void setImageOpacity(id, opacity)
void setImagePosition(id)
void setMapType(<int> type)
type - The (native to the map) level zoom the map to.
void setZoom(<int> zoom)
zoom - The (native to the map) level zoom the map to.
void swap(element,<String> api)
element -
api - The API to swap to
void toggleFilter(<Object> field, <Object> operator, <Object> value)
field -
operator -
value -
void toggleTileLayer(tile_url)
url - of the tile layer that was created.
void visibleCenterAndZoom()
<static> Object _getScriptLocation()
<static> void writeInclude(api, key, version)
|
Mapstraction | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||