Mapstraction

Class Mapstraction

Object
   |
   +--Mapstraction

class 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

addControlsArgs

Object addControlsArgs

api

Object api

currentElement

Object currentElement

debug

Object debug

eventListeners

Object eventListeners

images

Object images

layers

Object layers

loaded

Object loaded

maps

Object maps

markers

Object markers

onload

Object onload

polylines

Object polylines

svn_revision_string

Object svn_revision_string

HYBRID

<static> Object HYBRID

ROAD

<static> Object ROAD

SATELLITE

<static> Object SATELLITE

Constructor Detail

Mapstraction

Mapstraction(<String> element,<String> api,<Bool> debug)

Method Detail

addAPI

void addAPI(<Object> element,<String> api)

addControls

void addControls( <array> args )

addEventListener

void addEventListener()

addFilter

void addFilter(field, operator, value)

addImageOverlay

void addImageOverlay(id, src, <opacity> opacity, <west> west, <south> south, <east> east, <north> north)

addJSON

Object addJSON(json)

addLargeControls

void addLargeControls()

addMapListener

Object addMapListener(<String> event, <Function> callback)

addMapTypeControls

void addMapTypeControls()

addMarker

void addMarker(<Marker> marker, <Boolean> old)

addMarkerWithData

void addMarkerWithData(<Marker> marker, <Object> data)

addOverlay

void addOverlay(url, autoCenterAndZoom)

addPolygon

void addPolygon(<object> polygon)

addPolyline

void addPolyline(<Polyline> polyline, <Boolean> old)

addPolylineWithData

void addPolylineWithData(<Polyline> polyline, <Object> data)

addSmallControls

void addSmallControls()

addTileLayer

Object addTileLayer(tile_url, <opacity> opacity, copyright_text, min_zoom, max_zoom)

applyFilter

Object applyFilter(o, f)

autoCenterAndZoom

void autoCenterAndZoom()

callEventListeners

void callEventListeners(<String> sEventType, <Object> oEventArgs)

centerAndZoomOnPoints

void centerAndZoomOnPoints(points)

clickHandler

void clickHandler(lat, lon, me)

declutterMarkers

void declutterMarkers(<Object> opts)

doFilter

Int doFilter(<Function> showCallback, <Function> hideCallback)

dragging

void dragging(<Boolean> on)

enableScrollWheelZoom

void enableScrollWheelZoom()

getAttributeExtremes

array getAttributeExtremes(field)

getBounds

BoundingBox getBounds()

getCenter

{LatLonPoint} The center point of the map getCenter()

getMap

Object getMap()

getMapType

Object getMapType()

getPixelRatio

Float getPixelRatio()

getZoom

{Integer} The zoom level of the map getZoom()

getZoomLevelForBoundingBox

{Integer} The closest zoom level that contains the bounding box getZoomLevelForBoundingBox( bbox )

isLoaded

{Boolean} The state of the map loading isLoaded(<String> api)

mousePosition

void mousePosition(element)

moveendHandler

void moveendHandler(me)

polylineCenterAndZoom

void polylineCenterAndZoom(<Int> radius)

removeAllFilters

void removeAllFilters()

removeAllMarkers

void removeAllMarkers()

removeAllPolylines

void removeAllPolylines()

removeFilter

void removeFilter(<Object> field, <Object> operator, <Object> value)

removeMapListener

void removeMapListener(<Object> handler)

removeMarker

void removeMarker(<Marker> marker)

removePolyline

void removePolyline(<Polyline> polyline)

resizeTo

void resizeTo(<Integer> width,<Integer> height)

setBounds

void setBounds(bounds)

setCenter

void setCenter(<LatLonPoint> point)

setCenterAndZoom

void setCenterAndZoom(<LatLonPoint> point, <Integer> zoom)

setDebug

{Boolean} The state of debugging setDebug(<Boolean> debug)

setImageOpacity

void setImageOpacity(id, opacity)

setImagePosition

void setImagePosition(id)

setMapType

void setMapType(<int> type)

setZoom

void setZoom(<int> zoom)

swap

void swap(element,<String> api)

toggleFilter

void toggleFilter(<Object> field, <Object> operator, <Object> value)

toggleTileLayer

void toggleTileLayer(tile_url)

visibleCenterAndZoom

void visibleCenterAndZoom()

_getScriptLocation

<static> Object _getScriptLocation()

writeInclude

<static> void writeInclude(api, key, version)

Mapstraction

Documentation generated by JSDoc on Mon Dec 15 20:12:04 2008