diff --git a/demoplanner/index.html b/demoplanner/index.html deleted file mode 100644 index 575556439c..0000000000 --- a/demoplanner/index.html +++ /dev/null @@ -1,44 +0,0 @@ - - - Démo Planner - - - - - - - - - - - - - - - - - - -
-
Cliquez sur la map pour choisir un depart
-
-
- -
-
-
- -
- -
- -
- - diff --git a/demoplanner/js/mapstraction/docs/files.html b/demoplanner/js/mapstraction/docs/files.html deleted file mode 100644 index 96244baff5..0000000000 --- a/demoplanner/js/mapstraction/docs/files.html +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - JsDoc Reference - File Index - - - - - - - - -
-
Class Index -| File Index
-
-

Classes

- -
-
- -
-

File Index

- - -
-

H:\Projects\mapstraction-2.0\git\mapstraction\mxn\build\2.0.18\mxn.core.js

- -
- - - - -
-
-
- -
-

H:\Projects\mapstraction-2.0\git\mapstraction\mxn\build\2.0.18\mxn.geocoder.js

- -
- - - - -
-
-
- -
-

H:\Projects\mapstraction-2.0\git\mapstraction\mxn\build\2.0.18\mxn.js

- -
- - - - -
-
-
- - -
-
- ©2009
- Documentation generated by JsDoc Toolkit 2.1.1 on Sat Mar 10 2012 13:30:33 GMT-0000 (GMT) -
- - \ No newline at end of file diff --git a/demoplanner/js/mapstraction/docs/index.html b/demoplanner/js/mapstraction/docs/index.html deleted file mode 100644 index c7e87cf3f0..0000000000 --- a/demoplanner/js/mapstraction/docs/index.html +++ /dev/null @@ -1,306 +0,0 @@ - - - - - - JsDoc Reference - Index - - - - - - - - -
-
Class Index -| File Index
-
-

Classes

- -
-
- -
-

Class Index

- - -
-

_global_

- -
-
- -
-

mxn

- -
-
- -
-

mxn.BoundingBox

- -
-
- -
-

mxn.Event

- -
-
- -
-

mxn.Geocoder

- -
-
- -
-

mxn.Invoker

- -
-
- -
-

mxn.LatLonPoint

- -
-
- -
-

mxn.Mapstraction

- -
-
- -
-

mxn.Marker

- -
-
- -
-

mxn.Polyline

- -
-
- -
-

mxn.Radius

- -
-
- -
-

mxn.util

- -
-
- -
-

mxn.util.Color

- -
-
- - -
-
- ©2009
- Documentation generated by JsDoc Toolkit 2.1.1 on Sat Mar 10 2012 13:30:33 GMT-0000 (GMT) -
- - \ No newline at end of file diff --git a/demoplanner/js/mapstraction/docs/symbols/_global_.html b/demoplanner/js/mapstraction/docs/symbols/_global_.html deleted file mode 100644 index 7ab625df96..0000000000 --- a/demoplanner/js/mapstraction/docs/symbols/_global_.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - - JsDoc Reference - _global_ - - - - - - - - - - - -
- -
Class Index -| File Index
-
-

Classes

- -
- -
- -
- -

- - Built-In Namespace _global_ -

- - -

- - - - - -

- - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - -
- ©2009
- Documentation generated by JsDoc Toolkit 2.1.1 on Sat Mar 10 2012 13:30:32 GMT-0000 (GMT) -
- - diff --git a/demoplanner/js/mapstraction/docs/symbols/mxn.BoundingBox.html b/demoplanner/js/mapstraction/docs/symbols/mxn.BoundingBox.html deleted file mode 100644 index d999b226b1..0000000000 --- a/demoplanner/js/mapstraction/docs/symbols/mxn.BoundingBox.html +++ /dev/null @@ -1,635 +0,0 @@ - - - - - - - JsDoc Reference - mxn.BoundingBox - - - - - - - - - - - -
- -
Class Index -| File Index
-
-

Classes

- -
- -
- -
- -

- - Class mxn.BoundingBox -

- - -

- - - - - -
Defined in: mxn.core.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- mxn.BoundingBox(swlat, swlon, nelat, nelon) -
-
BoundingBox creates a new bounding box object
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
contains(point) -
-
contains finds whether a given point is within a bounding box
-
  -
extend(point) -
-
extend extends the bounding box to include the new point
-
  - -
getNorthEast returns a LatLonPoint of the north-east point of the bounding box
-
  - -
getSouthWest returns a LatLonPoint of the south-west point of the bounding box
-
  -
isEmpty() -
-
isEmpty finds if this bounding box has zero area
-
  -
toSpan() -
-
toSpan returns a LatLonPoint with the lat and lon as the height and width of the bounding box
-
- - - - - - - - - -
-
- Class Detail -
- -
- mxn.BoundingBox(swlat, swlon, nelat, nelon) -
- -
- BoundingBox creates a new bounding box object - -
- - - - - -
-
Parameters:
- -
- {double} swlat - -
-
the latitude of the south-west point
- -
- {double} swlon - -
-
the longitude of the south-west point
- -
- {double} nelat - -
-
the latitude of the north-east point
- -
- {double} nelon - -
-
the longitude of the north-east point
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - {boolean} - contains(point) - -
-
- contains finds whether a given point is within a bounding box - - -
- - - - -
-
Parameters:
- -
- {LatLonPoint} point - -
-
the point to test with
- -
- - - - - -
-
Returns:
- -
whether point is within this bounding box
- -
- - - - -
- - -
- - - extend(point) - -
-
- extend extends the bounding box to include the new point - - -
- - - - -
-
Parameters:
- -
- point - -
-
- -
- - - - - - - - -
- - -
- - {LatLonPoint} - getNorthEast() - -
-
- getNorthEast returns a LatLonPoint of the north-east point of the bounding box - - -
- - - - - - - - -
-
Returns:
- -
the north-east point of the bounding box
- -
- - - - -
- - -
- - {LatLonPoint} - getSouthWest() - -
-
- getSouthWest returns a LatLonPoint of the south-west point of the bounding box - - -
- - - - - - - - -
-
Returns:
- -
the south-west point of the bounding box
- -
- - - - -
- - -
- - {boolean} - isEmpty() - -
-
- isEmpty finds if this bounding box has zero area - - -
- - - - - - - - -
-
Returns:
- -
whether the north-east and south-west points of the bounding box are the same point
- -
- - - - -
- - -
- - {LatLonPoint} - toSpan() - -
-
- toSpan returns a LatLonPoint with the lat and lon as the height and width of the bounding box - - -
- - - - - - - - -
-
Returns:
- -
a LatLonPoint containing the height and width of this bounding box
- -
- - - - - - - - - - - -
-
- - - -
- ©2009
- Documentation generated by JsDoc Toolkit 2.1.1 on Sat Mar 10 2012 13:30:32 GMT-0000 (GMT) -
- - diff --git a/demoplanner/js/mapstraction/docs/symbols/mxn.Event.html b/demoplanner/js/mapstraction/docs/symbols/mxn.Event.html deleted file mode 100644 index 67773cdf23..0000000000 --- a/demoplanner/js/mapstraction/docs/symbols/mxn.Event.html +++ /dev/null @@ -1,543 +0,0 @@ - - - - - - - JsDoc Reference - mxn.Event - - - - - - - - - - - -
- -
Class Index -| File Index
-
-

Classes

- -
- -
- -
- -

- - Class mxn.Event -

- - -

- - - - - -
Defined in: mxn.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- mxn.Event(sEvtName, oEvtSource) -
-
Instantiates a new Event
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
addHandler(fn, ctx) -
-
Add a handler to the Event.
-
  -
fire(oEvtArgs) -
-
Fires the Event.
-
  - -
Remove all handlers from the Event.
-
  -
removeHandler(fn, ctx) -
-
Remove a handler from the Event.
-
- - - - - - - - - -
-
- Class Detail -
- -
- mxn.Event(sEvtName, oEvtSource) -
- -
- Instantiates a new Event - -
- - - - - -
-
Parameters:
- -
- {String} sEvtName - -
-
The name of the event.
- -
- {Object} oEvtSource - -
-
The source object of the event.
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - - addHandler(fn, ctx) - -
-
- Add a handler to the Event. - - -
- - - - -
-
Parameters:
- -
- {Function} fn - -
-
The handler function.
- -
- {Object} ctx - -
-
The context of the handler function.
- -
- - - - - - - - -
- - -
- - - fire(oEvtArgs) - -
-
- Fires the Event. - - -
- - - - -
-
Parameters:
- -
- {Object} oEvtArgs - -
-
Event arguments object to be passed to the handlers.
- -
- - - - - - - - -
- - -
- - - removeAllHandlers() - -
-
- Remove all handlers from the Event. - - -
- - - - - - - - - - - -
- - -
- - - removeHandler(fn, ctx) - -
-
- Remove a handler from the Event. - - -
- - - - -
-
Parameters:
- -
- {Function} fn - -
-
The handler function.
- -
- {Object} ctx - -
-
The context of the handler function.
- -
- - - - - - - - - - - - - - - -
-
- - - -
- ©2009
- Documentation generated by JsDoc Toolkit 2.1.1 on Sat Mar 10 2012 13:30:32 GMT-0000 (GMT) -
- - diff --git a/demoplanner/js/mapstraction/docs/symbols/mxn.Geocoder.html b/demoplanner/js/mapstraction/docs/symbols/mxn.Geocoder.html deleted file mode 100644 index 84b65e9437..0000000000 --- a/demoplanner/js/mapstraction/docs/symbols/mxn.Geocoder.html +++ /dev/null @@ -1,468 +0,0 @@ - - - - - - - JsDoc Reference - mxn.Geocoder - - - - - - - - - - - -
- -
Class Index -| File Index
-
-

Classes

- -
- -
- -
- -

- - Class mxn.Geocoder -

- - -

- - - - - -
Defined in: mxn.geocoder.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- mxn.Geocoder(api, callback, error_callback) -
-
Geocoder instantiates a geocoder with some API choice
-
- - - - - - - - - - - - - - - - - - - - - - -
Field Summary
Field AttributesField Name and Description
  -
- swap -
-
Change the geocoding API in use
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
geocode(address) -
-
Geocodes the provided address.
-
- - - - - - - - - -
-
- Class Detail -
- -
- mxn.Geocoder(api, callback, error_callback) -
- -
- Geocoder instantiates a geocoder with some API choice - -
- - - - - -
-
Parameters:
- -
- {String} api - -
-
The API to use, currently only 'mapquest' is supported
- -
- {Function} callback - -
-
The function to call when a geocode request returns (function(waypoint))
- -
- {Function} error_callback - -
-
The optional function to call when a geocode request fails
- -
- - - - - - - - -
- - - - -
- Field Detail -
- - -
- - - swap - -
-
- Change the geocoding API in use - - -
- - - - - - - - - - - - - - -
- Method Detail -
- - -
- - - geocode(address) - -
-
- Geocodes the provided address. - - -
- - - - -
-
Parameters:
- -
- {Object} address - -
-
Address hash, keys are: street, locality, region, country.
- -
- - - - - - - - - - - - - - - -
-
- - - -
- ©2009
- Documentation generated by JsDoc Toolkit 2.1.1 on Sat Mar 10 2012 13:30:32 GMT-0000 (GMT) -
- - diff --git a/demoplanner/js/mapstraction/docs/symbols/mxn.Invoker.html b/demoplanner/js/mapstraction/docs/symbols/mxn.Invoker.html deleted file mode 100644 index d3a40fa839..0000000000 --- a/demoplanner/js/mapstraction/docs/symbols/mxn.Invoker.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - - - - JsDoc Reference - mxn.Invoker - - - - - - - - - - - -
- -
Class Index -| File Index
-
-

Classes

- -
- -
- -
- -

- - Class mxn.Invoker -

- - -

- - - - - -
Defined in: mxn.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- mxn.Invoker(aobj, asClassName, afnApiIdGetter) -
-
Creates a new Invoker, a class which helps with on-the-fly invocation of the correct API methods.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
go(sMethodName, args, oOptions) -
-
Invoke the API implementation of a specific method.
-
- - - - - - - - - -
-
- Class Detail -
- -
- mxn.Invoker(aobj, asClassName, afnApiIdGetter) -
- -
- Creates a new Invoker, a class which helps with on-the-fly invocation of the correct API methods. - -
- - - - - -
-
Parameters:
- -
- {Object} aobj - -
-
The core object whose methods will make cals to go()
- -
- {String} asClassName - -
-
The name of the Mapstraction class to be invoked, normally the same name as aobj's constructor function
- -
- {Function} afnApiIdGetter - -
-
The function on object aobj which will return the active API ID
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - - go(sMethodName, args, oOptions) - -
-
- Invoke the API implementation of a specific method. - - -
- - - - -
-
Parameters:
- -
- {String} sMethodName - -
-
The method name to invoke
- -
- {Array} args - -
-
Arguments to pass on
- -
- {Object} oOptions - -
-
Optional. Extra options for invocation
- -
- {Boolean} oOptions.overrideApi - -
-
When true the first argument is used as the API ID.
- -
- {Object} oOptions.context - -
-
A context object for passing extra information on to the provider implementation.
- -
- {Function} oOptions.fallback - -
-
A fallback function to run if the provider implementation is missing.
- -
- - - - - - - - - - - - - - - -
-
- - - -
- ©2009
- Documentation generated by JsDoc Toolkit 2.1.1 on Sat Mar 10 2012 13:30:32 GMT-0000 (GMT) -
- - diff --git a/demoplanner/js/mapstraction/docs/symbols/mxn.LatLonPoint.html b/demoplanner/js/mapstraction/docs/symbols/mxn.LatLonPoint.html deleted file mode 100644 index b93462319d..0000000000 --- a/demoplanner/js/mapstraction/docs/symbols/mxn.LatLonPoint.html +++ /dev/null @@ -1,692 +0,0 @@ - - - - - - - JsDoc Reference - mxn.LatLonPoint - - - - - - - - - - - -
- -
Class Index -| File Index
-
-

Classes

- -
- -
- -
- -

- - Class mxn.LatLonPoint -

- - -

- - - - - -
Defined in: mxn.core.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- mxn.LatLonPoint(lat, lon) -
-
LatLonPoint is a point containing a latitude and longitude with helper methods
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
distance(otherPoint) -
-
distance returns the distance in kilometers between two points
-
  -
equals(otherPoint) -
-
equals tests if this point is the same as some other one
-
  -
fromProprietary(apiId, point) -
-
Retrieve the lat and lon values from a proprietary point.
-
  -
latConv() -
-
Returns latitude conversion based on current projection
-
  -
lonConv() -
-
Returns longitude conversion based on current projection
-
  -
toProprietary(apiId) -
-
Converts the current LatLonPoint to a proprietary one for the API specified by apiId.
-
  - -
toString returns a string represntation of a point
-
- - - - - - - - - -
-
- Class Detail -
- -
- mxn.LatLonPoint(lat, lon) -
- -
- LatLonPoint is a point containing a latitude and longitude with helper methods - -
- - - - - -
-
Parameters:
- -
- {double} lat - -
-
is the latitude
- -
- {double} lon - -
-
is the longitude
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - {double} - distance(otherPoint) - -
-
- distance returns the distance in kilometers between two points - - -
- - - - -
-
Parameters:
- -
- {LatLonPoint} otherPoint - -
-
The other point to measure the distance from to this one
- -
- - - - - -
-
Returns:
- -
the distance between the points in kilometers
- -
- - - - -
- - -
- - {boolean} - equals(otherPoint) - -
-
- equals tests if this point is the same as some other one - - -
- - - - -
-
Parameters:
- -
- {LatLonPoint} otherPoint - -
-
The other point to test with
- -
- - - - - -
-
Returns:
- -
true or false
- -
- - - - -
- - -
- - - fromProprietary(apiId, point) - -
-
- Retrieve the lat and lon values from a proprietary point. - - -
- - - - -
-
Parameters:
- -
- {String} apiId - -
-
The API ID of the proprietary point.
- -
- {Object} point - -
-
The proprietary point.
- -
- - - - - - - - -
- - -
- - {Float} - latConv() - -
-
- Returns latitude conversion based on current projection - - -
- - - - - - - - -
-
Returns:
- -
{Float} conversion
- -
- - - - -
- - -
- - {Float} - lonConv() - -
-
- Returns longitude conversion based on current projection - - -
- - - - - - - - -
-
Returns:
- -
{Float} conversion
- -
- - - - -
- - -
- - - toProprietary(apiId) - -
-
- Converts the current LatLonPoint to a proprietary one for the API specified by apiId. - - -
- - - - -
-
Parameters:
- -
- {String} apiId - -
-
The API ID of the proprietary point.
- -
- - - - - -
-
Returns:
- -
A proprietary point.
- -
- - - - -
- - -
- - {String} - toString() - -
-
- toString returns a string represntation of a point - - -
- - - - - - - - -
-
Returns:
- -
a string like '51.23, -0.123'
- -
- - - - - - - - - - - -
-
- - - -
- ©2009
- Documentation generated by JsDoc Toolkit 2.1.1 on Sat Mar 10 2012 13:30:32 GMT-0000 (GMT) -
- - diff --git a/demoplanner/js/mapstraction/docs/symbols/mxn.Mapstraction.html b/demoplanner/js/mapstraction/docs/symbols/mxn.Mapstraction.html deleted file mode 100644 index 9e0ac3a651..0000000000 --- a/demoplanner/js/mapstraction/docs/symbols/mxn.Mapstraction.html +++ /dev/null @@ -1,3639 +0,0 @@ - - - - - - - JsDoc Reference - mxn.Mapstraction - - - - - - - - - - - -
- -
Class Index -| File Index
-
-

Classes

- -
- -
- -
- -

- - Class mxn.Mapstraction -

- - -

- - - - - -
Defined in: mxn.core.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- mxn.Mapstraction(element, api, debug) -
-
Mapstraction instantiates a map with some API choice into the HTML element given
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Field Summary
Field AttributesField Name and Description
  -
- api -
-
The name of the active API.
-
  - -
The DOM element containing the map.
-
  -
- element -
-
The original element value passed to the constructor.
-
  -
- markers -
-
The markers currently loaded.
-
  -
- options -
-
Options defaults.
-
  -
- polylines -
-
The polylines currently loaded.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
addControls(args) -
-
addControls adds controls to the map.
-
  -
addEventListener(type, func, caller) -
-
Add a listener for an event.
-
  -
addFilter(name, presently, the) -
-
addFilter adds a marker filter
-
  -
addImageOverlay(unique, url, opacity, west, south, east, north) -
-
addImageOverlay layers an georeferenced image over the map
-
  -
addJSON(json) -
-
-
  - -
Adds a large map panning control and zoom buttons to the map
-
  - -
Adds a map type control to the map (streets, aerial imagery etc)
-
  -
addMarker(marker, old) -
-
Adds a marker pin to the map
-
  -
addMarkerWithData(marker, data) -
-
addMarkerWithData will addData to the marker, then add it to the map
-
  -
addOverlay(url, autoCenterAndZoom) -
-
Adds a GeoRSS or KML overlay to the map some flavors of GeoRSS and KML are not supported by some of the Map providers
-
  -
addPolyline(polyline, old) -
-
Add a polyline to the map
-
  -
addPolylineWithData(polyline, data) -
-
addPolylineWithData will addData to the polyline, then add it to the map
-
  - -
Adds a small map panning control and zoom buttons to the map
-
  -
addTileLayer(template, opacity, copyright, Minimum, Maximum, Should) -
-
Adds a Tile Layer to the map Requires providing a parameterized tile url.
-
  -
applyFilter(o, f) -
-
-
  - -
Applies the current option settings
-
  - -
Sets the center and zoom of the map to the smallest bounding box containing all markers and polylines
-
  -
callEventListeners(sEventType, oEventArgs) -
-
Call listeners for a particular event.
-
  - -
centerAndZoomOnPoints sets the center and zoom of the map from an array of points This is useful if you don't want to have to add markers to the map
-
  -
clickHandler(lat, lon, me) -
-
-
  - -
Declutter the markers on the map, group together overlapping markers.
-
  -
doFilter(showCallback, hideCallback) -
-
doFilter executes all filters added since last call Now supports a callback function for when a marker is shown or hidden
-
  -
dragging(on) -
-
Enable/disable dragging of the map
-
  - -
Enable scroll wheel zooming
-
  - -
getAttributeExtremes returns the minimum/maximum of "field" from all markers
-
  - -
Gets the BoundingBox of the map
-
  - -
Gets the central point of the map
-
  -
getMap() -
-
getMap returns the native map object that mapstraction is talking to
-
  - -
Gets the imagery type for the map.
-
  - -
Returns a ratio to turn distance into pixels based on current projection
-
  -
getZoom() -
-
Returns the zoom level of the map
-
  - -
Returns the best zoom level for bounds given
-
  -
isLoaded(api) -
-
Returns the loaded state of a Map Provider
-
  -
mousePosition(element) -
-
Displays the coordinates of the cursor in the HTML element
-
  - -
-
  - -
Automatically sets center and zoom level to show all polylines
-
  - -
removeAllFilters
-
  - -
removeAllMarkers removes all the Markers on a map
-
  - -
Removes all polylines from the map
-
  -
removeFilter(field, operator, value) -
-
Remove the specified filter
-
  -
removeMarker(marker) -
-
removeMarker removes a Marker from the map
-
  -
removePolyline(polyline) -
-
Remove the polyline from the map
-
  -
resizeTo(width, 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)
-
  - -
Run any queued provider API calls for the methods defined in the provider's implementation.
-
  -
setBounds(bounds) -
-
Sets the map to the appropriate location and zoom for a given BoundingBox
-
  -
setCenter(point, options) -
-
setCenter sets the central point of the map
-
  -
setCenterAndZoom(point, zoom) -
-
Centers the map to some place and zoom level
-
  -
setDebug(debug) -
-
Set the debugging on or off - shows alert panels for functions that don't exist in Mapstraction
-
  -
setDefer(set) -
-
Set the api call deferment on or off - When it's on, mxn.invoke will queue up provider API calls until runDeferred is called, at which time everything in the queue will be run in the order it was added.
-
  -
setImageOpacity(id, opacity) -
-
-
  - -
-
  -
setMapType(type) -
-
Sets the imagery type for the map The type can be one of: mxn.Mapstraction.ROAD mxn.Mapstraction.SATELLITE mxn.Mapstraction.HYBRID mxn.Mapstraction.PHYSICAL
-
  -
setOption(sOptName, vVal) -
-
Sets an option and applies it.
-
  -
setOptions(oOpts) -
-
Sets the current options to those specified in oOpts and applies them
-
  -
setZoom(zoom) -
-
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.
-
  -
swap(api, element) -
-
Change the current api on the fly
-
  -
toggleFilter(field, operator, value) -
-
Delete the current filter if present; otherwise add it
-
  - -
Turns a Tile Layer on or off
-
  - -
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"
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Event Summary
Event AttributesEvent Name and Description
  - -
Zoom is changed
-
  -
click() -
-
Map is clicked {location: LatLonPoint}
-
  -
endPan() -
-
Map is panned
-
  -
load() -
-
Map has loaded
-
  - -
Marker is added {marker: Marker}
-
  - -
Marker is removed {marker: Marker}
-
  - -
Polyline is added {polyline: Polyline}
-
  - -
Polyline is removed {polyline: Polyline}
-
- - - - - - - -
-
- Class Detail -
- -
- mxn.Mapstraction(element, api, debug) -
- -
- Mapstraction instantiates a map with some API choice into the HTML element given - -
- - - - - -
-
Parameters:
- -
- {String} element - -
-
The HTML element to replace with a map
- -
- {String} api - -
-
The API to use, one of 'google', 'googlev3', 'yahoo', 'microsoft', 'openstreetmap', 'multimap', 'map24', 'openlayers', 'mapquest'. If omitted, first loaded provider implementation is used.
- -
- {Bool} debug - -
-
optional parameter to turn on debug support - this uses alert panels for unsupported actions
- -
- - - - - - - - -
- - - - -
- Field Detail -
- - -
- - - api - -
-
- The name of the active API. - - -
- - - - - - - - -
- - -
- - - currentElement - -
-
- The DOM element containing the map. - - -
- - - - - - - - -
- - -
- - - element - -
-
- The original element value passed to the constructor. - - -
- - - - - - - - -
- - -
- - - markers - -
-
- The markers currently loaded. - - -
- - - - - - - - -
- - -
- - - options - -
-
- Options defaults. - - -
- - - - - - - - -
- - -
- - - polylines - -
-
- The polylines currently loaded. - - -
- - - - - - - - - - - - - - -
- Method Detail -
- - -
- - - addControls(args) - -
-
- addControls adds controls to the map. You specify which controls to add in the associative array that is the only argument. addControls can be called multiple time, with different args, to dynamically change controls. args = { pan: true, zoom: 'large' || 'small', overview: true, scale: true, map_type: true, } - - -
- - - - -
-
Parameters:
- -
- {array} args - -
-
Which controls to switch on
- -
- - - - - - - - -
- - -
- - - addEventListener(type, func, caller) - -
-
- Add a listener for an event. - - -
- - - - -
-
Parameters:
- -
- {String} type - -
-
Event type to attach listener to
- -
- {Function} func - -
-
Callback function
- -
- {Object} caller - -
-
Callback object
- -
- - - - - - - - -
- - -
- - - addFilter(name, presently, the) - -
-
- addFilter adds a marker filter - - -
- - - - -
-
Parameters:
- -
- {field} name - -
-
of attribute to filter on
- -
- {operator} presently - -
-
only "ge" or "le"
- -
- {value} the - -
-
value to compare against
- -
- - - - - - - - -
- - -
- - - addImageOverlay(unique, url, opacity, west, south, east, north) - -
-
- addImageOverlay layers an georeferenced image over the map - - -
- - - - -
-
Parameters:
- -
- {id} unique - -
-
DOM identifier
- -
- {src} url - -
-
of image
- -
- {opacity} opacity - -
-
0-100
- -
- {west} west - -
-
boundary
- -
- {south} south - -
-
boundary
- -
- {east} east - -
-
boundary
- -
- {north} north - -
-
boundary
- -
- - - - - - - - -
- - -
- - - addJSON(json) - -
-
- - - -
- - - - -
-
Parameters:
- -
- json - -
-
- -
- - - - - - - - -
- - -
- - - addLargeControls() - -
-
- Adds a large map panning control and zoom buttons to the map - - -
- - - - - - - - - - - -
- - -
- - - addMapTypeControls() - -
-
- Adds a map type control to the map (streets, aerial imagery etc) - - -
- - - - - - - - - - - -
- - -
- - - addMarker(marker, old) - -
-
- Adds a marker pin to the map - - -
- - - - -
-
Parameters:
- -
- {Marker} marker - -
-
The marker to add
- -
- {Boolean} old - -
-
If true, doesn't add this marker to the markers array. Used by the "swap" method
- -
- - - - - - - - -
- - -
- - - addMarkerWithData(marker, data) - -
-
- addMarkerWithData will addData to the marker, then add it to the map - - -
- - - - -
-
Parameters:
- -
- {Marker} marker - -
-
The marker to add
- -
- {Object} data - -
-
A data has to add
- -
- - - - - - - - -
- - -
- - - addOverlay(url, autoCenterAndZoom) - -
-
- Adds a GeoRSS or KML overlay to the map some flavors of GeoRSS and KML are not supported by some of the Map providers - - -
- - - - -
-
Parameters:
- -
- {String} url - -
-
GeoRSS or KML feed URL
- -
- {Boolean} autoCenterAndZoom - -
-
Set true to auto center and zoom after the feed is loaded
- -
- - - - - - - - -
- - -
- - - addPolyline(polyline, old) - -
-
- Add a polyline to the map - - -
- - - - -
-
Parameters:
- -
- {Polyline} polyline - -
-
The Polyline to add to the map
- -
- {Boolean} old - -
-
If true replaces an existing Polyline
- -
- - - - - - - - -
- - -
- - - addPolylineWithData(polyline, data) - -
-
- addPolylineWithData will addData to the polyline, then add it to the map - - -
- - - - -
-
Parameters:
- -
- {Polyline} polyline - -
-
The polyline to add
- -
- {Object} data - -
-
A data has to add
- -
- - - - - - - - -
- - -
- - - addSmallControls() - -
-
- Adds a small map panning control and zoom buttons to the map - - -
- - - - - - - - - - - -
- - -
- - - addTileLayer(template, opacity, copyright, Minimum, Maximum, Should) - -
-
- Adds a Tile Layer to the map Requires providing a parameterized tile url. Use {Z}, {X}, and {Y} to specify where the parameters should go in the URL. For example, the OpenStreetMap tiles are: m.addTileLayer("http://tile.openstreetmap.org/{Z}/{X}/{Y}.png", 1.0, "OSM", 1, 19, true); - - -
- - - - -
-
Parameters:
- -
- {tile_url} template - -
-
url of the tiles.
- -
- {opacity} opacity - -
-
of the tile layer - 0 is transparent, 1 is opaque. (default=0.6)
- -
- {copyright_text} copyright - -
-
text to use for the tile layer. (default=Mapstraction)
- -
- {min_zoom} Minimum - -
-
(furtherest out) zoom level that tiles are available (default=1)
- -
- {max_zoom} Maximum - -
-
(closest) zoom level that the tiles are available (default=18)
- -
- {map_type} Should - -
-
the tile layer be a selectable map type in the layers palette (default=false)
- -
- - - - - - - - -
- - -
- - - applyFilter(o, f) - -
-
- - - -
- - - - -
-
Parameters:
- -
- o - -
-
- -
- f - -
-
- -
- - - - - - - - -
- - -
- - - applyOptions() - -
-
- Applies the current option settings - - -
- - - - - - - - - - - -
- - -
- - - autoCenterAndZoom() - -
-
- Sets the center and zoom of the map to the smallest bounding box containing all markers and polylines - - -
- - - - - - - - - - - -
- - -
- - - callEventListeners(sEventType, oEventArgs) - -
-
- Call listeners for a particular event. - - -
- - - - -
-
Parameters:
- -
- {String} sEventType - -
-
Call listeners of this event type
- -
- {Object} oEventArgs - -
-
Event args object to pass back to the callback
- -
- - - - - - - - -
- - -
- - - centerAndZoomOnPoints(points) - -
-
- centerAndZoomOnPoints sets the center and zoom of the map from an array of points This is useful if you don't want to have to add markers to the map - - -
- - - - -
-
Parameters:
- -
- points - -
-
- -
- - - - - - - - -
- - -
- - - clickHandler(lat, lon, me) - -
-
- - - -
- - - - -
-
Parameters:
- -
- lat - -
-
- -
- lon - -
-
- -
- me - -
-
- -
- - - - - - - - -
- - -
- - - declutterMarkers(opts) - -
-
- Declutter the markers on the map, group together overlapping markers. - - -
- - - - -
-
Parameters:
- -
- {Object} opts - -
-
Declutter options
- -
- - - - - - - - -
- - -
- - {Int} - doFilter(showCallback, hideCallback) - -
-
- doFilter executes all filters added since last call Now supports a callback function for when a marker is shown or hidden - - -
- - - - -
-
Parameters:
- -
- {Function} showCallback - -
-
- -
- {Function} hideCallback - -
-
- -
- - - - - -
-
Returns:
- -
{Int} count of visible markers
- -
- - - - -
- - -
- - - dragging(on) - -
-
- Enable/disable dragging of the map - - -
- - - - -
-
Parameters:
- -
- {Boolean} on - -
-
- -
- - -
-
Deprecated:
-
- Use setOption instead. -
-
- - - - - - - -
- - -
- - - enableScrollWheelZoom() - -
-
- Enable scroll wheel zooming - - -
- - - - - -
-
Deprecated:
-
- Use setOption instead. -
-
- - - - - - - -
- - -
- - {array} - getAttributeExtremes(name) - -
-
- getAttributeExtremes returns the minimum/maximum of "field" from all markers - - -
- - - - -
-
Parameters:
- -
- {field} name - -
-
of "field" to query
- -
- - - - - -
-
Returns:
- -
{array} of minimum/maximum
- -
- - - - -
- - -
- - {BoundingBox} - getBounds() - -
-
- Gets the BoundingBox of the map - - -
- - - - - - - - -
-
Returns:
- -
{BoundingBox} The bounding box for the current map state
- -
- - - - -
- - -
- - {LatLonPoint} - getCenter() - -
-
- Gets the central point of the map - - -
- - - - - - - - -
-
Returns:
- -
{LatLonPoint} The center point of the map
- -
- - - - -
- - -
- - - getMap() - -
-
- getMap returns the native map object that mapstraction is talking to - - -
- - - - - - - - -
-
Returns:
- -
the native map object mapstraction is using
- -
- - - - -
- - -
- - {Number} - getMapType() - -
-
- Gets the imagery type for the map. The type can be one of: mxn.Mapstraction.ROAD mxn.Mapstraction.SATELLITE mxn.Mapstraction.HYBRID mxn.Mapstraction.PHYSICAL - - -
- - - - - - - - -
-
Returns:
- -
{Number}
- -
- - - - -
- - -
- - {Float} - getPixelRatio() - -
-
- Returns a ratio to turn distance into pixels based on current projection - - -
- - - - - - - - -
-
Returns:
- -
{Float} ratio
- -
- - - - -
- - -
- - {Integer} - getZoom() - -
-
- Returns the zoom level of the map - - -
- - - - - - - - -
-
Returns:
- -
{Integer} The zoom level of the map
- -
- - - - -
- - -
- - {Integer} - getZoomLevelForBoundingBox(bbox) - -
-
- Returns the best zoom level for bounds given - - -
- - - - -
-
Parameters:
- -
- {BoundingBox} bbox - -
-
The bounds to fit
- -
- - - - - -
-
Returns:
- -
{Integer} The closest zoom level that contains the bounding box
- -
- - - - -
- - -
- - - isLoaded(api) - -
-
- Returns the loaded state of a Map Provider - - -
- - - - -
-
Parameters:
- -
- {String} api - -
-
Optional API to query for. If not specified, returns state of the originally created API
- -
- - - - - - - - -
- - -
- - - mousePosition(element) - -
-
- Displays the coordinates of the cursor in the HTML element - - -
- - - - -
-
Parameters:
- -
- {String} element - -
-
ID of the HTML element to display the coordinates in
- -
- - - - - - - - -
- - -
- - - moveendHandler(me) - -
-
- - - -
- - - - -
-
Parameters:
- -
- me - -
-
- -
- - - - - - - - -
- - -
- - - polylineCenterAndZoom(padding) - -
-
- Automatically sets center and zoom level to show all polylines - - -
- - - - -
-
Parameters:
- -
- {Number} padding - -
-
Optional number of kilometers to pad around polyline
- -
- - - - - - - - -
- - -
- - - removeAllFilters() - -
-
- removeAllFilters - - -
- - - - - - - - - - - -
- - -
- - - removeAllMarkers() - -
-
- removeAllMarkers removes all the Markers on a map - - -
- - - - - - - - - - - -
- - -
- - - removeAllPolylines() - -
-
- Removes all polylines from the map - - -
- - - - - - - - - - - -
- - -
- - - removeFilter(field, operator, value) - -
-
- Remove the specified filter - - -
- - - - -
-
Parameters:
- -
- {Object} field - -
-
- -
- {Object} operator - -
-
- -
- {Object} value - -
-
- -
- - - - - - - - -
- - -
- - - removeMarker(marker) - -
-
- removeMarker removes a Marker from the map - - -
- - - - -
-
Parameters:
- -
- {Marker} marker - -
-
The marker to remove
- -
- - - - - - - - -
- - -
- - - removePolyline(polyline) - -
-
- Remove the polyline from the map - - -
- - - - -
-
Parameters:
- -
- {Polyline} polyline - -
-
The Polyline to remove from the map
- -
- - - - - - - - -
- - -
- - - resizeTo(width, 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) - - -
- - - - -
-
Parameters:
- -
- {Integer} width - -
-
The width the map should be.
- -
- {Integer} height - -
-
The width the map should be.
- -
- - - - - - - - -
- - -
- - - runDeferred() - -
-
- Run any queued provider API calls for the methods defined in the provider's implementation. For example, if defferable in mxn.[provider].core.js is set to {getCenter: true, setCenter: true} then any calls to map.setCenter or map.getCenter will be queued up in this.onload. When the provider's implementation loads the map, it calls this.runDeferred and any queued calls will be run. - - -
- - - - - - - - - - - -
- - -
- - - setBounds(bounds) - -
-
- Sets the map to the appropriate location and zoom for a given BoundingBox - - -
- - - - -
-
Parameters:
- -
- {BoundingBox} bounds - -
-
The bounding box you want the map to show
- -
- - - - - - - - -
- - -
- - - setCenter(point, options) - -
-
- setCenter sets the central point of the map - - -
- - - - -
-
Parameters:
- -
- {LatLonPoint} point - -
-
The point at which to center the map
- -
- {Object} options - -
-
Optional parameters
- -
- {Boolean} options.pan - -
-
Whether the map should move to the locations using a pan or just jump straight there
- -
- - - - - - - - -
- - -
- - - setCenterAndZoom(point, zoom) - -
-
- Centers the map to some place and zoom level - - -
- - - - -
-
Parameters:
- -
- {LatLonPoint} point - -
-
Where the center of the map should be
- -
- {Integer} zoom - -
-
The zoom level where 0 is all the way out.
- -
- - - - - - - - -
- - -
- - - setDebug(debug) - -
-
- Set the debugging on or off - shows alert panels for functions that don't exist in Mapstraction - - -
- - - - -
-
Parameters:
- -
- {Boolean} debug - -
-
true to turn on debugging, false to turn it off
- -
- - - - - - - - -
- - -
- - - setDefer(set) - -
-
- Set the api call deferment on or off - When it's on, mxn.invoke will queue up provider API calls until runDeferred is called, at which time everything in the queue will be run in the order it was added. - - -
- - - - -
-
Parameters:
- -
- {Boolean} set - -
-
deferred to true to turn on deferment
- -
- - - - - - - - -
- - -
- - - setImageOpacity(id, opacity) - -
-
- - - -
- - - - -
-
Parameters:
- -
- id - -
-
- -
- opacity - -
-
- -
- - - - - - - - -
- - -
- - - setImagePosition(id) - -
-
- - - -
- - - - -
-
Parameters:
- -
- id - -
-
- -
- - - - - - - - -
- - -
- - - setMapType(type) - -
-
- Sets the imagery type for the map The type can be one of: mxn.Mapstraction.ROAD mxn.Mapstraction.SATELLITE mxn.Mapstraction.HYBRID mxn.Mapstraction.PHYSICAL - - -
- - - - -
-
Parameters:
- -
- {Number} type - -
-
- -
- - - - - - - - -
- - -
- - - setOption(sOptName, vVal) - -
-
- Sets an option and applies it. - - -
- - - - -
-
Parameters:
- -
- {String} sOptName - -
-
Option name
- -
- vVal - -
-
Option value
- -
- - - - - - - - -
- - -
- - - setOptions(oOpts) - -
-
- Sets the current options to those specified in oOpts and applies them - - -
- - - - -
-
Parameters:
- -
- {Object} oOpts - -
-
Hash of options to set
- -
- - - - - - - - -
- - -
- - - setZoom(zoom) - -
-
- 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. - - -
- - - - -
-
Parameters:
- -
- {Number} zoom - -
-
The (native to the map) level zoom the map to.
- -
- - - - - - - - -
- - -
- - - swap(api, element) - -
-
- Change the current api on the fly - - -
- - - - -
-
Parameters:
- -
- {String} api - -
-
The API to swap to
- -
- element - -
-
- -
- - - - - - - - -
- - -
- - - toggleFilter(field, operator, value) - -
-
- Delete the current filter if present; otherwise add it - - -
- - - - -
-
Parameters:
- -
- {Object} field - -
-
- -
- {Object} operator - -
-
- -
- {Object} value - -
-
- -
- - - - - - - - -
- - -
- - - toggleTileLayer(url) - -
-
- Turns a Tile Layer on or off - - -
- - - - -
-
Parameters:
- -
- {tile_url} url - -
-
of the tile layer that was created.
- -
- - - - - - - - -
- - -
- - - 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" - - -
- - - - - - - - - - - - - - - - - -
- Event Detail -
- - -
- - - changeZoom() - -
-
- Zoom is changed - - -
- - - - - - - - - - - -
- - -
- - - click() - -
-
- Map is clicked {location: LatLonPoint} - - -
- - - - - - - - - - - -
- - -
- - - endPan() - -
-
- Map is panned - - -
- - - - - - - - - - - -
- - -
- - - load() - -
-
- Map has loaded - - -
- - - - - - - - - - - -
- - -
- - - markerAdded() - -
-
- Marker is added {marker: Marker} - - -
- - - - - - - - - - - -
- - -
- - - markerRemoved() - -
-
- Marker is removed {marker: Marker} - - -
- - - - - - - - - - - -
- - -
- - - polylineAdded() - -
-
- Polyline is added {polyline: Polyline} - - -
- - - - - - - - - - - -
- - -
- - - polylineRemoved() - -
-
- Polyline is removed {polyline: Polyline} - - -
- - - - - - - - - - - - - - - -
-
- - - -
- ©2009
- Documentation generated by JsDoc Toolkit 2.1.1 on Sat Mar 10 2012 13:30:33 GMT-0000 (GMT) -
- - diff --git a/demoplanner/js/mapstraction/docs/symbols/mxn.Marker.html b/demoplanner/js/mapstraction/docs/symbols/mxn.Marker.html deleted file mode 100644 index 7e46059356..0000000000 --- a/demoplanner/js/mapstraction/docs/symbols/mxn.Marker.html +++ /dev/null @@ -1,1341 +0,0 @@ - - - - - - - JsDoc Reference - mxn.Marker - - - - - - - - - - - -
- -
Class Index -| File Index
-
-

Classes

- -
- -
- -
- -

- - Class mxn.Marker -

- - -

- - - - - -
Defined in: mxn.core.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- mxn.Marker(point) -
-
Marker create's a new marker pin
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
addData(options) -
-
addData conviniently set a hash of options on a marker
-
  - -
Closes the marker's info bubble.
-
  -
fromProprietary(apiId, marker) -
-
Retrieve the settings from a proprietary marker.
-
  -
getAttribute(key) -
-
getAttribute: gets the value of "key"
-
  -
hide() -
-
Hide the marker.
-
  - -
Open the marker's info bubble.
-
  -
setAttribute(key, value) -
-
Set an arbitrary key/value pair on a marker
-
  -
setChild(some_proprietary_marker) -
-
-
  -
setDraggable(draggable) -
-
Sets the draggable state of the marker
-
  -
setGroupName(sGrpName) -
-
Markers are grouped up by this name.
-
  -
setHover(hover) -
-
Sets that the marker info is displayed on hover
-
  -
setHoverIcon(hoverIconUrl) -
-
-
  -
setIcon(iconUrl, iconSize, iconAnchor) -
-
Sets the icon for a marker
-
  -
setIconAnchor(iconAnchor) -
-
Sets the anchor point for a marker
-
  -
setIconSize(iconSize) -
-
Sets the size of the icon for a marker
-
  -
setInfoBubble(infoBubble) -
-
Sets the html/text content for a bubble popup for a marker
-
  -
setInfoDiv(infoDiv, div) -
-
Sets the text and the id of the div element where to the information useful for putting information in a div outside of the map
-
  -
setLabel(labelText) -
-
-
  -
setShadowIcon(iconUrl, iconShadowSize) -
-
Sets the icon for a marker
-
  -
show() -
-
Show the marker.
-
  -
toProprietary(apiId) -
-
Converts the current Marker to a proprietary one for the API specified by apiId.
-
  -
update() -
-
Updates the Marker with the location of the attached proprietary marker on the map.
-
- - - - - - - - - -
-
- Class Detail -
- -
- mxn.Marker(point) -
- -
- Marker create's a new marker pin - -
- - - - - -
-
Parameters:
- -
- {LatLonPoint} point - -
-
the point on the map where the marker should go
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - - addData(options) - -
-
- addData conviniently set a hash of options on a marker - - -
- - - - -
-
Parameters:
- -
- {Object} options - -
-
An object literal hash of key value pairs. Keys are: label, infoBubble, icon, iconShadow, infoDiv, draggable, hover, hoverIcon, openBubble, groupName.
- -
- - - - - - - - -
- - -
- - - closeBubble() - -
-
- Closes the marker's info bubble. - - -
- - - - - - - - - - - -
- - -
- - - fromProprietary(apiId, marker) - -
-
- Retrieve the settings from a proprietary marker. - - -
- - - - -
-
Parameters:
- -
- {String} apiId - -
-
The API ID of the proprietary point.
- -
- {Object} marker - -
-
The proprietary marker.
- -
- - - - - - - - -
- - -
- - - getAttribute(key) - -
-
- getAttribute: gets the value of "key" - - -
- - - - -
-
Parameters:
- -
- {String} key - -
-
- -
- - - - - -
-
Returns:
- -
value
- -
- - - - -
- - -
- - - hide() - -
-
- Hide the marker. - - -
- - - - - - - - - - - -
- - -
- - - openBubble() - -
-
- Open the marker's info bubble. - - -
- - - - - - - - - - - -
- - -
- - - setAttribute(key, value) - -
-
- Set an arbitrary key/value pair on a marker - - -
- - - - -
-
Parameters:
- -
- {String} key - -
-
- -
- value - -
-
- -
- - - - - - - - -
- - -
- - - setChild(some_proprietary_marker) - -
-
- - - -
- - - - -
-
Parameters:
- -
- some_proprietary_marker - -
-
- -
- - - - - - - - -
- - -
- - - setDraggable(draggable) - -
-
- Sets the draggable state of the marker - - -
- - - - -
-
Parameters:
- -
- {Bool} draggable - -
-
set to true if marker should be draggable by the user
- -
- - - - - - - - -
- - -
- - - setGroupName(sGrpName) - -
-
- Markers are grouped up by this name. declutterGroup makes use of this. - - -
- - - - -
-
Parameters:
- -
- sGrpName - -
-
- -
- - - - - - - - -
- - -
- - - setHover(hover) - -
-
- Sets that the marker info is displayed on hover - - -
- - - - -
-
Parameters:
- -
- {Boolean} hover - -
-
set to true if marker should display info on hover
- -
- - - - - - - - -
- - -
- - - setHoverIcon(hoverIconUrl) - -
-
- - - -
- - - - -
-
Parameters:
- -
- hoverIconUrl - -
-
- -
- - - - - - - - -
- - -
- - - setIcon(iconUrl, iconSize, iconAnchor) - -
-
- Sets the icon for a marker - - -
- - - - -
-
Parameters:
- -
- {String} iconUrl - -
-
The URL of the image you want to be the icon
- -
- iconSize - -
-
- -
- iconAnchor - -
-
- -
- - - - - - - - -
- - -
- - - setIconAnchor(iconAnchor) - -
-
- Sets the anchor point for a marker - - -
- - - - -
-
Parameters:
- -
- {Array} iconAnchor - -
-
The array offset in pixels of the anchor point from top left: [ right, down ]
- -
- - - - - - - - -
- - -
- - - setIconSize(iconSize) - -
-
- Sets the size of the icon for a marker - - -
- - - - -
-
Parameters:
- -
- {Array} iconSize - -
-
The array size in pixels of the marker image: [ width, height ]
- -
- - - - - - - - -
- - -
- - - setInfoBubble(infoBubble) - -
-
- Sets the html/text content for a bubble popup for a marker - - -
- - - - -
-
Parameters:
- -
- {String} infoBubble - -
-
the html/text you want displayed
- -
- - - - - - - - -
- - -
- - - setInfoDiv(infoDiv, div) - -
-
- Sets the text and the id of the div element where to the information useful for putting information in a div outside of the map - - -
- - - - -
-
Parameters:
- -
- {String} infoDiv - -
-
the html/text you want displayed
- -
- {String} div - -
-
the element id to use for displaying the text/html
- -
- - - - - - - - -
- - -
- - - setLabel(labelText) - -
-
- - - -
- - - - -
-
Parameters:
- -
- labelText - -
-
- -
- - - - - - - - -
- - -
- - - setShadowIcon(iconUrl, iconShadowSize) - -
-
- Sets the icon for a marker - - -
- - - - -
-
Parameters:
- -
- {String} iconUrl - -
-
The URL of the image you want to be the icon
- -
- iconShadowSize - -
-
- -
- - - - - - - - -
- - -
- - - show() - -
-
- Show the marker. - - -
- - - - - - - - - - - -
- - -
- - - toProprietary(apiId) - -
-
- Converts the current Marker to a proprietary one for the API specified by apiId. - - -
- - - - -
-
Parameters:
- -
- {String} apiId - -
-
The API ID of the proprietary marker.
- -
- - - - - -
-
Returns:
- -
A proprietary marker.
- -
- - - - -
- - -
- - - update() - -
-
- Updates the Marker with the location of the attached proprietary marker on the map. - - -
- - - - - - - - - - - - - - - - - - -
-
- - - -
- ©2009
- Documentation generated by JsDoc Toolkit 2.1.1 on Sat Mar 10 2012 13:30:33 GMT-0000 (GMT) -
- - diff --git a/demoplanner/js/mapstraction/docs/symbols/mxn.Polyline.html b/demoplanner/js/mapstraction/docs/symbols/mxn.Polyline.html deleted file mode 100644 index e1e38e27c5..0000000000 --- a/demoplanner/js/mapstraction/docs/symbols/mxn.Polyline.html +++ /dev/null @@ -1,1024 +0,0 @@ - - - - - - - JsDoc Reference - mxn.Polyline - - - - - - - - - - - -
- -
Class Index -| File Index
-
-

Classes

- -
- -
- -
- -

- - Class mxn.Polyline -

- - -

- - - - - -
Defined in: mxn.core.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- mxn.Polyline(points) -
-
Instantiates a new Polyline.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
addData(options) -
-
addData conviniently set a hash of options on a polyline
-
  -
fromProprietary(apiId, polyline) -
-
Retrieve the settings from a proprietary polyline.
-
  -
getAttribute(key) -
-
Gets the value of "key"
-
  -
hide() -
-
Hide the polyline.
-
  -
setAttribute(key, value) -
-
Set an arbitrary key/value pair on a polyline
-
  -
setChild(some_proprietary_polyline) -
-
-
  -
setClosed(bClosed) -
-
Marks the polyline as a closed polygon
-
  -
setColor(color) -
-
in the form: #RRGGBB Note map24 insists on upper case, so we convert it.
-
  -
setFillColor(sFillColor) -
-
Fill color for a closed polyline as HTML color value e.g.
-
  -
setOpacity(opacity) -
-
A float between 0.0 and 1.0
-
  -
setWidth(width) -
-
Stroke width of the polyline
-
  -
show() -
-
Show the polyline.
-
  -
simplify(tolerance) -
-
Simplifies a polyline, averaging and reducing the points
-
  -
toProprietary(apiId) -
-
Converts the current Polyline to a proprietary one for the API specified by apiId.
-
  -
update() -
-
Updates the Polyline with the path of the attached proprietary polyline on the map.
-
- - - - - - - - - -
-
- Class Detail -
- -
- mxn.Polyline(points) -
- -
- Instantiates a new Polyline. - -
- - - - - -
-
Parameters:
- -
- {Point[]} points - -
-
Points that make up the Polyline.
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - - addData(options) - -
-
- addData conviniently set a hash of options on a polyline - - -
- - - - -
-
Parameters:
- -
- {Object} options - -
-
An object literal hash of key value pairs. Keys are: color, width, opacity, closed, fillColor.
- -
- - - - - - - - -
- - -
- - - fromProprietary(apiId, polyline) - -
-
- Retrieve the settings from a proprietary polyline. - - -
- - - - -
-
Parameters:
- -
- {String} apiId - -
-
The API ID of the proprietary polyline.
- -
- {Object} polyline - -
-
The proprietary polyline.
- -
- - - - - - - - -
- - -
- - - getAttribute(key) - -
-
- Gets the value of "key" - - -
- - - - -
-
Parameters:
- -
- {String} key - -
-
- -
- - - - - -
-
Returns:
- -
value
- -
- - - - -
- - -
- - - hide() - -
-
- Hide the polyline. - - -
- - - - - - - - - - - -
- - -
- - - setAttribute(key, value) - -
-
- Set an arbitrary key/value pair on a polyline - - -
- - - - -
-
Parameters:
- -
- {String} key - -
-
- -
- value - -
-
- -
- - - - - - - - -
- - -
- - - setChild(some_proprietary_polyline) - -
-
- - - -
- - - - -
-
Parameters:
- -
- some_proprietary_polyline - -
-
- -
- - - - - - - - -
- - -
- - - setClosed(bClosed) - -
-
- Marks the polyline as a closed polygon - - -
- - - - -
-
Parameters:
- -
- {Boolean} bClosed - -
-
- -
- - - - - - - - -
- - -
- - - setColor(color) - -
-
- in the form: #RRGGBB Note map24 insists on upper case, so we convert it. - - -
- - - - -
-
Parameters:
- -
- color - -
-
- -
- - - - - - - - -
- - -
- - - setFillColor(sFillColor) - -
-
- Fill color for a closed polyline as HTML color value e.g. #RRGGBB - - -
- - - - -
-
Parameters:
- -
- {String} sFillColor - -
-
HTML color value #RRGGBB
- -
- - - - - - - - -
- - -
- - - setOpacity(opacity) - -
-
- A float between 0.0 and 1.0 - - -
- - - - -
-
Parameters:
- -
- {Float} opacity - -
-
- -
- - - - - - - - -
- - -
- - - setWidth(width) - -
-
- Stroke width of the polyline - - -
- - - - -
-
Parameters:
- -
- {Integer} width - -
-
- -
- - - - - - - - -
- - -
- - - show() - -
-
- Show the polyline. - - -
- - - - - - - - - - - -
- - -
- - - simplify(tolerance) - -
-
- Simplifies a polyline, averaging and reducing the points - - -
- - - - -
-
Parameters:
- -
- {Number} tolerance - -
-
(1.0 is a good starting point)
- -
- - - - - - - - -
- - -
- - - toProprietary(apiId) - -
-
- Converts the current Polyline to a proprietary one for the API specified by apiId. - - -
- - - - -
-
Parameters:
- -
- {String} apiId - -
-
The API ID of the proprietary polyline.
- -
- - - - - -
-
Returns:
- -
A proprietary polyline.
- -
- - - - -
- - -
- - - update() - -
-
- Updates the Polyline with the path of the attached proprietary polyline on the map. - - -
- - - - - - - - - - - - - - - - - - -
-
- - - -
- ©2009
- Documentation generated by JsDoc Toolkit 2.1.1 on Sat Mar 10 2012 13:30:33 GMT-0000 (GMT) -
- - diff --git a/demoplanner/js/mapstraction/docs/symbols/mxn.Radius.html b/demoplanner/js/mapstraction/docs/symbols/mxn.Radius.html deleted file mode 100644 index dd50cb4c26..0000000000 --- a/demoplanner/js/mapstraction/docs/symbols/mxn.Radius.html +++ /dev/null @@ -1,420 +0,0 @@ - - - - - - - JsDoc Reference - mxn.Radius - - - - - - - - - - - -
- -
Class Index -| File Index
-
-

Classes

- -
- -
- -
- -

- - Class mxn.Radius -

- - -

- - - - - -
Defined in: mxn.core.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- mxn.Radius(center, quality) -
-
Creates a new radius object for drawing circles around a point, does a lot of initial calculation to increase load time
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
getPolyline(radius, color) -
-
Returns polyline of a circle around the point based on new radius
-
- - - - - - - - - -
-
- Class Detail -
- -
- mxn.Radius(center, quality) -
- -
- Creates a new radius object for drawing circles around a point, does a lot of initial calculation to increase load time - -
- - - - - -
-
Parameters:
- -
- {LatLonPoint} center - -
-
LatLonPoint of the radius
- -
- {Number} quality - -
-
Number of points that comprise the approximated circle (20 is a good starting point)
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - {Polyline} - getPolyline(radius, color) - -
-
- Returns polyline of a circle around the point based on new radius - - -
- - - - -
-
Parameters:
- -
- {Radius} radius - -
-
- -
- {Color} color - -
-
- -
- - - - - -
-
Returns:
- -
{Polyline} Polyline
- -
- - - - - - - - - - - -
-
- - - -
- ©2009
- Documentation generated by JsDoc Toolkit 2.1.1 on Sat Mar 10 2012 13:30:33 GMT-0000 (GMT) -
- - diff --git a/demoplanner/js/mapstraction/docs/symbols/mxn.html b/demoplanner/js/mapstraction/docs/symbols/mxn.html deleted file mode 100644 index a1889399dd..0000000000 --- a/demoplanner/js/mapstraction/docs/symbols/mxn.html +++ /dev/null @@ -1,652 +0,0 @@ - - - - - - - JsDoc Reference - mxn - - - - - - - - - - - -
- -
Class Index -| File Index
-
-

Classes

- -
- -
- -
- -

- - Namespace mxn -

- - -

- - - - - -
Defined in: mxn.js. - -

- - - - - - - - - - - - - - - - - -
Namespace Summary
Constructor AttributesConstructor Name and Description
  -
- mxn -
-
-
- - - - - - - - - - - - - - - - - - - - - - -
Field Summary
Field AttributesField Name and Description
<static>   -
- mxn.tileLayers -
-
The array of all layers that have been added to the map.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
<static>   -
mxn.addEvents(oEvtSrc, aEvtNames) -
-
Bulk add some named events to an object.
-
<static>   -
mxn.addProxyMethods(func, aryMethods, bWithApiArg) -
-
Adds a list of named proxy methods to the prototype of a specified constructor function.
-
<static>   -
mxn.checkLoad(funcDetails) -
-
-
<static>   -
mxn.deferUntilLoaded(fnCall) -
-
-
<static>   -
mxn.register(sApiId, oApiImpl) -
-
Registers a set of provider specific implementation functions.
-
- - - - - - - - - -
-
- Namespace Detail -
- -
- mxn -
- -
- - -
- - - - - - - - - - - - -
- - - - -
- Field Detail -
- - -
<static> - - - mxn.tileLayers - -
-
- The array of all layers that have been added to the map. - -
- Defined in: mxn.core.js. - - -
- - - - - - - - - - - - - - -
- Method Detail -
- - -
<static> - - - mxn.addEvents(oEvtSrc, aEvtNames) - -
-
- Bulk add some named events to an object. - - -
- - - - -
-
Parameters:
- -
- {Object} oEvtSrc - -
-
The event source object.
- -
- {String[]} aEvtNames - -
-
Event names to add.
- -
- - - - - - - - -
- - -
<static> - - - mxn.addProxyMethods(func, aryMethods, bWithApiArg) - -
-
- Adds a list of named proxy methods to the prototype of a specified constructor function. - - -
- - - - -
-
Parameters:
- -
- {Function} func - -
-
Constructor function to add methods to
- -
- {Array} aryMethods - -
-
Array of method names to create
- -
- {Boolean} bWithApiArg - -
-
Optional. Whether the proxy methods will use an API argument
- -
- - - - - - - - -
- - -
<static> - - - mxn.checkLoad(funcDetails) - -
-
- - - -
- - - - -
-
Parameters:
- -
- funcDetails - -
-
- -
- - - - - - - - -
- - -
<static> - - - mxn.deferUntilLoaded(fnCall) - -
-
- - - -
- - - - -
-
Parameters:
- -
- fnCall - -
-
- -
- - - - - - - - -
- - -
<static> - - - mxn.register(sApiId, oApiImpl) - -
-
- Registers a set of provider specific implementation functions. - - -
- - - - -
-
Parameters:
- -
- {String} sApiId - -
-
The API ID to register implementing functions for.
- -
- {Object} oApiImpl - -
-
An object containing the API implementation.
- -
- - - - - - - - - - - - - - - -
-
- - - -
- ©2009
- Documentation generated by JsDoc Toolkit 2.1.1 on Sat Mar 10 2012 13:30:32 GMT-0000 (GMT) -
- - diff --git a/demoplanner/js/mapstraction/docs/symbols/mxn.util.Color.html b/demoplanner/js/mapstraction/docs/symbols/mxn.util.Color.html deleted file mode 100644 index 1d1dce0f3a..0000000000 --- a/demoplanner/js/mapstraction/docs/symbols/mxn.util.Color.html +++ /dev/null @@ -1,431 +0,0 @@ - - - - - - - JsDoc Reference - mxn.util.Color - - - - - - - - - - - -
- -
Class Index -| File Index
-
-

Classes

- -
- -
- -
- -

- - Class mxn.util.Color -

- - -

- - - - - -
Defined in: mxn.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  - -
Class for converting between HTML and RGB integer color formats.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  - -
Retrieve the color value as an HTML hex string.
-
  -
setHexColor(strHexColor) -
-
Set the color from the supplied HTML hex string.
-
- - - - - - - - - -
-
- Class Detail -
- -
- mxn.util.Color() -
- -
- Class for converting between HTML and RGB integer color formats. Accepts either a HTML color string argument or three integers for R, G and B. - -
- - - - - - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - {String} - getHexColor() - -
-
- Retrieve the color value as an HTML hex string. - - -
- - - - - - - - -
-
Returns:
- -
{String} Format '#00FF88'.
- -
- - - - -
- - -
- - - setHexColor(strHexColor) - -
-
- Set the color from the supplied HTML hex string. - - -
- - - - -
-
Parameters:
- -
- {String} strHexColor - -
-
A HTML hex color string e.g. '#00FF88'.
- -
- - - - - - - - - - - - - - - -
-
- - - -
- ©2009
- Documentation generated by JsDoc Toolkit 2.1.1 on Sat Mar 10 2012 13:30:33 GMT-0000 (GMT) -
- - diff --git a/demoplanner/js/mapstraction/docs/symbols/mxn.util.html b/demoplanner/js/mapstraction/docs/symbols/mxn.util.html deleted file mode 100644 index aa7aa9b946..0000000000 --- a/demoplanner/js/mapstraction/docs/symbols/mxn.util.html +++ /dev/null @@ -1,1125 +0,0 @@ - - - - - - - JsDoc Reference - mxn.util - - - - - - - - - - - -
- -
Class Index -| File Index
-
-

Classes

- -
- -
- -
- -

- - Namespace mxn.util -

- - -

- - - - - -
Defined in: mxn.js. - -

- - - - - - - - - - - - - - - - - -
Namespace Summary
Constructor AttributesConstructor Name and Description
  -
- mxn.util -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
<static>   -
mxn.util.$m() -
-
$m, the dollar function, elegantising getElementById()
-
<static>   -
mxn.util.convertLatLonXY_Yahoo(point, level) -
-
-
<static>   -
mxn.util.getAvailableProviders() -
-
Returns array of loaded provider apis
-
<static>   -
mxn.util.getDegreesFromGoogleZoomLevel(pixels, zoom) -
-
-
<static>   -
mxn.util.getGoogleZoomLevelFromDegrees(pixels, degrees) -
-
-
<static>   -
mxn.util.getStyle(el, prop) -
-
getStyle provides cross-browser access to css
-
<static>   -
mxn.util.KMToMiles(km) -
-
Convert kilometres to miles
-
<static>   -
mxn.util.loadScript(src, callback) -
-
loadScript is a JSON data fetcher
-
<static>   -
mxn.util.loadStyle(href) -
-
Load a stylesheet from a remote file.
-
<static>   -
mxn.util.logN(number, base) -
-
-
<static>   -
mxn.util.lonToMetres(lon, lat) -
-
Convert longitude to metres http://www.uwgb.edu/dutchs/UsefulData/UTMFormulas.HTM "A degree of longitude at the equator is 111.2km.
-
<static>   -
mxn.util.merge(oRecv, oGive) -
-
Merges properties of one object into another recursively.
-
<static>   -
mxn.util.metresToLon(m, lat) -
-
Convert metres to longitude
-
<static>   -
mxn.util.milesToKM(miles) -
-
Convert miles to kilometres
-
<static>   -
mxn.util.stringFormat(strIn) -
-
Formats a string, inserting values of subsequent parameters at specified locations.
-
<static>   -
mxn.util.traverse(start) -
-
Traverses an object graph using a series of map functions provided as arguments 2 to n.
-
- - - - - - - - - -
-
- Namespace Detail -
- -
- mxn.util -
- -
- - -
- - - - - - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
<static> - - - mxn.util.$m() - -
-
- $m, the dollar function, elegantising getElementById() - - -
- - - - - - - - -
-
Returns:
- -
An HTML element or array of HTML elements
- -
- - - - -
- - -
<static> - - - mxn.util.convertLatLonXY_Yahoo(point, level) - -
-
- - - -
- - - - -
-
Parameters:
- -
- {Object} point - -
-
- -
- {Object} level - -
-
- -
- - - - - - - - -
- - -
<static> - - {Array} - mxn.util.getAvailableProviders() - -
-
- Returns array of loaded provider apis - - -
- - - - - - - - -
-
Returns:
- -
{Array} providers
- -
- - - - -
- - -
<static> - - - mxn.util.getDegreesFromGoogleZoomLevel(pixels, zoom) - -
-
- - - -
- - - - -
-
Parameters:
- -
- {Object} pixels - -
-
- -
- {Object} zoom - -
-
- -
- - - - - - - - -
- - -
<static> - - - mxn.util.getGoogleZoomLevelFromDegrees(pixels, degrees) - -
-
- - - -
- - - - -
-
Parameters:
- -
- {Object} pixels - -
-
- -
- {Object} degrees - -
-
- -
- - - - - - - - -
- - -
<static> - - - mxn.util.getStyle(el, prop) - -
-
- getStyle provides cross-browser access to css - - -
- - - - -
-
Parameters:
- -
- {Object} el - -
-
HTML Element
- -
- {String} prop - -
-
Style property name
- -
- - - - - - - - -
- - -
<static> - - {Float} - mxn.util.KMToMiles(km) - -
-
- Convert kilometres to miles - - -
- - - - -
-
Parameters:
- -
- {Float} km - -
-
- -
- - - - - -
-
Returns:
- -
{Float} miles
- -
- - - - -
- - -
<static> - - - mxn.util.loadScript(src, callback) - -
-
- loadScript is a JSON data fetcher - - -
- - - - -
-
Parameters:
- -
- {String} src - -
-
URL to JSON file
- -
- {Function} callback - -
-
Callback function
- -
- - - - - - - - -
- - -
<static> - - - mxn.util.loadStyle(href) - -
-
- Load a stylesheet from a remote file. - - -
- - - - -
-
Parameters:
- -
- {String} href - -
-
URL to the CSS file
- -
- - - - - - - - -
- - -
<static> - - - mxn.util.logN(number, base) - -
-
- - - -
- - - - -
-
Parameters:
- -
- {Object} number - -
-
- -
- {Object} base - -
-
- -
- - - - - - - - -
- - -
<static> - - - mxn.util.lonToMetres(lon, lat) - -
-
- Convert longitude to metres http://www.uwgb.edu/dutchs/UsefulData/UTMFormulas.HTM "A degree of longitude at the equator is 111.2km... For other latitudes, multiply by cos(lat)" assumes the earth is a sphere but good enough for our purposes - - -
- - - - -
-
Parameters:
- -
- {Float} lon - -
-
- -
- {Float} lat - -
-
- -
- - - - - - - - -
- - -
<static> - - - mxn.util.merge(oRecv, oGive) - -
-
- Merges properties of one object into another recursively. - - -
- - - - -
-
Parameters:
- -
- {Object} oRecv - -
-
The object receiveing properties
- -
- {Object} oGive - -
-
The object donating properties
- -
- - - - - - - - -
- - -
<static> - - - mxn.util.metresToLon(m, lat) - -
-
- Convert metres to longitude - - -
- - - - -
-
Parameters:
- -
- {Object} m - -
-
- -
- {Object} lat - -
-
- -
- - - - - - - - -
- - -
<static> - - {Float} - mxn.util.milesToKM(miles) - -
-
- Convert miles to kilometres - - -
- - - - -
-
Parameters:
- -
- {Float} miles - -
-
- -
- - - - - -
-
Returns:
- -
{Float} km
- -
- - - - -
- - -
<static> - - - mxn.util.stringFormat(strIn) - -
-
- Formats a string, inserting values of subsequent parameters at specified locations. e.g. stringFormat('{0} {1}', 'hello', 'world'); - - -
- - - - -
-
Parameters:
- -
- strIn - -
-
- -
- - - - - - - - -
- - -
<static> - - - mxn.util.traverse(start) - -
-
- Traverses an object graph using a series of map functions provided as arguments 2 to n. Map functions are only called if the working object is not undefined/null. For usage see mxn.google.geocoder.js. - - -
- - - - -
-
Parameters:
- -
- start - -
-
- -
- - - - - - - - - - - - - - - -
-
- - - -
- ©2009
- Documentation generated by JsDoc Toolkit 2.1.1 on Sat Mar 10 2012 13:30:33 GMT-0000 (GMT) -
- - diff --git a/demoplanner/js/mapstraction/docs/symbols/src/H__Projects_mapstraction-2.0_git_mapstraction_mxn_build_2.0.18_mxn.core.js.html b/demoplanner/js/mapstraction/docs/symbols/src/H__Projects_mapstraction-2.0_git_mapstraction_mxn_build_2.0.18_mxn.core.js.html deleted file mode 100644 index 4f1d8e912b..0000000000 --- a/demoplanner/js/mapstraction/docs/symbols/src/H__Projects_mapstraction-2.0_git_mapstraction_mxn_build_2.0.18_mxn.core.js.html +++ /dev/null @@ -1,1886 +0,0 @@ -
  1 (function(){
-  2 
-  3 /**
-  4  * @exports mxn.util.$m as $m
-  5  */
-  6 var $m = mxn.util.$m;
-  7 
-  8 /**
-  9  * Initialise our provider. This function should only be called 
- 10  * from within mapstraction code, not exposed as part of the API.
- 11  * @private
- 12  */
- 13 var init = function() {
- 14 	this.invoker.go('init', [ this.currentElement, this.api ]);
- 15 	this.applyOptions();
- 16 };
- 17 
- 18 /**
- 19  * Mapstraction instantiates a map with some API choice into the HTML element given
- 20  * @name mxn.Mapstraction
- 21  * @constructor
- 22  * @param {String} element The HTML element to replace with a map
- 23  * @param {String} api The API to use, one of 'google', 'googlev3', 'yahoo', 'microsoft', 'openstreetmap', 'multimap', 'map24', 'openlayers', 'mapquest'. If omitted, first loaded provider implementation is used.
- 24  * @param {Bool} debug optional parameter to turn on debug support - this uses alert panels for unsupported actions
- 25  * @exports Mapstraction as mxn.Mapstraction
- 26  */
- 27 var Mapstraction = mxn.Mapstraction = function(element, api, debug) {
- 28 	if (!api){
- 29 		api = mxn.util.getAvailableProviders()[0];
- 30 	}
- 31 	
- 32 	/**
- 33 	 * The name of the active API.
- 34 	 * @name mxn.Mapstraction#api
- 35 	 * @type {String}
- 36 	 */
- 37 	this.api = api;
- 38 		
- 39 	this.maps = {};
- 40 	
- 41 	/**
- 42 	 * The DOM element containing the map.
- 43 	 * @name mxn.Mapstraction#currentElement
- 44 	 * @property
- 45 	 * @type {DOMElement}
- 46 	 */
- 47 	this.currentElement = $m(element);
- 48 	
- 49 	this.eventListeners = [];
- 50 	
- 51 	/**
- 52 	 * The array of all layers that have been added to the map.
- 53 	 */
- 54 	this.tileLayers = [];	
- 55 		
- 56 	/**
- 57 	 * The markers currently loaded.
- 58 	 * @name mxn.Mapstraction#markers
- 59 	 * @property
- 60 	 * @type {Array}
- 61 	 */
- 62 	this.markers = [];
- 63 		
- 64 	/**
- 65 	 * The polylines currently loaded.
- 66 	 * @name mxn.Mapstraction#polylines
- 67 	 * @property
- 68 	 * @type {Array}
- 69 	 */
- 70 	this.polylines = [];
- 71 	
- 72 	this.images = [];
- 73 	this.controls = [];	
- 74 	this.loaded = {};
- 75 	this.onload = {};
- 76     //this.loaded[api] = true; // FIXME does this need to be true? -ajturner
- 77 	this.onload[api] = [];
- 78 	
- 79 	/**
- 80 	 * The original element value passed to the constructor.
- 81 	 * @name mxn.Mapstraction#element
- 82 	 * @property
- 83 	 * @type {String|DOMElement}
- 84 	 */
- 85 	this.element = element;
- 86 	
- 87 	/**
- 88 	 * Options defaults.
- 89 	 * @name mxn.Mapstraction#options
- 90 	 * @property {Object}
- 91 	 */
- 92 	this.options = {
- 93 		enableScrollWheelZoom: false,
- 94 		enableDragging: true
- 95 	};
- 96 	
- 97 	this.addControlsArgs = {};
- 98 	
- 99 	// set up our invoker for calling API methods
-100 	this.invoker = new mxn.Invoker(this, 'Mapstraction', function(){ return this.api; });
-101 	
-102 	// Adding our events
-103 	mxn.addEvents(this, [
-104 		
-105 		/**
-106 		 * Map has loaded
-107 		 * @name mxn.Mapstraction#load
-108 		 * @event
-109 		 */
-110 		'load',
-111 		
-112 		/**
-113 		 * Map is clicked {location: LatLonPoint}
-114 		 * @name mxn.Mapstraction#click
-115 		 * @event
-116 		 */
-117 		'click',
-118 		
-119 		/**
-120 		 * Map is panned
-121 		 * @name mxn.Mapstraction#endPan
-122 		 * @event
-123 		 */
-124 		'endPan',
-125 		
-126 		/**
-127 		 * Zoom is changed
-128 		 * @name mxn.Mapstraction#changeZoom
-129 		 * @event
-130 		 */
-131 		'changeZoom',
-132 		
-133 		/**
-134 		 * Marker is added {marker: Marker}
-135 		 * @name mxn.Mapstraction#markerAdded
-136 		 * @event
-137 		 */
-138 		'markerAdded',
-139 		
-140 		/**
-141 		 * Marker is removed {marker: Marker}
-142 		 * @name mxn.Mapstraction#markerRemoved
-143 		 * @event
-144 		 */
-145 		'markerRemoved',
-146 		
-147 		/**
-148 		 * Polyline is added {polyline: Polyline}
-149 		 * @name mxn.Mapstraction#polylineAdded
-150 		 * @event
-151 		 */
-152 		'polylineAdded',
-153 		
-154 		/**
-155 		 * Polyline is removed {polyline: Polyline}
-156 		 * @name mxn.Mapstraction#polylineRemoved
-157 		 * @event
-158 		 */
-159 		'polylineRemoved'
-160 	]);
-161 	
-162 	// finally initialize our proper API map
-163 	init.apply(this);
-164 };
-165 
-166 // Map type constants
-167 Mapstraction.ROAD = 1;
-168 Mapstraction.SATELLITE = 2;
-169 Mapstraction.HYBRID = 3;
-170 Mapstraction.PHYSICAL = 4;
-171 
-172 // methods that have no implementation in mapstraction core
-173 mxn.addProxyMethods(Mapstraction, [ 
-174 	/**
-175 	 * Adds a large map panning control and zoom buttons to the map
-176 	 * @name mxn.Mapstraction#addLargeControls
-177 	 * @function
-178 	 */
-179 	'addLargeControls',
-180 		
-181 	/**
-182 	 * Adds a map type control to the map (streets, aerial imagery etc)
-183 	 * @name mxn.Mapstraction#addMapTypeControls
-184 	 * @function
-185 	 */
-186 	'addMapTypeControls', 
-187 	
-188 	/**
-189 	 * Adds a GeoRSS or KML overlay to the map
-190 	 *  some flavors of GeoRSS and KML are not supported by some of the Map providers
-191 	 * @name mxn.Mapstraction#addOverlay
-192 	 * @function
-193 	 * @param {String} url GeoRSS or KML feed URL
-194 	 * @param {Boolean} autoCenterAndZoom Set true to auto center and zoom after the feed is loaded
-195 	 */
-196 	'addOverlay', 
-197 	
-198 	/**
-199 	 * Adds a small map panning control and zoom buttons to the map
-200 	 * @name mxn.Mapstraction#addSmallControls
-201 	 * @function
-202 	 */
-203 	'addSmallControls', 
-204 	
-205 	/**
-206 	 * Applies the current option settings
-207 	 * @name mxn.Mapstraction#applyOptions
-208 	 * @function
-209 	 */
-210 	'applyOptions',
-211 	
-212 	/**
-213 	 * Gets the BoundingBox of the map
-214 	 * @name mxn.Mapstraction#getBounds
-215 	 * @function
-216 	 * @returns {BoundingBox} The bounding box for the current map state
-217 	 */
-218 	'getBounds', 
-219 	
-220 	/**
-221 	 * Gets the central point of the map
-222 	 * @name mxn.Mapstraction#getCenter
-223 	 * @function
-224 	 * @returns {LatLonPoint} The center point of the map
-225 	 */
-226 	'getCenter', 
-227 	
-228 	/**
-229 	 * Gets the imagery type for the map.
-230 	 * The type can be one of:
-231 	 *  mxn.Mapstraction.ROAD
-232 	 *  mxn.Mapstraction.SATELLITE
-233 	 *  mxn.Mapstraction.HYBRID
-234 	 *  mxn.Mapstraction.PHYSICAL
-235 	 * @name mxn.Mapstraction#getMapType
-236 	 * @function
-237 	 * @returns {Number} 
-238 	 */
-239 	'getMapType', 
-240 
-241 	/**
-242 	 * Returns a ratio to turn distance into pixels based on current projection
-243 	 * @name mxn.Mapstraction#getPixelRatio
-244 	 * @function
-245 	 * @returns {Float} ratio
-246 	 */
-247 	'getPixelRatio', 
-248 	
-249 	/**
-250 	 * Returns the zoom level of the map
-251 	 * @name mxn.Mapstraction#getZoom
-252 	 * @function
-253 	 * @returns {Integer} The zoom level of the map
-254 	 */
-255 	'getZoom', 
-256 	
-257 	/**
-258 	 * Returns the best zoom level for bounds given
-259 	 * @name mxn.Mapstraction#getZoomLevelForBoundingBox
-260 	 * @function
-261 	 * @param {BoundingBox} bbox The bounds to fit
-262 	 * @returns {Integer} The closest zoom level that contains the bounding box
-263 	 */
-264 	'getZoomLevelForBoundingBox', 
-265 	
-266 	/**
-267 	 * Displays the coordinates of the cursor in the HTML element
-268 	 * @name mxn.Mapstraction#mousePosition
-269 	 * @function
-270 	 * @param {String} element ID of the HTML element to display the coordinates in
-271 	 */
-272 	'mousePosition',
-273 	
-274 	/**
-275 	 * Resize the current map to the specified width and height
-276 	 * (since it is actually on a child div of the mapElement passed
-277 	 * as argument to the Mapstraction constructor, the resizing of this
-278 	 * mapElement may have no effect on the size of the actual map)
-279 	 * @name mxn.Mapstraction#resizeTo
-280 	 * @function
-281 	 * @param {Integer} width The width the map should be.
-282 	 * @param {Integer} height The width the map should be.
-283 	 */
-284 	'resizeTo', 
-285 	
-286 	/**
-287 	 * Sets the map to the appropriate location and zoom for a given BoundingBox
-288 	 * @name mxn.Mapstraction#setBounds
-289 	 * @function
-290 	 * @param {BoundingBox} bounds The bounding box you want the map to show
-291 	 */
-292 	'setBounds', 
-293 	
-294 	/**
-295 	 * setCenter sets the central point of the map
-296 	 * @name mxn.Mapstraction#setCenter
-297 	 * @function
-298 	 * @param {LatLonPoint} point The point at which to center the map
-299 	 * @param {Object} options Optional parameters
-300 	 * @param {Boolean} options.pan Whether the map should move to the locations using a pan or just jump straight there
-301 	 */
-302 	'setCenter', 
-303 	
-304 	/**
-305 	 * Centers the map to some place and zoom level
-306 	 * @name mxn.Mapstraction#setCenterAndZoom
-307 	 * @function
-308 	 * @param {LatLonPoint} point Where the center of the map should be
-309 	 * @param {Integer} zoom The zoom level where 0 is all the way out.
-310 	 */
-311 	'setCenterAndZoom', 
-312 	
-313 	/**
-314 	 * Sets the imagery type for the map
-315 	 * The type can be one of:
-316 	 *  mxn.Mapstraction.ROAD
-317 	 *  mxn.Mapstraction.SATELLITE
-318 	 *  mxn.Mapstraction.HYBRID
-319 	 *  mxn.Mapstraction.PHYSICAL
-320 	 * @name mxn.Mapstraction#setMapType
-321 	 * @function
-322 	 * @param {Number} type 
-323 	 */
-324 	'setMapType', 
-325 	
-326 	/**
-327 	 * Sets the zoom level for the map
-328 	 * 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
-329 	 * TODO: Mapstraction.prototype.getZoomLevels or something.
-330 	 * @name mxn.Mapstraction#setZoom
-331 	 * @function
-332 	 * @param {Number} zoom The (native to the map) level zoom the map to.
-333 	 */
-334 	'setZoom',
-335 	
-336 	/**
-337 	 * Turns a Tile Layer on or off
-338 	 * @name mxn.Mapstraction#toggleTileLayer
-339 	 * @function
-340 	 * @param {tile_url} url of the tile layer that was created.
-341 	 */
-342 	'toggleTileLayer'
-343 ]);
-344 
-345 /**
-346  * Sets the current options to those specified in oOpts and applies them
-347  * @param {Object} oOpts Hash of options to set
-348  */
-349 Mapstraction.prototype.setOptions = function(oOpts){
-350 	mxn.util.merge(this.options, oOpts);
-351 	this.applyOptions();
-352 };
-353 
-354 /**
-355  * Sets an option and applies it.
-356  * @param {String} sOptName Option name
-357  * @param vVal Option value
-358  */
-359 Mapstraction.prototype.setOption = function(sOptName, vVal){
-360 	this.options[sOptName] = vVal;
-361 	this.applyOptions();
-362 };
-363 
-364 /**
-365  * Enable scroll wheel zooming
-366  * @deprecated Use setOption instead.
-367  */
-368 Mapstraction.prototype.enableScrollWheelZoom = function() {
-369 	this.setOption('enableScrollWheelZoom', true);
-370 };
-371 
-372 /**
-373  * Enable/disable dragging of the map
-374  * @param {Boolean} on
-375  * @deprecated Use setOption instead.
-376  */
-377 Mapstraction.prototype.dragging = function(on) {
-378 	this.setOption('enableDragging', on);
-379 };
-380 
-381 /**
-382  * Change the current api on the fly
-383  * @param {String} api The API to swap to
-384  * @param element
-385  */
-386 Mapstraction.prototype.swap = function(element,api) {
-387 	if (this.api === api) {
-388 		return;
-389 	}
-390 
-391 	var center = this.getCenter();
-392 	var zoom = this.getZoom();
-393 
-394 	this.currentElement.style.visibility = 'hidden';
-395 	this.currentElement.style.display = 'none';
-396 
-397 	this.currentElement = $m(element);
-398 	this.currentElement.style.visibility = 'visible';
-399 	this.currentElement.style.display = 'block';
-400 
-401 	this.api = api;
-402 	this.onload[api] = [];
-403 	
-404 	if (this.maps[this.api] === undefined) {	
-405 		init.apply(this);
-406 
-407 		for (var i = 0; i < this.markers.length; i++) {
-408 			this.addMarker(this.markers[i], true);
-409 		}
-410 
-411 		for (var j = 0; j < this.polylines.length; j++) {
-412 			this.addPolyline( this.polylines[j], true);
-413 		}
-414 
-415 		this.setCenterAndZoom(center,zoom);		
-416 	}
-417 	else {
-418 
-419 		//sync the view
-420 		this.setCenterAndZoom(center,zoom);
-421 
-422 		//TODO synchronize the markers and polylines too
-423 		// (any overlays created after api instantiation are not sync'd)
-424 	}
-425 
-426 	this.addControls(this.addControlsArgs);
-427 
-428 };
-429 
-430 /**
-431  * Returns the loaded state of a Map Provider
-432  * @param {String} api Optional API to query for. If not specified, returns state of the originally created API
-433  */
-434 Mapstraction.prototype.isLoaded = function(api){
-435 	if (api === null) {
-436 		api = this.api;
-437 	}
-438 	return this.loaded[api];
-439 };
-440 
-441 /**
-442  * Set the debugging on or off - shows alert panels for functions that don't exist in Mapstraction
-443  * @param {Boolean} debug true to turn on debugging, false to turn it off
-444  */
-445 Mapstraction.prototype.setDebug = function(debug){
-446 	if(debug !== null) {
-447 		this.debug = debug;
-448 	}
-449 	return this.debug;
-450 };
-451 
-452 /**
-453  * Set the api call deferment on or off - When it's on, mxn.invoke will queue up provider API calls until
-454  * runDeferred is called, at which time everything in the queue will be run in the order it was added. 
-455  * @param {Boolean} set deferred to true to turn on deferment
-456  */
-457 Mapstraction.prototype.setDefer = function(deferred){
-458 	this.loaded[this.api] = !deferred;
-459 };
-460 
-461 /**
-462  * Run any queued provider API calls for the methods defined in the provider's implementation.
-463  * For example, if defferable in mxn.[provider].core.js is set to {getCenter: true, setCenter: true}
-464  * then any calls to map.setCenter or map.getCenter will be queued up in this.onload. When the provider's
-465  * implementation loads the map, it calls this.runDeferred and any queued calls will be run.
-466  */
-467 Mapstraction.prototype.runDeferred = function(){
-468 	while(this.onload[this.api].length > 0) {  
-469 		this.onload[this.api].shift().apply(this); //run deferred calls
-470 	}
-471 };
-472 
-473 /////////////////////////
-474 //
-475 // Event Handling
-476 //
-477 // FIXME need to consolidate some of these handlers...
-478 //
-479 ///////////////////////////
-480 
-481 // Click handler attached to native API
-482 Mapstraction.prototype.clickHandler = function(lat, lon, me) {
-483 	this.callEventListeners('click', {
-484 		location: new LatLonPoint(lat, lon)
-485 	});
-486 };
-487 
-488 // Move and zoom handler attached to native API
-489 Mapstraction.prototype.moveendHandler = function(me) {
-490 	this.callEventListeners('moveend', {});
-491 };
-492 
-493 /**
-494  * Add a listener for an event.
-495  * @param {String} type Event type to attach listener to
-496  * @param {Function} func Callback function
-497  * @param {Object} caller Callback object
-498  */
-499 Mapstraction.prototype.addEventListener = function() {
-500 	var listener = {};
-501 	listener.event_type = arguments[0];
-502 	listener.callback_function = arguments[1];
-503 
-504 	// added the calling object so we can retain scope of callback function
-505 	if(arguments.length == 3) {
-506 		listener.back_compat_mode = false;
-507 		listener.callback_object = arguments[2];
-508 	}
-509 	else {
-510 		listener.back_compat_mode = true;
-511 		listener.callback_object = null;
-512 	}
-513 	this.eventListeners.push(listener);
-514 };
-515 
-516 /**
-517  * Call listeners for a particular event.
-518  * @param {String} sEventType Call listeners of this event type
-519  * @param {Object} oEventArgs Event args object to pass back to the callback
-520  */
-521 Mapstraction.prototype.callEventListeners = function(sEventType, oEventArgs) {
-522 	oEventArgs.source = this;
-523 	for(var i = 0; i < this.eventListeners.length; i++) {
-524 		var evLi = this.eventListeners[i];
-525 		if(evLi.event_type == sEventType) {
-526 			// only two cases for this, click and move
-527 			if(evLi.back_compat_mode) {
-528 				if(evLi.event_type == 'click') {
-529 					evLi.callback_function(oEventArgs.location);
-530 				}
-531 				else {
-532 					evLi.callback_function();
-533 				}
-534 			}
-535 			else {
-536 				var scope = evLi.callback_object || this;
-537 				evLi.callback_function.call(scope, oEventArgs);
-538 			}
-539 		}
-540 	}
-541 };
-542 
-543 
-544 ////////////////////
-545 //
-546 // map manipulation
-547 //
-548 /////////////////////
-549 
-550 
-551 /**
-552  * addControls adds controls to the map. You specify which controls to add in
-553  * the associative array that is the only argument.
-554  * addControls can be called multiple time, with different args, to dynamically change controls.
-555  *
-556  * args = {
-557  *	 pan:	  true,
-558  *	 zoom:	 'large' || 'small',
-559  *	 overview: true,
-560  *	 scale:	true,
-561  *	 map_type: true,
-562  * }
-563  * @param {array} args Which controls to switch on
-564  */
-565 Mapstraction.prototype.addControls = function( args ) {
-566 	this.addControlsArgs = args;
-567 	this.invoker.go('addControls', arguments);
-568 };
-569 
-570 /**
-571  * Adds a marker pin to the map
-572  * @param {Marker} marker The marker to add
-573  * @param {Boolean} old If true, doesn't add this marker to the markers array. Used by the "swap" method
-574  */
-575 Mapstraction.prototype.addMarker = function(marker, old) {
-576 	marker.mapstraction = this;
-577 	marker.api = this.api;
-578 	marker.location.api = this.api;
-579 	marker.map = this.maps[this.api]; 
-580 	var propMarker = this.invoker.go('addMarker', arguments);
-581 	marker.setChild(propMarker);
-582 	if (!old) {
-583 		this.markers.push(marker);
-584 	}
-585 	this.markerAdded.fire({'marker': marker});
-586 };
-587 
-588 /**
-589  * addMarkerWithData will addData to the marker, then add it to the map
-590  * @param {Marker} marker The marker to add
-591  * @param {Object} data A data has to add
-592  */
-593 Mapstraction.prototype.addMarkerWithData = function(marker, data) {
-594 	marker.addData(data);
-595 	this.addMarker(marker);
-596 };
-597 
-598 /**
-599  * addPolylineWithData will addData to the polyline, then add it to the map
-600  * @param {Polyline} polyline The polyline to add
-601  * @param {Object} data A data has to add
-602  */
-603 Mapstraction.prototype.addPolylineWithData = function(polyline, data) {
-604 	polyline.addData(data);
-605 	this.addPolyline(polyline);
-606 };
-607 
-608 /**
-609  * removeMarker removes a Marker from the map
-610  * @param {Marker} marker The marker to remove
-611  */
-612 Mapstraction.prototype.removeMarker = function(marker) {	
-613 	var current_marker;
-614 	for(var i = 0; i < this.markers.length; i++){
-615 		current_marker = this.markers[i];
-616 		if(marker == current_marker) {
-617 			this.invoker.go('removeMarker', arguments);
-618 			marker.onmap = false;
-619 			this.markers.splice(i, 1);
-620 			this.markerRemoved.fire({'marker': marker});
-621 			break;
-622 		}
-623 	}
-624 };
-625 
-626 /**
-627  * removeAllMarkers removes all the Markers on a map
-628  */
-629 Mapstraction.prototype.removeAllMarkers = function() {
-630 	var current_marker;
-631 	while(this.markers.length > 0) {
-632 		current_marker = this.markers.pop();
-633 		this.invoker.go('removeMarker', [current_marker]);
-634 	}
-635 };
-636 
-637 /**
-638  * Declutter the markers on the map, group together overlapping markers.
-639  * @param {Object} opts Declutter options
-640  */
-641 Mapstraction.prototype.declutterMarkers = function(opts) {
-642 	if(this.loaded[this.api] === false) {
-643 		var me = this;
-644 		this.onload[this.api].push( function() {
-645 			me.declutterMarkers(opts);
-646 		} );
-647 		return;
-648 	}
-649 
-650 	var map = this.maps[this.api];
-651 
-652 	switch(this.api)
-653 	{
-654 		//	case 'yahoo':
-655 		//
-656 		//	  break;
-657 		//	case 'google':
-658 		//
-659 		//	  break;
-660 		//	case 'openstreetmap':
-661 		//
-662 		//	  break;
-663 		//	case 'microsoft':
-664 		//
-665 		//	  break;
-666 		//	case 'openlayers':
-667 		//
-668 		//	  break;
-669 		case 'multimap':
-670 			/*
-671 			 * Multimap supports quite a lot of decluttering options such as whether
-672 			 * to use an accurate of fast declutter algorithm and what icon to use to
-673 			 * represent a cluster. Using all this would mean abstracting all the enums
-674 			 * etc so we're only implementing the group name function at the moment.
-675 			 */
-676 			map.declutterGroup(opts.groupName);
-677 			break;
-678 		//	case 'mapquest':
-679 		//
-680 		//	  break;
-681 		//	case 'map24':
-682 		//
-683 		//	  break;
-684 		case '  dummy':
-685 			break;
-686 		default:
-687 			if(this.debug) {
-688 				alert(this.api + ' not supported by Mapstraction.declutterMarkers');
-689 			}
-690 	}
-691 };
-692 
-693 /**
-694  * Add a polyline to the map
-695  * @param {Polyline} polyline The Polyline to add to the map
-696  * @param {Boolean} old If true replaces an existing Polyline
-697  */
-698 Mapstraction.prototype.addPolyline = function(polyline, old) {
-699 	polyline.api = this.api;
-700 	polyline.map = this.maps[this.api];
-701 	var propPoly = this.invoker.go('addPolyline', arguments);
-702 	polyline.setChild(propPoly);
-703 	if(!old) {
-704 		this.polylines.push(polyline);
-705 	}
-706 	this.polylineAdded.fire({'polyline': polyline});
-707 };
-708 
-709 // Private remove implementation
-710 var removePolylineImpl = function(polyline) {
-711 	this.invoker.go('removePolyline', arguments);
-712 	polyline.onmap = false;
-713 	this.polylineRemoved.fire({'polyline': polyline});
-714 };
-715 
-716 /**
-717  * Remove the polyline from the map
-718  * @param {Polyline} polyline The Polyline to remove from the map
-719  */
-720 Mapstraction.prototype.removePolyline = function(polyline) {
-721 	var current_polyline;
-722 	for(var i = 0; i < this.polylines.length; i++){
-723 		current_polyline = this.polylines[i];
-724 		if(polyline == current_polyline) {
-725 			this.polylines.splice(i, 1);
-726 			removePolylineImpl.call(this, polyline);
-727 			break;
-728 		}
-729 	}
-730 };
-731 
-732 /**
-733  * Removes all polylines from the map
-734  */
-735 Mapstraction.prototype.removeAllPolylines = function() {
-736 	var current_polyline;
-737 	while(this.polylines.length > 0) {
-738 		current_polyline = this.polylines.pop();
-739 		removePolylineImpl.call(this, current_polyline);
-740 	}
-741 };
-742 
-743 var collectPoints = function(bMarkers, bPolylines, predicate) {
-744 	var points = [];
-745 	
-746 	if (bMarkers) {	
-747 		for (var i = 0; i < this.markers.length; i++) {
-748 			var mark = this.markers[i];
-749 			if (!predicate || predicate(mark)) {
-750 				points.push(mark.location);
-751 			}
-752 		}
-753 	}
-754 	
-755 	if (bPolylines) {
-756 		for(i = 0; i < this.polylines.length; i++) {
-757 			var poly = this.polylines[i];
-758 			if (!predicate || predicate(poly)) {
-759 				for (var j = 0; j < poly.points.length; j++) {
-760 					points.push(poly.points[j]);
-761 				}
-762 			}
-763 		}
-764 	}
-765 	
-766 	return points;
-767 };
-768 
-769 /**
-770  * Sets the center and zoom of the map to the smallest bounding box
-771  * containing all markers and polylines
-772  */
-773 Mapstraction.prototype.autoCenterAndZoom = function() {
-774 	var points = collectPoints.call(this, true, true);
-775 	
-776 	this.centerAndZoomOnPoints(points);
-777 };
-778 
-779 /**
-780  * centerAndZoomOnPoints sets the center and zoom of the map from an array of points
-781  *
-782  * This is useful if you don't want to have to add markers to the map
-783  */
-784 Mapstraction.prototype.centerAndZoomOnPoints = function(points) {
-785 	var bounds = new BoundingBox(90, 180, -90, -180);
-786 
-787 	for (var i = 0, len = points.length; i < len; i++) {
-788 		bounds.extend(points[i]);
-789 	}
-790 
-791 	this.setBounds(bounds);
-792 };
-793 
-794 /**
-795  * Sets the center and zoom of the map to the smallest bounding box
-796  * containing all visible markers and polylines
-797  * will only include markers and polylines with an attribute of "visible"
-798  */
-799 Mapstraction.prototype.visibleCenterAndZoom = function() {
-800 	var predicate = function(obj) {
-801 		return obj.getAttribute("visible");
-802 	};
-803 	var points = collectPoints.call(this, true, true, predicate);
-804 	
-805 	this.centerAndZoomOnPoints(points);
-806 };
-807 
-808 /**
-809  * Automatically sets center and zoom level to show all polylines
-810  * @param {Number} padding Optional number of kilometers to pad around polyline
-811  */
-812 Mapstraction.prototype.polylineCenterAndZoom = function(padding) {
-813 	padding = padding || 0;
-814 	
-815 	var points = collectPoints.call(this, false, true);
-816 	
-817 	if (padding > 0) {
-818 		var padPoints = [];
-819 		for (var i = 0; i < points.length; i++) {
-820 			var point = points[i];
-821 			
-822 			var kmInOneDegreeLat = point.latConv();
-823 			var kmInOneDegreeLon = point.lonConv();
-824 			
-825 			var latPad = padding / kmInOneDegreeLat;
-826 			var lonPad = padding / kmInOneDegreeLon;
-827 
-828 			var ne = new LatLonPoint(point.lat + latPad, point.lon + lonPad);
-829 			var sw = new LatLonPoint(point.lat - latPad, point.lon - lonPad);
-830 			
-831 			padPoints.push(ne, sw);			
-832 		}
-833 		points = points.concat(padPoints);
-834 	}
-835 	
-836 	this.centerAndZoomOnPoints(points);
-837 };
-838 
-839 /**
-840  * addImageOverlay layers an georeferenced image over the map
-841  * @param {id} unique DOM identifier
-842  * @param {src} url of image
-843  * @param {opacity} opacity 0-100
-844  * @param {west} west boundary
-845  * @param {south} south boundary
-846  * @param {east} east boundary
-847  * @param {north} north boundary
-848  */
-849 Mapstraction.prototype.addImageOverlay = function(id, src, opacity, west, south, east, north) {
-850 	
-851 	var b = document.createElement("img");
-852 	b.style.display = 'block';
-853 	b.setAttribute('id',id);
-854 	b.setAttribute('src',src);
-855 	b.style.position = 'absolute';
-856 	b.style.zIndex = 1;
-857 	b.setAttribute('west',west);
-858 	b.setAttribute('south',south);
-859 	b.setAttribute('east',east);
-860 	b.setAttribute('north',north);
-861 	
-862 	var oContext = {
-863 		imgElm: b
-864 	};
-865 	
-866 	this.invoker.go('addImageOverlay', arguments, { context: oContext });
-867 };
-868 
-869 Mapstraction.prototype.setImageOpacity = function(id, opacity) {
-870 	if (opacity < 0) {
-871 		opacity = 0;
-872 	}
-873 	if (opacity >= 100) {
-874 		opacity = 100;
-875 	}
-876 	var c = opacity / 100;
-877 	var d = document.getElementById(id);
-878 	if(typeof(d.style.filter)=='string'){
-879 		d.style.filter='alpha(opacity:'+opacity+')';
-880 	}
-881 	if(typeof(d.style.KHTMLOpacity)=='string'){
-882 		d.style.KHTMLOpacity=c;
-883 	}
-884 	if(typeof(d.style.MozOpacity)=='string'){
-885 		d.style.MozOpacity=c;
-886 	}
-887 	if(typeof(d.style.opacity)=='string'){
-888 		d.style.opacity=c;
-889 	}
-890 };
-891 
-892 Mapstraction.prototype.setImagePosition = function(id) {
-893 	var imgElement = document.getElementById(id);
-894 	var oContext = {
-895 		latLng: { 
-896 			top: imgElement.getAttribute('north'),
-897 			left: imgElement.getAttribute('west'),
-898 			bottom: imgElement.getAttribute('south'),
-899 			right: imgElement.getAttribute('east')
-900 		},
-901 		pixels: { top: 0, right: 0, bottom: 0, left: 0 }
-902 	};
-903 	
-904 	this.invoker.go('setImagePosition', arguments, { context: oContext });
-905 
-906 	imgElement.style.top = oContext.pixels.top.toString() + 'px';
-907 	imgElement.style.left = oContext.pixels.left.toString() + 'px';
-908 	imgElement.style.width = (oContext.pixels.right - oContext.pixels.left).toString() + 'px';
-909 	imgElement.style.height = (oContext.pixels.bottom - oContext.pixels.top).toString() + 'px';
-910 };
-911 
-912 Mapstraction.prototype.addJSON = function(json) {
-913 	var features;
-914 	if (typeof(json) == "string") {
-915 		features = eval('(' + json + ')');
-916 	} else {
-917 		features = json;
-918 	}
-919 	features = features.features;
-920 	var map = this.maps[this.api];
-921 	var html = "";
-922 	var item;
-923 	var polyline;
-924 	var marker;
-925 	var markers = [];
-926 
-927 	if(features.type == "FeatureCollection") {
-928 		this.addJSON(features.features);
-929 	}
-930 
-931 	for (var i = 0; i < features.length; i++) {
-932 		item = features[i];
-933 		switch(item.geometry.type) {
-934 			case "Point":
-935 				html = "<strong>" + item.title + "</strong><p>" + item.description + "</p>";
-936 				marker = new Marker(new LatLonPoint(item.geometry.coordinates[1],item.geometry.coordinates[0]));
-937 				markers.push(marker);
-938 				this.addMarkerWithData(marker,{
-939 					infoBubble : html,
-940 					label : item.title,
-941 					date : "new Date(\""+item.date+"\")",
-942 					iconShadow : item.icon_shadow,
-943 					marker : item.id,
-944 					iconShadowSize : item.icon_shadow_size,
-945 					icon : item.icon,
-946 					iconSize : item.icon_size,
-947 					category : item.source_id,
-948 					draggable : false,
-949 					hover : false
-950 				});
-951 				break;
-952 			case "Polygon":
-953 				var points = [];
-954 				polyline = new Polyline(points);
-955 				mapstraction.addPolylineWithData(polyline,{
-956 					fillColor : item.poly_color,
-957 					date : "new Date(\""+item.date+"\")",
-958 					category : item.source_id,
-959 					width : item.line_width,
-960 					opacity : item.line_opacity,
-961 					color : item.line_color,
-962 					polygon : true
-963 				});
-964 				markers.push(polyline);
-965 				break;
-966 			default:
-967 		// console.log("Geometry: " + features.items[i].geometry.type);
-968 		}
-969 	}
-970 	return markers;
-971 };
-972 
-973 /**
-974  * Adds a Tile Layer to the map
-975  *
-976  * Requires providing a parameterized tile url. Use {Z}, {X}, and {Y} to specify where the parameters
-977  *  should go in the URL.
-978  *
-979  * For example, the OpenStreetMap tiles are:
-980  *  m.addTileLayer("http://tile.openstreetmap.org/{Z}/{X}/{Y}.png", 1.0, "OSM", 1, 19, true);
-981  *
-982  * @param {tile_url} template url of the tiles.
-983  * @param {opacity} opacity of the tile layer - 0 is transparent, 1 is opaque. (default=0.6)
-984  * @param {copyright_text} copyright text to use for the tile layer. (default=Mapstraction)
-985  * @param {min_zoom} Minimum (furtherest out) zoom level that tiles are available (default=1)
-986  * @param {max_zoom} Maximum (closest) zoom level that the tiles are available (default=18)
-987  * @param {map_type} Should the tile layer be a selectable map type in the layers palette (default=false)
-988  */
-989 Mapstraction.prototype.addTileLayer = function(tile_url, opacity, copyright_text, min_zoom, max_zoom, map_type) {
-990 	if(!tile_url) {
-991 		return;
-992 	}
-993 	
-994 	opacity = opacity || 0.6;
-995 	copyright_text = copyright_text || "Mapstraction";
-996 	min_zoom = min_zoom || 1;
-997 	max_zoom = max_zoom || 18;
-998 	map_type = map_type || false;
-999 
-1000 	return this.invoker.go('addTileLayer', [ tile_url, opacity, copyright_text, min_zoom, max_zoom, map_type] );
-1001 };
-1002 
-1003 /**
-1004  * addFilter adds a marker filter
-1005  * @param {field} name of attribute to filter on
-1006  * @param {operator} presently only "ge" or "le"
-1007  * @param {value} the value to compare against
-1008  */
-1009 Mapstraction.prototype.addFilter = function(field, operator, value) {
-1010 	if (!this.filters) {
-1011 		this.filters = [];
-1012 	}
-1013 	this.filters.push( [field, operator, value] );
-1014 };
-1015 
-1016 /**
-1017  * Remove the specified filter
-1018  * @param {Object} field
-1019  * @param {Object} operator
-1020  * @param {Object} value
-1021  */
-1022 Mapstraction.prototype.removeFilter = function(field, operator, value) {
-1023 	if (!this.filters) {
-1024 		return;
-1025 	}
-1026 
-1027 	var del;
-1028 	for (var f=0; f<this.filters.length; f++) {
-1029 		if (this.filters[f][0] == field &&
-1030 			(! operator || (this.filters[f][1] == operator && this.filters[f][2] == value))) {
-1031 			this.filters.splice(f,1);
-1032 			f--; //array size decreased
-1033 		}
-1034 	}
-1035 };
-1036 
-1037 /**
-1038  * Delete the current filter if present; otherwise add it
-1039  * @param {Object} field
-1040  * @param {Object} operator
-1041  * @param {Object} value
-1042  */
-1043 Mapstraction.prototype.toggleFilter = function(field, operator, value) {
-1044 	if (!this.filters) {
-1045 		this.filters = [];
-1046 	}
-1047 
-1048 	var found = false;
-1049 	for (var f = 0; f < this.filters.length; f++) {
-1050 		if (this.filters[f][0] == field && this.filters[f][1] == operator && this.filters[f][2] == value) {
-1051 			this.filters.splice(f,1);
-1052 			f--; //array size decreased
-1053 			found = true;
-1054 		}
-1055 	}
-1056 
-1057 	if (! found) {
-1058 		this.addFilter(field, operator, value);
-1059 	}
-1060 };
-1061 
-1062 /**
-1063  * removeAllFilters
-1064  */
-1065 Mapstraction.prototype.removeAllFilters = function() {
-1066 	this.filters = [];
-1067 };
-1068 
-1069 /**
-1070  * doFilter executes all filters added since last call
-1071  * Now supports a callback function for when a marker is shown or hidden
-1072  * @param {Function} showCallback
-1073  * @param {Function} hideCallback
-1074  * @returns {Int} count of visible markers
-1075  */
-1076 Mapstraction.prototype.doFilter = function(showCallback, hideCallback) {
-1077 	var map = this.maps[this.api];
-1078 	var visibleCount = 0;
-1079 	var f;
-1080 	if (this.filters) {
-1081 		switch (this.api) {
-1082 			case 'multimap':
-1083 				/* TODO polylines aren't filtered in multimap */
-1084 				var mmfilters = [];
-1085 				for (f=0; f<this.filters.length; f++) {
-1086 					mmfilters.push( new MMSearchFilter( this.filters[f][0], this.filters[f][1], this.filters[f][2] ));
-1087 				}
-1088 				map.setMarkerFilters( mmfilters );
-1089 				map.redrawMap();
-1090 				break;
-1091 			case '  dummy':
-1092 				break;
-1093 			default:
-1094 				var vis;
-1095 				for (var m=0; m<this.markers.length; m++) {
-1096 					vis = true;
-1097 					for (f = 0; f < this.filters.length; f++) {
-1098 						if (! this.applyFilter(this.markers[m], this.filters[f])) {
-1099 							vis = false;
-1100 						}
-1101 					}
-1102 					if (vis) {
-1103 						visibleCount ++;
-1104 						if (showCallback){
-1105 							showCallback(this.markers[m]);
-1106 						}
-1107 						else {
-1108 							this.markers[m].show();
-1109 						}
-1110 					} 
-1111 					else { 
-1112 						if (hideCallback){
-1113 							hideCallback(this.markers[m]);
-1114 						}
-1115 						else {
-1116 							this.markers[m].hide();
-1117 						}
-1118 					}
-1119 
-1120 					this.markers[m].setAttribute("visible", vis);
-1121 				}
-1122 				break;
-1123 		}
-1124 	}
-1125 	return visibleCount;
-1126 };
-1127 
-1128 Mapstraction.prototype.applyFilter = function(o, f) {
-1129 	var vis = true;
-1130 	switch (f[1]) {
-1131 		case 'ge':
-1132 			if (o.getAttribute( f[0] ) < f[2]) {
-1133 				vis = false;
-1134 			}
-1135 			break;
-1136 		case 'le':
-1137 			if (o.getAttribute( f[0] ) > f[2]) {
-1138 				vis = false;
-1139 			}
-1140 			break;
-1141 		case 'eq':
-1142 			if (o.getAttribute( f[0] ) == f[2]) {
-1143 				vis = false;
-1144 			}
-1145 			break;
-1146 	}
-1147 
-1148 	return vis;
-1149 };
-1150 
-1151 /**
-1152  * getAttributeExtremes returns the minimum/maximum of "field" from all markers
-1153  * @param {field} name of "field" to query
-1154  * @returns {array} of minimum/maximum
-1155  */
-1156 Mapstraction.prototype.getAttributeExtremes = function(field) {
-1157 	var min;
-1158 	var max;
-1159 	for (var m=0; m<this.markers.length; m++) {
-1160 		if (! min || min > this.markers[m].getAttribute(field)) {
-1161 			min = this.markers[m].getAttribute(field);
-1162 		}
-1163 		if (! max || max < this.markers[m].getAttribute(field)) {
-1164 			max = this.markers[m].getAttribute(field);
-1165 		}
-1166 	}
-1167 	for (var p=0; m<this.polylines.length; m++) {
-1168 		if (! min || min > this.polylines[p].getAttribute(field)) {
-1169 			min = this.polylines[p].getAttribute(field);
-1170 		}
-1171 		if (! max || max < this.polylines[p].getAttribute(field)) {
-1172 			max = this.polylines[p].getAttribute(field);
-1173 		}
-1174 	}
-1175 
-1176 	return [min, max];
-1177 };
-1178 
-1179 /**
-1180  * getMap returns the native map object that mapstraction is talking to
-1181  * @returns the native map object mapstraction is using
-1182  */
-1183 Mapstraction.prototype.getMap = function() {
-1184 	// FIXME in an ideal world this shouldn't exist right?
-1185 	return this.maps[this.api];
-1186 };
-1187 
-1188 
-1189 //////////////////////////////
-1190 //
-1191 //   LatLonPoint
-1192 //
-1193 /////////////////////////////
-1194 
-1195 /**
-1196  * LatLonPoint is a point containing a latitude and longitude with helper methods
-1197  * @name mxn.LatLonPoint
-1198  * @constructor
-1199  * @param {double} lat is the latitude
-1200  * @param {double} lon is the longitude
-1201  * @exports LatLonPoint as mxn.LatLonPoint
-1202  */
-1203 var LatLonPoint = mxn.LatLonPoint = function(lat, lon) {	
-1204 	this.lat = Number(lat); // force to be numeric
-1205 	this.lon = Number(lon);
-1206 	this.lng = this.lon; // lets be lon/lng agnostic
-1207 	
-1208 	this.invoker = new mxn.Invoker(this, 'LatLonPoint');		
-1209 };
-1210 
-1211 mxn.addProxyMethods(LatLonPoint, [ 
-1212 	/**
-1213 	 * Retrieve the lat and lon values from a proprietary point.
-1214 	 * @name mxn.LatLonPoint#fromProprietary
-1215 	 * @function
-1216 	 * @param {String} apiId The API ID of the proprietary point.
-1217 	 * @param {Object} point The proprietary point.
-1218 	 */
-1219 	'fromProprietary',
-1220 	
-1221 	/**
-1222 	 * Converts the current LatLonPoint to a proprietary one for the API specified by apiId.
-1223 	 * @name mxn.LatLonPoint#toProprietary
-1224 	 * @function
-1225 	 * @param {String} apiId The API ID of the proprietary point.
-1226 	 * @returns A proprietary point.
-1227 	 */
-1228 	'toProprietary'
-1229 ], true);
-1230 
-1231 /**
-1232  * toString returns a string represntation of a point
-1233  * @returns a string like '51.23, -0.123'
-1234  * @type String
-1235  */
-1236 LatLonPoint.prototype.toString = function() {
-1237 	return this.lat + ', ' + this.lon;
-1238 };
-1239 
-1240 /**
-1241  * distance returns the distance in kilometers between two points
-1242  * @param {LatLonPoint} otherPoint The other point to measure the distance from to this one
-1243  * @returns the distance between the points in kilometers
-1244  * @type double
-1245  */
-1246 LatLonPoint.prototype.distance = function(otherPoint) {
-1247 	// Uses Haversine formula from http://www.movable-type.co.uk
-1248 	var rads = Math.PI / 180;
-1249 	var diffLat = (this.lat-otherPoint.lat) * rads;
-1250 	var diffLon = (this.lon-otherPoint.lon) * rads; 
-1251 	var a = Math.sin(diffLat / 2) * Math.sin(diffLat / 2) +
-1252 		Math.cos(this.lat*rads) * Math.cos(otherPoint.lat*rads) * 
-1253 		Math.sin(diffLon/2) * Math.sin(diffLon/2); 
-1254 	return 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)) * 6371; // Earth's mean radius in km
-1255 };
-1256 
-1257 /**
-1258  * equals tests if this point is the same as some other one
-1259  * @param {LatLonPoint} otherPoint The other point to test with
-1260  * @returns true or false
-1261  * @type boolean
-1262  */
-1263 LatLonPoint.prototype.equals = function(otherPoint) {
-1264 	return this.lat == otherPoint.lat && this.lon == otherPoint.lon;
-1265 };
-1266 
-1267 /**
-1268  * Returns latitude conversion based on current projection
-1269  * @returns {Float} conversion
-1270  */
-1271 LatLonPoint.prototype.latConv = function() {
-1272 	return this.distance(new LatLonPoint(this.lat + 0.1, this.lon))*10;
-1273 };
-1274 
-1275 /**
-1276  * Returns longitude conversion based on current projection
-1277  * @returns {Float} conversion
-1278  */
-1279 LatLonPoint.prototype.lonConv = function() {
-1280 	return this.distance(new LatLonPoint(this.lat, this.lon + 0.1))*10;
-1281 };
-1282 
-1283 
-1284 //////////////////////////
-1285 //
-1286 //  BoundingBox
-1287 //
-1288 //////////////////////////
-1289 
-1290 /**
-1291  * BoundingBox creates a new bounding box object
-1292  * @name mxn.BoundingBox
-1293  * @constructor
-1294  * @param {double} swlat the latitude of the south-west point
-1295  * @param {double} swlon the longitude of the south-west point
-1296  * @param {double} nelat the latitude of the north-east point
-1297  * @param {double} nelon the longitude of the north-east point
-1298  * @exports BoundingBox as mxn.BoundingBox
-1299  */
-1300 var BoundingBox = mxn.BoundingBox = function(swlat, swlon, nelat, nelon) {
-1301 	//FIXME throw error if box bigger than world
-1302 	this.sw = new LatLonPoint(swlat, swlon);
-1303 	this.ne = new LatLonPoint(nelat, nelon);
-1304 };
-1305 
-1306 /**
-1307  * getSouthWest returns a LatLonPoint of the south-west point of the bounding box
-1308  * @returns the south-west point of the bounding box
-1309  * @type LatLonPoint
-1310  */
-1311 BoundingBox.prototype.getSouthWest = function() {
-1312 	return this.sw;
-1313 };
-1314 
-1315 /**
-1316  * getNorthEast returns a LatLonPoint of the north-east point of the bounding box
-1317  * @returns the north-east point of the bounding box
-1318  * @type LatLonPoint
-1319  */
-1320 BoundingBox.prototype.getNorthEast = function() {
-1321 	return this.ne;
-1322 };
-1323 
-1324 /**
-1325  * isEmpty finds if this bounding box has zero area
-1326  * @returns whether the north-east and south-west points of the bounding box are the same point
-1327  * @type boolean
-1328  */
-1329 BoundingBox.prototype.isEmpty = function() {
-1330 	return this.ne == this.sw; // is this right? FIXME
-1331 };
-1332 
-1333 /**
-1334  * contains finds whether a given point is within a bounding box
-1335  * @param {LatLonPoint} point the point to test with
-1336  * @returns whether point is within this bounding box
-1337  * @type boolean
-1338  */
-1339 BoundingBox.prototype.contains = function(point){
-1340 	return point.lat >= this.sw.lat && point.lat <= this.ne.lat && point.lon >= this.sw.lon && point.lon <= this.ne.lon;
-1341 };
-1342 
-1343 /**
-1344  * toSpan returns a LatLonPoint with the lat and lon as the height and width of the bounding box
-1345  * @returns a LatLonPoint containing the height and width of this bounding box
-1346  * @type LatLonPoint
-1347  */
-1348 BoundingBox.prototype.toSpan = function() {
-1349 	return new LatLonPoint( Math.abs(this.sw.lat - this.ne.lat), Math.abs(this.sw.lon - this.ne.lon) );
-1350 };
-1351 
-1352 
-1353 
-1354 /**
-1355  * extend extends the bounding box to include the new point
-1356  */
-1357 BoundingBox.prototype.extend = function(point) {
-1358 	if (this.sw.lat > point.lat) {
-1359 		this.sw.lat = point.lat;
-1360 	}
-1361 	if (this.sw.lon > point.lon) {
-1362 		this.sw.lon = point.lon;
-1363 	}
-1364 	if (this.ne.lat < point.lat) {
-1365 		this.ne.lat = point.lat;
-1366 	}
-1367 	if (this.ne.lon < point.lon) {
-1368 		this.ne.lon = point.lon;
-1369 	}
-1370 	return;
-1371 };
-1372 
-1373 //////////////////////////////
-1374 //
-1375 //  Marker
-1376 //
-1377 ///////////////////////////////
-1378 
-1379 /**
-1380  * Marker create's a new marker pin
-1381  * @name mxn.Marker
-1382  * @constructor
-1383  * @param {LatLonPoint} point the point on the map where the marker should go
-1384  * @exports Marker as mxn.Marker
-1385  */
-1386 var Marker = mxn.Marker = function(point) {
-1387 	this.api = null;
-1388 	this.location = point;
-1389 	this.onmap = false;
-1390 	this.proprietary_marker = false;
-1391 	this.attributes = [];
-1392 	this.invoker = new mxn.Invoker(this, 'Marker', function(){return this.api;});
-1393 	mxn.addEvents(this, [ 
-1394 		'openInfoBubble',	// Info bubble opened
-1395 		'closeInfoBubble', 	// Info bubble closed
-1396 		'click'				// Marker clicked
-1397 	]);
-1398 };
-1399 
-1400 mxn.addProxyMethods(Marker, [ 
-1401 	/**
-1402 	 * Retrieve the settings from a proprietary marker.
-1403 	 * @name mxn.Marker#fromProprietary
-1404 	 * @function
-1405 	 * @param {String} apiId The API ID of the proprietary point.
-1406 	 * @param {Object} marker The proprietary marker.
-1407 	 */
-1408 	'fromProprietary',
-1409 	
-1410 	/**
-1411 	 * Hide the marker.
-1412 	 * @name mxn.Marker#hide
-1413 	 * @function
-1414 	 */
-1415 	'hide',
-1416 	
-1417 	/**
-1418 	 * Open the marker's info bubble.
-1419 	 * @name mxn.Marker#openBubble
-1420 	 * @function
-1421 	 */
-1422 	'openBubble',
-1423 	
-1424 	/**
-1425 	 * Closes the marker's info bubble.
-1426 	 * @name mxn.Marker#closeBubble
-1427 	 * @function
-1428 	 */
-1429 	'closeBubble',
-1430 	
-1431 	/**
-1432 	 * Show the marker.
-1433 	 * @name mxn.Marker#show
-1434 	 * @function
-1435 	 */
-1436 	'show',
-1437 	
-1438 	/**
-1439 	 * Converts the current Marker to a proprietary one for the API specified by apiId.
-1440 	 * @name mxn.Marker#toProprietary
-1441 	 * @function
-1442 	 * @param {String} apiId The API ID of the proprietary marker.
-1443 	 * @returns A proprietary marker.
-1444 	 */
-1445 	'toProprietary',
-1446 	
-1447 	/**
-1448 	 * Updates the Marker with the location of the attached proprietary marker on the map.
-1449 	 * @name mxn.Marker#update
-1450 	 * @function
-1451 	 */
-1452 	'update'
-1453 ]);
-1454 
-1455 Marker.prototype.setChild = function(some_proprietary_marker) {
-1456 	this.proprietary_marker = some_proprietary_marker;
-1457 	some_proprietary_marker.mapstraction_marker = this;
-1458 	this.onmap = true;
-1459 };
-1460 
-1461 Marker.prototype.setLabel = function(labelText) {
-1462 	this.labelText = labelText;
-1463 };
-1464 
-1465 /**
-1466  * addData conviniently set a hash of options on a marker
-1467  * @param {Object} options An object literal hash of key value pairs. Keys are: label, infoBubble, icon, iconShadow, infoDiv, draggable, hover, hoverIcon, openBubble, groupName.
-1468  */
-1469 Marker.prototype.addData = function(options){
-1470 	for(var sOptKey in options) {
-1471 		if(options.hasOwnProperty(sOptKey)){
-1472 			switch(sOptKey) {
-1473 				case 'label':
-1474 					this.setLabel(options.label);
-1475 					break;
-1476 				case 'infoBubble':
-1477 					this.setInfoBubble(options.infoBubble);
-1478 					break;
-1479 				case 'icon':
-1480 					if(options.iconSize && options.iconAnchor) {
-1481 						this.setIcon(options.icon, options.iconSize, options.iconAnchor);
-1482 					}
-1483 					else if(options.iconSize) {
-1484 						this.setIcon(options.icon, options.iconSize);
-1485 					}
-1486 					else {
-1487 						this.setIcon(options.icon);
-1488 					}
-1489 					break;
-1490 				case 'iconShadow':
-1491 					if(options.iconShadowSize) {
-1492 						this.setShadowIcon(options.iconShadow, [ options.iconShadowSize[0], options.iconShadowSize[1] ]);
-1493 					}
-1494 					else {
-1495 						this.setIcon(options.iconShadow);
-1496 					}
-1497 					break;
-1498 				case 'infoDiv':
-1499 					this.setInfoDiv(options.infoDiv[0],options.infoDiv[1]);
-1500 					break;
-1501 				case 'draggable':
-1502 					this.setDraggable(options.draggable);
-1503 					break;
-1504 				case 'hover':
-1505 					this.setHover(options.hover);
-1506 					this.setHoverIcon(options.hoverIcon);
-1507 					break;
-1508 				case 'hoverIcon':
-1509 					this.setHoverIcon(options.hoverIcon);
-1510 					break;
-1511 				case 'openBubble':
-1512 					this.openBubble();
-1513 					break;
-1514 				case 'closeBubble':
-1515 					this.closeBubble();
-1516 					break;
-1517 				case 'groupName':
-1518 					this.setGroupName(options.groupName);
-1519 					break;
-1520 				default:
-1521 					// don't have a specific action for this bit of
-1522 					// data so set a named attribute
-1523 					this.setAttribute(sOptKey, options[sOptKey]);
-1524 					break;
-1525 			}
-1526 		}
-1527 	}
-1528 };
-1529 
-1530 /**
-1531  * Sets the html/text content for a bubble popup for a marker
-1532  * @param {String} infoBubble the html/text you want displayed
-1533  */
-1534 Marker.prototype.setInfoBubble = function(infoBubble) {
-1535 	this.infoBubble = infoBubble;
-1536 };
-1537 
-1538 /**
-1539  * Sets the text and the id of the div element where to the information
-1540  * useful for putting information in a div outside of the map
-1541  * @param {String} infoDiv the html/text you want displayed
-1542  * @param {String} div the element id to use for displaying the text/html
-1543  */
-1544 Marker.prototype.setInfoDiv = function(infoDiv,div){
-1545 	this.infoDiv = infoDiv;
-1546 	this.div = div;
-1547 };
-1548 
-1549 /**
-1550  * Sets the icon for a marker
-1551  * @param {String} iconUrl The URL of the image you want to be the icon
-1552  */
-1553 Marker.prototype.setIcon = function(iconUrl, iconSize, iconAnchor) {
-1554 	this.iconUrl = iconUrl;
-1555 	if(iconSize) {
-1556 		this.iconSize = iconSize;
-1557 	}
-1558 	if(iconAnchor) {
-1559 		this.iconAnchor = iconAnchor;
-1560 	}
-1561 };
-1562 
-1563 /**
-1564  * Sets the size of the icon for a marker
-1565  * @param {Array} iconSize The array size in pixels of the marker image: [ width, height ]
-1566  */
-1567 Marker.prototype.setIconSize = function(iconSize){
-1568 	if(iconSize) {
-1569 		this.iconSize = iconSize;
-1570 	}
-1571 };
-1572 
-1573 /**
-1574  * Sets the anchor point for a marker
-1575  * @param {Array} iconAnchor The array offset in pixels of the anchor point from top left: [ right, down ]
-1576  */
-1577 Marker.prototype.setIconAnchor = function(iconAnchor){
-1578 	if(iconAnchor) {
-1579 		this.iconAnchor = iconAnchor;
-1580 	}
-1581 };
-1582 
-1583 /**
-1584  * Sets the icon for a marker
-1585  * @param {String} iconUrl The URL of the image you want to be the icon
-1586  */
-1587 Marker.prototype.setShadowIcon = function(iconShadowUrl, iconShadowSize){
-1588 	this.iconShadowUrl = iconShadowUrl;
-1589 	if(iconShadowSize) {
-1590 		this.iconShadowSize = iconShadowSize;
-1591 	}
-1592 };
-1593 
-1594 Marker.prototype.setHoverIcon = function(hoverIconUrl){
-1595 	this.hoverIconUrl = hoverIconUrl;
-1596 };
-1597 
-1598 /**
-1599  * Sets the draggable state of the marker
-1600  * @param {Bool} draggable set to true if marker should be draggable by the user
-1601  */
-1602 Marker.prototype.setDraggable = function(draggable) {
-1603 	this.draggable = draggable;
-1604 };
-1605 
-1606 /**
-1607  * Sets that the marker info is displayed on hover
-1608  * @param {Boolean} hover set to true if marker should display info on hover
-1609  */
-1610 Marker.prototype.setHover = function(hover) {
-1611 	this.hover = hover;
-1612 };
-1613 
-1614 /**
-1615  * Markers are grouped up by this name. declutterGroup makes use of this.
-1616  */
-1617 Marker.prototype.setGroupName = function(sGrpName) {
-1618 	this.groupName = sGrpName;
-1619 };
-1620 
-1621 /**
-1622  * Set an arbitrary key/value pair on a marker
-1623  * @param {String} key
-1624  * @param value
-1625  */
-1626 Marker.prototype.setAttribute = function(key,value) {
-1627 	this.attributes[key] = value;
-1628 };
-1629 
-1630 /**
-1631  * getAttribute: gets the value of "key"
-1632  * @param {String} key
-1633  * @returns value
-1634  */
-1635 Marker.prototype.getAttribute = function(key) {
-1636 	return this.attributes[key];
-1637 };
-1638 
-1639 
-1640 ///////////////
-1641 // Polyline ///
-1642 ///////////////
-1643 
-1644 /**
-1645  * Instantiates a new Polyline.
-1646  * @name mxn.Polyline
-1647  * @constructor
-1648  * @param {Point[]} points Points that make up the Polyline.
-1649  * @exports Polyline as mxn.Polyline
-1650  */
-1651 var Polyline = mxn.Polyline = function(points) {
-1652 	this.api = null;
-1653 	this.points = points;
-1654 	this.attributes = [];
-1655 	this.onmap = false;
-1656 	this.proprietary_polyline = false;
-1657 	this.pllID = "mspll-"+new Date().getTime()+'-'+(Math.floor(Math.random()*Math.pow(2,16)));
-1658 	this.invoker = new mxn.Invoker(this, 'Polyline', function(){return this.api;});
-1659 };
-1660 
-1661 mxn.addProxyMethods(Polyline, [ 
-1662 
-1663 	/**
-1664 	 * Retrieve the settings from a proprietary polyline.
-1665 	 * @name mxn.Polyline#fromProprietary
-1666 	 * @function
-1667 	 * @param {String} apiId The API ID of the proprietary polyline.
-1668 	 * @param {Object} polyline The proprietary polyline.
-1669 	 */
-1670 	'fromProprietary', 
-1671 	
-1672 	/**
-1673 	 * Hide the polyline.
-1674 	 * @name mxn.Polyline#hide
-1675 	 * @function
-1676 	 */
-1677 	'hide',
-1678 	
-1679 	/**
-1680 	 * Show the polyline.
-1681 	 * @name mxn.Polyline#show
-1682 	 * @function
-1683 	 */
-1684 	'show',
-1685 	
-1686 	/**
-1687 	 * Converts the current Polyline to a proprietary one for the API specified by apiId.
-1688 	 * @name mxn.Polyline#toProprietary
-1689 	 * @function
-1690 	 * @param {String} apiId The API ID of the proprietary polyline.
-1691 	 * @returns A proprietary polyline.
-1692 	 */
-1693 	'toProprietary',
-1694 	
-1695 	/**
-1696 	 * Updates the Polyline with the path of the attached proprietary polyline on the map.
-1697 	 * @name mxn.Polyline#update
-1698 	 * @function
-1699 	 */
-1700 	'update'
-1701 ]);
-1702 
-1703 /**
-1704  * addData conviniently set a hash of options on a polyline
-1705  * @param {Object} options An object literal hash of key value pairs. Keys are: color, width, opacity, closed, fillColor.
-1706  */
-1707 Polyline.prototype.addData = function(options){
-1708 	for(var sOpt in options) {
-1709 		if(options.hasOwnProperty(sOpt)){
-1710 			switch(sOpt) {
-1711 				case 'color':
-1712 					this.setColor(options.color);
-1713 					break;
-1714 				case 'width':
-1715 					this.setWidth(options.width);
-1716 					break;
-1717 				case 'opacity':
-1718 					this.setOpacity(options.opacity);
-1719 					break;
-1720 				case 'closed':
-1721 					this.setClosed(options.closed);
-1722 					break;
-1723 				case 'fillColor':
-1724 					this.setFillColor(options.fillColor);
-1725 					break;
-1726 				default:
-1727 					this.setAttribute(sOpt, options[sOpt]);
-1728 					break;
-1729 			}
-1730 		}
-1731 	}
-1732 };
-1733 
-1734 Polyline.prototype.setChild = function(some_proprietary_polyline) {
-1735 	this.proprietary_polyline = some_proprietary_polyline;
-1736 	this.onmap = true;
-1737 };
-1738 
-1739 /**
-1740  * in the form: #RRGGBB
-1741  * Note map24 insists on upper case, so we convert it.
-1742  */
-1743 Polyline.prototype.setColor = function(color){
-1744 	this.color = (color.length==7 && color[0]=="#") ? color.toUpperCase() : color;
-1745 };
-1746 
-1747 /**
-1748  * Stroke width of the polyline
-1749  * @param {Integer} width
-1750  */
-1751 Polyline.prototype.setWidth = function(width){
-1752 	this.width = width;
-1753 };
-1754 
-1755 /**
-1756  * A float between 0.0 and 1.0
-1757  * @param {Float} opacity
-1758  */
-1759 Polyline.prototype.setOpacity = function(opacity){
-1760 	this.opacity = opacity;
-1761 };
-1762 
-1763 /**
-1764  * Marks the polyline as a closed polygon
-1765  * @param {Boolean} bClosed
-1766  */
-1767 Polyline.prototype.setClosed = function(bClosed){
-1768 	this.closed = bClosed;
-1769 };
-1770 
-1771 /**
-1772  * Fill color for a closed polyline as HTML color value e.g. #RRGGBB
-1773  * @param {String} sFillColor HTML color value #RRGGBB
-1774  */
-1775 Polyline.prototype.setFillColor = function(sFillColor) {
-1776 	this.fillColor = sFillColor;
-1777 };
-1778 
-1779 
-1780 /**
-1781  * Set an arbitrary key/value pair on a polyline
-1782  * @param {String} key
-1783  * @param value
-1784  */
-1785 Polyline.prototype.setAttribute = function(key,value) {
-1786 	this.attributes[key] = value;
-1787 };
-1788 
-1789 /**
-1790  * Gets the value of "key"
-1791  * @param {String} key
-1792  * @returns value
-1793  */
-1794 Polyline.prototype.getAttribute = function(key) {
-1795 	return this.attributes[key];
-1796 };
-1797 
-1798 /**
-1799  * Simplifies a polyline, averaging and reducing the points
-1800  * @param {Number} tolerance (1.0 is a good starting point)
-1801  */
-1802 Polyline.prototype.simplify = function(tolerance) {
-1803 	var reduced = [];
-1804 
-1805 	// First point
-1806 	reduced[0] = this.points[0];
-1807 
-1808 	var markerPoint = 0;
-1809 
-1810 	for (var i = 1; i < this.points.length-1; i++){
-1811 		if (this.points[i].distance(this.points[markerPoint]) >= tolerance)
-1812 		{
-1813 			reduced[reduced.length] = this.points[i];
-1814 			markerPoint = i;
-1815 		}
-1816 	}
-1817 
-1818 	// Last point
-1819 	reduced[reduced.length] = this.points[this.points.length-1];
-1820 
-1821 	// Revert
-1822 	this.points = reduced;
-1823 };
-1824 
-1825 ///////////////
-1826 // Radius	//
-1827 ///////////////
-1828 
-1829 /**
-1830  * Creates a new radius object for drawing circles around a point, does a lot of initial calculation to increase load time
-1831  * @name mxn.Radius
-1832  * @constructor
-1833  * @param {LatLonPoint} center LatLonPoint of the radius
-1834  * @param {Number} quality Number of points that comprise the approximated circle (20 is a good starting point)
-1835  * @exports Radius as mxn.Radius
-1836  */
-1837 var Radius = mxn.Radius = function(center, quality) {
-1838 	this.center = center;
-1839 	var latConv = center.latConv();
-1840 	var lonConv = center.lonConv();
-1841 
-1842 	// Create Radian conversion constant
-1843 	var rad = Math.PI / 180;
-1844 	this.calcs = [];
-1845 
-1846 	for(var i = 0; i < 360; i += quality){
-1847 		this.calcs.push([Math.cos(i * rad) / latConv, Math.sin(i * rad) / lonConv]);
-1848 	}
-1849 };
-1850 
-1851 /**
-1852  * Returns polyline of a circle around the point based on new radius
-1853  * @param {Radius} radius
-1854  * @param {Color} color
-1855  * @returns {Polyline} Polyline
-1856  */
-1857 Radius.prototype.getPolyline = function(radius, color) {
-1858 	var points = [];
-1859 
-1860 	for(var i = 0; i < this.calcs.length; i++){
-1861 		var point = new LatLonPoint(
-1862 			this.center.lat + (radius * this.calcs[i][0]),
-1863 			this.center.lon + (radius * this.calcs[i][1])
-1864 		);
-1865 		points.push(point);
-1866 	}
-1867 	
-1868 	// Add first point
-1869 	points.push(points[0]);
-1870 
-1871 	var line = new Polyline(points);
-1872 	line.setColor(color);
-1873 
-1874 	return line;
-1875 };
-1876 
-1877 
-1878 })();
-1879 
\ No newline at end of file diff --git a/demoplanner/js/mapstraction/docs/symbols/src/H__Projects_mapstraction-2.0_git_mapstraction_mxn_build_2.0.18_mxn.geocoder.js.html b/demoplanner/js/mapstraction/docs/symbols/src/H__Projects_mapstraction-2.0_git_mapstraction_mxn_build_2.0.18_mxn.geocoder.js.html deleted file mode 100644 index d4fdf80ffc..0000000000 --- a/demoplanner/js/mapstraction/docs/symbols/src/H__Projects_mapstraction-2.0_git_mapstraction_mxn_build_2.0.18_mxn.geocoder.js.html +++ /dev/null @@ -1,67 +0,0 @@ -
  1 (function(){
-  2 
-  3 /**
-  4  * Initialise our provider. This function should only be called 
-  5  * from within mapstraction code, not exposed as part of the API.
-  6  * @private
-  7  */
-  8 var init = function() {
-  9 	this.invoker.go('init');
- 10 };
- 11 
- 12 /**
- 13  * Geocoder instantiates a geocoder with some API choice
- 14  * @name mxn.Geocoder
- 15  * @constructor
- 16  * @param {String} api The API to use, currently only 'mapquest' is supported
- 17  * @param {Function} callback The function to call when a geocode request returns (function(waypoint))
- 18  * @param {Function} error_callback The optional function to call when a geocode request fails
- 19  * @exports Geocoder as mxn.Geocoder
- 20  */
- 21 var Geocoder = mxn.Geocoder = function (api, callback, error_callback) {
- 22 	this.api = api;
- 23 	this.geocoders = {};
- 24 	this.callback = callback;
- 25 	this.error_callback = error_callback || function(){};
- 26 	  
- 27 	// set up our invoker for calling API methods
- 28 	this.invoker = new mxn.Invoker(this, 'Geocoder', function(){ return this.api; });
- 29 	init.apply(this);
- 30 };
- 31 
- 32 mxn.addProxyMethods(Geocoder, [
- 33 	
- 34 	/**
- 35 	 * Geocodes the provided address.
- 36 	 * @name mxn.Geocoder#geocode
- 37 	 * @function
- 38 	 * @param {Object} address Address hash, keys are: street, locality, region, country.
- 39 	 */
- 40 	'geocode',
- 41 	
- 42 	'geocode_callback'
- 43 
- 44 ]);
- 45 
- 46 /**
- 47  * Change the geocoding API in use
- 48  * @name mxn.Geocoder#swap
- 49  * @param {String} api The API to swap to
- 50  */
- 51 Geocoder.prototype.swap = function(api) {
- 52 	if (this.api == api) { return; }
- 53 
- 54 	this.api = api;
- 55 	if (!this.geocoders.hasOwnProperty(this.api)) {
- 56 		init.apply(this);
- 57 	}
- 58 };
- 59 
- 60 })();
\ No newline at end of file diff --git a/demoplanner/js/mapstraction/docs/symbols/src/H__Projects_mapstraction-2.0_git_mapstraction_mxn_build_2.0.18_mxn.js.html b/demoplanner/js/mapstraction/docs/symbols/src/H__Projects_mapstraction-2.0_git_mapstraction_mxn_build_2.0.18_mxn.js.html deleted file mode 100644 index ad65952e4c..0000000000 --- a/demoplanner/js/mapstraction/docs/symbols/src/H__Projects_mapstraction-2.0_git_mapstraction_mxn_build_2.0.18_mxn.js.html +++ /dev/null @@ -1,575 +0,0 @@ -
  1 // Auto-load scripts
-  2 //
-  3 // specify which map providers to load by using
-  4 // <script src="mxn.js?(provider1,provider2,[module1,module2])" ...
-  5 // in your HTML
-  6 //
-  7 // for each provider mxn.provider.module.js and mxn.module.js will be loaded
-  8 // module 'core' is always loaded
-  9 //
- 10 // NOTE: if you call without providers
- 11 // <script src="mxn.js" ...
- 12 // no scripts will be loaded at all and it is then up to you to load the scripts independently
- 13 (function() {
- 14 	var providers = null;
- 15 	var modules = 'core';
- 16 	var scriptBase;
- 17 	var scripts = document.getElementsByTagName('script');
- 18 
- 19 	// Determine which scripts we need to load	
- 20 	for (var i = 0; i < scripts.length; i++) {
- 21 		var match = scripts[i].src.replace(/%20/g , '').match(/^(.*?)mxn\.js(\?\(\[?(.*?)\]?\))?$/);
- 22 		if (match !== null) {
- 23 			scriptBase = match[1];
- 24 			if (match[3]) {
- 25 				var settings = match[3].split(',[');
- 26 				providers = settings[0].replace(']' , '');
- 27 				if (settings[1]) {
- 28 					modules += ',' + settings[1];
- 29 				}
- 30 			}
- 31 			break;
- 32 	   }
- 33 	}
- 34 	
- 35 	if (providers === null || providers == 'none') {
- 36 		return; // Bail out if no auto-load has been found
- 37 	}
- 38 	providers = providers.replace(/ /g, '').split(',');
- 39 	modules = modules.replace(/ /g, '').split(',');
- 40 
- 41 	// Actually load the scripts
- 42 	var scriptTagStart = '<script type="text/javascript" src="' + scriptBase + 'mxn.';
- 43 	var scriptTagEnd = '.js"></script>';
- 44 	var scriptsAry = [];
- 45 	for (i = 0; i < modules.length; i++) {
- 46 		scriptsAry.push(scriptTagStart + modules[i] + scriptTagEnd);
- 47 		for (var j = 0; j < providers.length; j++) {
- 48 			scriptsAry.push(scriptTagStart + providers[j] + '.' + modules[i] + scriptTagEnd);
- 49 		}
- 50 	}
- 51 	document.write(scriptsAry.join(''));
- 52 })();
- 53 
- 54 (function(){
- 55 
- 56 // holds all our implementing functions
- 57 var apis = {};
- 58 
- 59 // Our special private methods
- 60 /**
- 61  * Calls the API specific implementation of a particular method.
- 62  * Deferrable: If the API implmentation includes a deferable hash such as { getCenter: true, setCenter: true},
- 63  * then the methods calls mentioned with in it will be queued until runDeferred is called.
- 64  *   
- 65  * @private
- 66  */
- 67 var invoke = function(sApiId, sObjName, sFnName, oScope, args){
- 68 	if(!hasImplementation(sApiId, sObjName, sFnName)) {
- 69 		throw 'Method ' + sFnName + ' of object ' + sObjName + ' is not supported by API ' + sApiId + '. Are you missing a script tag?';
- 70 	}
- 71 	if(typeof(apis[sApiId][sObjName].deferrable) != 'undefined' && apis[sApiId][sObjName].deferrable[sFnName] === true) {
- 72 		mxn.deferUntilLoaded.call(oScope, function() {return apis[sApiId][sObjName][sFnName].apply(oScope, args);} );
- 73 	} 
- 74 	else {
- 75 		return apis[sApiId][sObjName][sFnName].apply(oScope, args);
- 76 	} 
- 77 };
- 78 	
- 79 /**
- 80  * Determines whether the specified API provides an implementation for the 
- 81  * specified object and function name.
- 82  * @private
- 83  */
- 84 var hasImplementation = function(sApiId, sObjName, sFnName){
- 85 	if(typeof(apis[sApiId]) == 'undefined') {
- 86 		throw 'API ' + sApiId + ' not loaded. Are you missing a script tag?';
- 87 	}
- 88 	if(typeof(apis[sApiId][sObjName]) == 'undefined') {
- 89 		throw 'Object definition ' + sObjName + ' in API ' + sApiId + ' not loaded. Are you missing a script tag?'; 
- 90 	}
- 91 	return typeof(apis[sApiId][sObjName][sFnName]) == 'function';
- 92 };
- 93 
- 94 /**
- 95  * @name mxn
- 96  * @namespace
- 97  */
- 98 var mxn = window.mxn = /** @lends mxn */ {
- 99 	
-100 	/**
-101 	 * Registers a set of provider specific implementation functions.
-102 	 * @function
-103 	 * @param {String} sApiId The API ID to register implementing functions for.
-104 	 * @param {Object} oApiImpl An object containing the API implementation.
-105 	 */
-106 	register: function(sApiId, oApiImpl){
-107 		if(!apis.hasOwnProperty(sApiId)){
-108 			apis[sApiId] = {};
-109 		}
-110 		mxn.util.merge(apis[sApiId], oApiImpl);
-111 	},		
-112 	
-113 	/**
-114 	 * Adds a list of named proxy methods to the prototype of a 
-115 	 * specified constructor function.
-116 	 * @function
-117 	 * @param {Function} func Constructor function to add methods to
-118 	 * @param {Array} aryMethods Array of method names to create
-119 	 * @param {Boolean} bWithApiArg Optional. Whether the proxy methods will use an API argument
-120 	 */
-121 	addProxyMethods: function(func, aryMethods, bWithApiArg){
-122 		for(var i = 0; i < aryMethods.length; i++) {
-123 			var sMethodName = aryMethods[i];
-124 			if(bWithApiArg){
-125 				func.prototype[sMethodName] = new Function('return this.invoker.go(\'' + sMethodName + '\', arguments, { overrideApi: true } );');
-126 			}
-127 			else {
-128 				func.prototype[sMethodName] = new Function('return this.invoker.go(\'' + sMethodName + '\', arguments);');
-129 			}
-130 		}
-131 	},
-132 	
-133 	checkLoad: function(funcDetails){
-134 		if(this.loaded[this.api] === false) {
-135 			var scope = this;
-136 			this.onload[this.api].push( function() { funcDetails.callee.apply(scope, funcDetails); } );
-137 			return true;
-138 		}
-139 		return false;
-140 	},
-141 	
-142 	deferUntilLoaded: function(fnCall) {
-143 		if(this.loaded[this.api] === false) {
-144 			var scope = this;
-145 			this.onload[this.api].push( fnCall );
-146 		} else {
-147 			fnCall.call(this);
-148 		}
-149 	},
-150 
-151 	/**
-152 	 * Bulk add some named events to an object.
-153 	 * @function
-154 	 * @param {Object} oEvtSrc The event source object.
-155 	 * @param {String[]} aEvtNames Event names to add.
-156 	 */
-157 	addEvents: function(oEvtSrc, aEvtNames){
-158 		for(var i = 0; i < aEvtNames.length; i++){
-159 			var sEvtName = aEvtNames[i];
-160 			if(sEvtName in oEvtSrc){
-161 				throw 'Event or method ' + sEvtName + ' already declared.';
-162 			}
-163 			oEvtSrc[sEvtName] = new mxn.Event(sEvtName, oEvtSrc);
-164 		}
-165 	}
-166 	
-167 };
-168 
-169 /**
-170  * Instantiates a new Event 
-171  * @constructor
-172  * @param {String} sEvtName The name of the event.
-173  * @param {Object} oEvtSource The source object of the event.
-174  */
-175 mxn.Event = function(sEvtName, oEvtSource){
-176 	var handlers = [];
-177 	if(!sEvtName){
-178 		throw 'Event name must be provided';
-179 	}
-180 	/**
-181 	 * Add a handler to the Event.
-182 	 * @param {Function} fn The handler function.
-183 	 * @param {Object} ctx The context of the handler function.
-184 	 */
-185 	this.addHandler = function(fn, ctx){
-186 		handlers.push({context: ctx, handler: fn});
-187 	};
-188 	/**
-189 	 * Remove a handler from the Event.
-190 	 * @param {Function} fn The handler function.
-191 	 * @param {Object} ctx The context of the handler function.
-192 	 */
-193 	this.removeHandler = function(fn, ctx){
-194 		for(var i = 0; i < handlers.length; i++){
-195 			if(handlers[i].handler == fn && handlers[i].context == ctx){
-196 				handlers.splice(i, 1);
-197 			}
-198 		}
-199 	};
-200 	/**
-201 	 * Remove all handlers from the Event.
-202 	 */
-203 	this.removeAllHandlers = function(){
-204 		handlers = [];
-205 	};
-206 	/**
-207 	 * Fires the Event.
-208 	 * @param {Object} oEvtArgs Event arguments object to be passed to the handlers.
-209 	 */
-210 	this.fire = function(oEvtArgs){
-211 		var args = [sEvtName, oEvtSource, oEvtArgs];
-212 		for(var i = 0; i < handlers.length; i++){
-213 			handlers[i].handler.apply(handlers[i].context, args);
-214 		}
-215 	};
-216 };
-217 
-218 /**
-219  * Creates a new Invoker, a class which helps with on-the-fly 
-220  * invocation of the correct API methods.
-221  * @constructor
-222  * @param {Object} aobj The core object whose methods will make cals to go()
-223  * @param {String} asClassName The name of the Mapstraction class to be invoked, normally the same name as aobj's constructor function
-224  * @param {Function} afnApiIdGetter The function on object aobj which will return the active API ID
-225  */
-226 mxn.Invoker = function(aobj, asClassName, afnApiIdGetter){
-227 	var obj = aobj;
-228 	var sClassName = asClassName;
-229 	var fnApiIdGetter = afnApiIdGetter;
-230 	var defOpts = { 
-231 		overrideApi: false, // {Boolean} API ID is overridden by value in first argument
-232 		context: null, // {Object} Local vars can be passed from the body of the method to the API method within this object
-233 		fallback: null // {Function} If an API implementation doesn't exist this function is run instead
-234 	};
-235 	
-236 	/**
-237 	 * Invoke the API implementation of a specific method.
-238 	 * @param {String} sMethodName The method name to invoke
-239 	 * @param {Array} args Arguments to pass on
-240 	 * @param {Object} oOptions Optional. Extra options for invocation
-241 	 * @param {Boolean} oOptions.overrideApi When true the first argument is used as the API ID.
-242 	 * @param {Object} oOptions.context A context object for passing extra information on to the provider implementation.
-243 	 * @param {Function} oOptions.fallback A fallback function to run if the provider implementation is missing.
-244 	 */
-245 	this.go = function(sMethodName, args, oOptions){
-246 		
-247 		// make sure args is an array
-248 		args = typeof(args) != 'undefined' ? Array.prototype.slice.apply(args) : [];
-249 		
-250 		if(typeof(oOptions) == 'undefined'){
-251 			oOptions = defOpts;
-252 		}
-253 						
-254 		var sApiId;
-255 		if(oOptions.overrideApi){
-256 			sApiId = args.shift();
-257 		}
-258 		else {
-259 			sApiId = fnApiIdGetter.apply(obj);
-260 		}
-261 		
-262 		if(typeof(sApiId) != 'string'){
-263 			throw 'API ID not available.';
-264 		}
-265 		
-266 		if(typeof(oOptions.context) != 'undefined' && oOptions.context !== null){
-267 			args.push(oOptions.context);
-268 		}
-269 		
-270 		if(typeof(oOptions.fallback) == 'function' && !hasImplementation(sApiId, sClassName, sMethodName)){
-271 			// we've got no implementation but have got a fallback function
-272 			return oOptions.fallback.apply(obj, args);
-273 		}
-274 		else {				
-275 			return invoke(sApiId, sClassName, sMethodName, obj, args);
-276 		}
-277 		
-278 	};
-279 	
-280 };
-281 
-282 /**
-283  * @namespace
-284  */
-285 mxn.util = {
-286 			
-287 	/**
-288 	 * Merges properties of one object into another recursively.
-289 	 * @param {Object} oRecv The object receiveing properties
-290 	 * @param {Object} oGive The object donating properties
-291 	 */
-292 	merge: function(oRecv, oGive){
-293 		for (var sPropName in oGive){
-294 			if (oGive.hasOwnProperty(sPropName)) {
-295 				if(!oRecv.hasOwnProperty(sPropName) || typeof(oRecv[sPropName]) !== 'object' || typeof(oGive[sPropName]) !== 'object'){
-296 					oRecv[sPropName] = oGive[sPropName];
-297 				}
-298 				else {
-299 					mxn.util.merge(oRecv[sPropName], oGive[sPropName]);
-300 				}
-301 			}
-302 		}
-303 	},
-304 	
-305 	/**
-306 	 * $m, the dollar function, elegantising getElementById()
-307 	 * @return An HTML element or array of HTML elements
-308 	 */
-309 	$m: function() {
-310 		var elements = [];
-311 		for (var i = 0; i < arguments.length; i++) {
-312 			var element = arguments[i];
-313 			if (typeof(element) == 'string') {
-314 				element = document.getElementById(element);
-315 			}
-316 			if (arguments.length == 1) {
-317 				return element;
-318 			}
-319 			elements.push(element);
-320 		}
-321 		return elements;
-322 	},
-323 
-324 	/**
-325 	 * loadScript is a JSON data fetcher
-326 	 * @param {String} src URL to JSON file
-327 	 * @param {Function} callback Callback function
-328 	 */
-329 	loadScript: function(src, callback) {
-330 		var script = document.createElement('script');
-331 		script.type = 'text/javascript';
-332 		script.src = src;
-333 		if (callback) {
-334 			if(script.addEventListener){
-335 				script.addEventListener('load', callback, true);
-336 			}
-337 			else if(script.attachEvent){
-338 				var done = false;
-339 				script.attachEvent("onreadystatechange",function(){
-340 					if ( !done && document.readyState === "complete" ) {
-341 						done = true;
-342 						callback();
-343 					}
-344 				});
-345 			}			
-346 		}
-347 		var h = document.getElementsByTagName('head')[0];
-348 		h.appendChild( script );
-349 		return;
-350 	},
-351 
-352 	/**
-353 	 *
-354 	 * @param {Object} point
-355 	 * @param {Object} level
-356 	 */
-357 	convertLatLonXY_Yahoo: function(point, level) { //Mercator
-358 		var size = 1 << (26 - level);
-359 		var pixel_per_degree = size / 360.0;
-360 		var pixel_per_radian = size / (2 * Math.PI);
-361 		var origin = new YCoordPoint(size / 2 , size / 2);
-362 		var answer = new YCoordPoint();
-363 		answer.x = Math.floor(origin.x + point.lon * pixel_per_degree);
-364 		var sin = Math.sin(point.lat * Math.PI / 180.0);
-365 		answer.y = Math.floor(origin.y + 0.5 * Math.log((1 + sin) / (1 - sin)) * -pixel_per_radian);
-366 		return answer;
-367 	},
-368 
-369 	/**
-370 	 * Load a stylesheet from a remote file.
-371 	 * @param {String} href URL to the CSS file
-372 	 */
-373 	loadStyle: function(href) {
-374 		var link = document.createElement('link');
-375 		link.type = 'text/css';
-376 		link.rel = 'stylesheet';
-377 		link.href = href;
-378 		document.getElementsByTagName('head')[0].appendChild(link);
-379 		return;
-380 	},
-381 
-382 	/**
-383 	 * getStyle provides cross-browser access to css
-384 	 * @param {Object} el HTML Element
-385 	 * @param {String} prop Style property name
-386 	 */
-387 	getStyle: function(el, prop) {
-388 		var y;
-389 		if (el.currentStyle) {
-390 			y = el.currentStyle[prop];
-391 		}
-392 		else if (window.getComputedStyle) {
-393 			y = window.getComputedStyle( el, '').getPropertyValue(prop);
-394 		}
-395 		return y;
-396 	},
-397 
-398 	/**
-399 	 * Convert longitude to metres
-400 	 * http://www.uwgb.edu/dutchs/UsefulData/UTMFormulas.HTM
-401 	 * "A degree of longitude at the equator is 111.2km... For other latitudes,
-402 	 * multiply by cos(lat)"
-403 	 * assumes the earth is a sphere but good enough for our purposes
-404 	 * @param {Float} lon
-405 	 * @param {Float} lat
-406 	 */
-407 	lonToMetres: function(lon, lat) {
-408 		return lon * (111200 * Math.cos(lat * (Math.PI / 180)));
-409 	},
-410 
-411 	/**
-412 	 * Convert metres to longitude
-413 	 * @param {Object} m
-414 	 * @param {Object} lat
-415 	 */
-416 	metresToLon: function(m, lat) {
-417 		return m / (111200 * Math.cos(lat * (Math.PI / 180)));
-418 	},
-419 
-420 	/**
-421 	 * Convert kilometres to miles
-422 	 * @param {Float} km
-423 	 * @returns {Float} miles
-424 	 */
-425 	KMToMiles: function(km) {
-426 		return km / 1.609344;
-427 	},
-428 
-429 	/**
-430 	 * Convert miles to kilometres
-431 	 * @param {Float} miles
-432 	 * @returns {Float} km
-433 	 */
-434 	milesToKM: function(miles) {
-435 		return miles * 1.609344;
-436 	},
-437 
-438 	// stuff to convert google zoom levels to/from degrees
-439 	// assumes zoom 0 = 256 pixels = 360 degrees
-440 	//		 zoom 1 = 256 pixels = 180 degrees
-441 	// etc.
-442 
-443 	/**
-444 	 *
-445 	 * @param {Object} pixels
-446 	 * @param {Object} zoom
-447 	 */
-448 	getDegreesFromGoogleZoomLevel: function(pixels, zoom) {
-449 		return (360 * pixels) / (Math.pow(2, zoom + 8));
-450 	},
-451 
-452 	/**
-453 	 *
-454 	 * @param {Object} pixels
-455 	 * @param {Object} degrees
-456 	 */
-457 	getGoogleZoomLevelFromDegrees: function(pixels, degrees) {
-458 		return mxn.util.logN((360 * pixels) / degrees, 2) - 8;
-459 	},
-460 
-461 	/**
-462 	 *
-463 	 * @param {Object} number
-464 	 * @param {Object} base
-465 	 */
-466 	logN: function(number, base) {
-467 		return Math.log(number) / Math.log(base);
-468 	},
-469 			
-470 	/**
-471 	 * Returns array of loaded provider apis
-472 	 * @returns {Array} providers
-473 	 */
-474 	getAvailableProviders : function () {
-475 		var providers = [];
-476 		for (var propertyName in apis){
-477 			if (apis.hasOwnProperty(propertyName)) {
-478 				providers.push(propertyName);
-479 			}
-480 		}
-481 		return providers;
-482 	},
-483 	
-484 	/**
-485 	 * Formats a string, inserting values of subsequent parameters at specified 
-486 	 * locations. e.g. stringFormat('{0} {1}', 'hello', 'world');
-487 	 */
-488 	stringFormat: function(strIn){
-489 		var replaceRegEx = /\{\d+\}/g;
-490 		var args = Array.prototype.slice.apply(arguments);
-491 		args.shift();
-492 		return strIn.replace(replaceRegEx, function(strVal){
-493 			var num = strVal.slice(1, -1);
-494 			return args[num];
-495 		});
-496 	},
-497 	
-498 	/**
-499 	 * Traverses an object graph using a series of map functions provided as arguments 
-500 	 * 2 to n. Map functions are only called if the working object is not undefined/null.
-501 	 * For usage see mxn.google.geocoder.js.
-502 	 */
-503 	traverse: function(start) {
-504 		var args = Array.prototype.slice.apply(arguments);
-505 		args.shift();
-506 		var working = start;
-507 		while(typeof(working) != 'undefined' && working !== null && args.length > 0){
-508 			var op = args.shift();
-509 			working = op(working);
-510 		}
-511 	}
-512 };
-513 
-514 /**
-515  * Class for converting between HTML and RGB integer color formats.
-516  * Accepts either a HTML color string argument or three integers for R, G and B.
-517  * @constructor
-518  */
-519 mxn.util.Color = function() {
-520 	if(arguments.length == 3) {
-521 		this.red = arguments[0];
-522 		this.green = arguments[1];
-523 		this.blue = arguments[2];
-524 	}
-525 	else if(arguments.length == 1) {
-526 		this.setHexColor(arguments[0]);
-527 	}
-528 };
-529 
-530 mxn.util.Color.prototype.reHex = /^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
-531 
-532 /**
-533  * Set the color from the supplied HTML hex string.
-534  * @param {String} strHexColor A HTML hex color string e.g. '#00FF88'.
-535  */
-536 mxn.util.Color.prototype.setHexColor = function(strHexColor) {
-537 	var match = strHexColor.match(this.reHex);
-538 	if(match) {
-539 		// grab the code - strips off the preceding # if there is one
-540 		strHexColor = match[1];
-541 	}
-542 	else {
-543 		throw 'Invalid HEX color format, expected #000, 000, #000000 or 000000';
-544 	}
-545 	// if a three character hex code was provided, double up the values
-546 	if(strHexColor.length == 3) {
-547 		strHexColor = strHexColor.replace(/\w/g, function(str){return str.concat(str);});
-548 	}
-549 	this.red = parseInt(strHexColor.substr(0,2), 16);
-550 	this.green = parseInt(strHexColor.substr(2,2), 16);
-551 	this.blue = parseInt(strHexColor.substr(4,2), 16);
-552 };
-553 
-554 /**
-555  * Retrieve the color value as an HTML hex string.
-556  * @returns {String} Format '#00FF88'.
-557  */
-558 mxn.util.Color.prototype.getHexColor = function() {
-559 	var rgb = this.blue | (this.green << 8) | (this.red << 16);
-560 	var hexString = rgb.toString(16).toUpperCase();
-561 	if(hexString.length <  6){
-562 		hexString = '0' + hexString;
-563 	}
-564 	return '#' + hexString;
-565 };
-566 	
-567 })();
-568 
\ No newline at end of file diff --git a/demoplanner/js/mapstraction/mxn-min.js b/demoplanner/js/mapstraction/mxn-min.js deleted file mode 100644 index ddd1bc0698..0000000000 --- a/demoplanner/js/mapstraction/mxn-min.js +++ /dev/null @@ -1,15 +0,0 @@ -/* -MAPSTRACTION v2.0.18 http://www.mapstraction.com - -Copyright (c) 2012 Tom Carden, Steve Coast, Mikel Maron, Andrew Turner, Henri Bergius, Rob Moran, Derek Fowler, Gary Gale -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the Mapstraction nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -(function(){var g=null;var c="core";var d;var e=document.getElementsByTagName("script");for(var h=0;h0){var g=f.shift();e=g(e)}}};a.util.Color=function(){if(arguments.length==3){this.red=arguments[0];this.green=arguments[1];this.blue=arguments[2]}else{if(arguments.length==1){this.setHexColor(arguments[0])}}};a.util.Color.prototype.reHex=/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;a.util.Color.prototype.setHexColor=function(f){var e=f.match(this.reHex);if(e){f=e[1]}else{throw"Invalid HEX color format, expected #000, 000, #000000 or 000000"}if(f.length==3){f=f.replace(/\w/g,function(g){return g.concat(g)})}this.red=parseInt(f.substr(0,2),16);this.green=parseInt(f.substr(2,2),16);this.blue=parseInt(f.substr(4,2),16)};a.util.Color.prototype.getHexColor=function(){var f=this.blue|(this.green<<8)|(this.red<<16);var e=f.toString(16).toUpperCase();if(e.length<6){e="0"+e}return"#"+e}})(); \ No newline at end of file diff --git a/demoplanner/js/mapstraction/mxn.cartociudad.geocoder-min.js b/demoplanner/js/mapstraction/mxn.cartociudad.geocoder-min.js deleted file mode 100644 index 86b7cace9c..0000000000 --- a/demoplanner/js/mapstraction/mxn.cartociudad.geocoder-min.js +++ /dev/null @@ -1,15 +0,0 @@ -/* -MAPSTRACTION v2.0.18 http://www.mapstraction.com - -Copyright (c) 2012 Tom Carden, Steve Coast, Mikel Maron, Andrew Turner, Henri Bergius, Rob Moran, Derek Fowler, Gary Gale -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the Mapstraction nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -mxn.register("cartociudad",{Geocoder:{init:function(){this.geocoders[this.api]=new metodosCartociudad()},geocode:function(b){var a={};var c=this;b.error=0;this.geocoders[this.api].queryNomenclator(b);if(b.error!==0){this.error_callback(b)}else{this.geocoders[this.api].addressToMapstraction(b);this.callback(b)}},geocode_callback:function(b,c){var a={}}}}); \ No newline at end of file diff --git a/demoplanner/js/mapstraction/mxn.cartociudad.geocoder.js b/demoplanner/js/mapstraction/mxn.cartociudad.geocoder.js deleted file mode 100644 index d9d2f42e28..0000000000 --- a/demoplanner/js/mapstraction/mxn.cartociudad.geocoder.js +++ /dev/null @@ -1,46 +0,0 @@ -/* -MAPSTRACTION v2.0.18 http://www.mapstraction.com - -Copyright (c) 2012 Tom Carden, Steve Coast, Mikel Maron, Andrew Turner, Henri Bergius, Rob Moran, Derek Fowler, Gary Gale -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the Mapstraction nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -mxn.register('cartociudad', { - -Geocoder: { - - init: function() { - this.geocoders[this.api] = new metodosCartociudad(); - }, - - geocode: function(address){ - var return_location = {}; - var mapstraction_geodocer = this; - - address.error = 0; //creamos una variable para devolver errores - - this.geocoders[this.api].queryNomenclator(address); - - if (address.error !== 0) { - this.error_callback(address); - } - else { - this.geocoders[this.api].addressToMapstraction(address); - this.callback(address); - } - }, - - geocode_callback: function(response, mapstraction_geocoder){ - var return_location = {}; - - // TODO: Add provider code - } -} -}); \ No newline at end of file diff --git a/demoplanner/js/mapstraction/mxn.cloudmade.core-min.js b/demoplanner/js/mapstraction/mxn.cloudmade.core-min.js deleted file mode 100644 index 30e47c144d..0000000000 --- a/demoplanner/js/mapstraction/mxn.cloudmade.core-min.js +++ /dev/null @@ -1,15 +0,0 @@ -/* -MAPSTRACTION v2.0.18 http://www.mapstraction.com - -Copyright (c) 2012 Tom Carden, Steve Coast, Mikel Maron, Andrew Turner, Henri Bergius, Rob Moran, Derek Fowler, Gary Gale -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of the Mapstraction nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -mxn.register("cloudmade",{Mapstraction:{init:function(a,b){var d=this;var c={key:cloudmade_key};if(typeof cloudmade_styleId!="undefined"){c.styleId=cloudmade_styleId}var e=new CM.Tiles.CloudMade.Web(c);this.maps[b]=new CM.Map(a,e);this.loaded[b]=true;CM.Event.addListener(this.maps[b],"click",function(g,f){if(f&&f.mapstraction_marker){f.mapstraction_marker.click.fire()}else{if(g){d.click.fire({location:new mxn.LatLonPoint(g.lat(),g.lng())})}}if(g){d.clickHandler(g.lat(),g.lng(),g,d)}});CM.Event.addListener(this.maps[b],"dragend",function(){d.endPan.fire()});CM.Event.addListener(this.maps[b],"zoomend",function(){d.changeZoom.fire()})},applyOptions:function(){var a=this.maps[this.api];if(this.options.enableScrollWheelZoom){a.enableScrollWheelZoom()}else{a.disableScrollWheelZoom()}},resizeTo:function(b,a){this.maps[this.api].checkResize()},addControls:function(a){var b=this.maps[this.api];var d=this.addControlsArgs;switch(d.zoom){case"large":this.addLargeControls();break;case"small":this.addSmallControls();break}if(d.map_type){this.addMapTypeControls()}if(d.scale){b.addControl(new CM.ScaleControl());this.addControlsArgs.scale=true}},addSmallControls:function(){var a=this.maps[this.api];a.addControl(new CM.SmallMapControl());this.addControlsArgs.zoom="small"},addLargeControls:function(){var a=this.maps[this.api];a.addControl(new CM.LargeMapControl());this.addControlsArgs.zoom="large"},addMapTypeControls:function(){var a=this.maps[this.api];a.addControl(new CM.TileLayerControl());this.addControlsArgs.map_type=true},dragging:function(a){var b=this.maps[this.api];if(a){b.enableDragging()}else{b.disableDragging()}},setCenterAndZoom:function(a,b){var d=this.maps[this.api];var c=a.toProprietary(this.api);d.setCenter(c,b)},addMarker:function(b,a){var d=this.maps[this.api];var c=b.toProprietary(this.api);d.addOverlay(c);return c},removeMarker:function(a){var b=this.maps[this.api];a.proprietary_marker.closeInfoWindow();b.removeOverlay(a.proprietary_marker)},declutterMarkers:function(a){var b=this.maps[this.api]},addPolyline:function(b,a){var d=this.maps[this.api];var c=b.toProprietary(this.api);d.addOverlay(c);return c},removePolyline:function(a){var b=this.maps[this.api];b.removeOverlay(a.proprietary_polyline)},getCenter:function(){var b=this.maps[this.api];var a=b.getCenter();return new mxn.LatLonPoint(a.lat(),a.lng())},setCenter:function(a,b){var d=this.maps[this.api];var c=a.toProprietary(this.api);if(b!==null&&b.pan){d.panTo(c)}else{d.setCenter(c)}},setZoom:function(a){var b=this.maps[this.api];b.setZoom(a)},getZoom:function(){var a=this.maps[this.api];return a.getZoom()},getZoomLevelForBoundingBox:function(e){var d=this.maps[this.api];var c=e.getNorthEast();var a=e.getSouthWest();var b=d.getBoundsZoomLevel(new CM.LatLngBounds(a.toProprietary(this.api),c.toProprietary(this.api)));return b},setMapType:function(a){var b=this.maps[this.api];switch(a){case mxn.Mapstraction.ROAD:break;case mxn.Mapstraction.SATELLITE:break;case mxn.Mapstraction.HYBRID:break;default:}},getMapType:function(){var a=this.maps[this.api];return mxn.Mapstraction.ROAD},getBounds:function(){var d=this.maps[this.api];var b=d.getBounds();var a=b.getSouthWest();var c=b.getNorthEast();return new mxn.BoundingBox(a.lat(),a.lng(),c.lat(),c.lng())},setBounds:function(b){var d=this.maps[this.api];var a=b.getSouthWest();var c=b.getNorthEast();d.zoomToBounds(new CM.LatLngBounds(a.toProprietary(this.api),c.toProprietary(this.api)))},addImageOverlay:function(c,a,e,i,f,g,d,h){var b=this.maps[this.api]},setImagePosition:function(e,b){var d=this.maps[this.api];var c;var a},addOverlay:function(a,b){var c=this.maps[this.api]},addTileLayer:function(f,a,b,d,e){var c=this.maps[this.api]},toggleTileLayer:function(b){var a=this.maps[this.api]},getPixelRatio:function(){var a=this.maps[this.api]},mousePosition:function(a){var b=this.maps[this.api]}},LatLonPoint:{toProprietary:function(){var a=new CM.LatLng(this.lat,this.lon);return a},fromProprietary:function(a){this.lat=a.lat();this.lon=a.lng()}},Marker:{toProprietary:function(){var d=this.location.toProprietary(this.api);var a={};if(this.iconUrl){var b=new CM.Icon();b.image=this.iconUrl;if(this.iconSize){b.iconSize=new CM.Size(this.iconSize[0],this.iconSize[1]);if(this.iconAnchor){b.iconAnchor=new CM.Point(this.iconAnchor[0],this.iconAnchor[1])}}if(this.iconShadowUrl){b.shadow=this.iconShadowUrl;if(this.iconShadowSize){b.shadowSize=new CM.Size(this.iconShadowSize[0],this.iconShadowSize[1])}}a.icon=b}if(this.labelText){a.title=this.labelText}var c=new CM.Marker(d,a);if(this.infoBubble){c.bindInfoWindow(this.infoBubble)}return c},openBubble:function(){var a=this.proprietary_marker;a.openInfoWindow(this.infoBubble)},hide:function(){var a=this.proprietary_marker;a.hide()},show:function(){var a=this.proprietary_marker;a.show()},update:function(){}},Polyline:{toProprietary:function(){var d=[];var c;for(var a=0,b=this.points.length;a0){this.onload[this.api].shift().apply(this)}};Mapstraction.prototype.clickHandler=function(lat,lon,me){this.callEventListeners("click",{location:new LatLonPoint(lat,lon)})};Mapstraction.prototype.moveendHandler=function(me){this.callEventListeners("moveend",{})};Mapstraction.prototype.addEventListener=function(){var listener={};listener.event_type=arguments[0];listener.callback_function=arguments[1];if(arguments.length==3){listener.back_compat_mode=false;listener.callback_object=arguments[2]}else{listener.back_compat_mode=true;listener.callback_object=null}this.eventListeners.push(listener)};Mapstraction.prototype.callEventListeners=function(sEventType,oEventArgs){oEventArgs.source=this;for(var i=0;i0){current_marker=this.markers.pop();this.invoker.go("removeMarker",[current_marker])}};Mapstraction.prototype.declutterMarkers=function(opts){if(this.loaded[this.api]===false){var me=this;this.onload[this.api].push(function(){me.declutterMarkers(opts)});return}var map=this.maps[this.api];switch(this.api){case"multimap":map.declutterGroup(opts.groupName);break;case" dummy":break;default:if(this.debug){alert(this.api+" not supported by Mapstraction.declutterMarkers")}}};Mapstraction.prototype.addPolyline=function(polyline,old){polyline.api=this.api;polyline.map=this.maps[this.api];var propPoly=this.invoker.go("addPolyline",arguments);polyline.setChild(propPoly);if(!old){this.polylines.push(polyline)}this.polylineAdded.fire({polyline:polyline})};var removePolylineImpl=function(polyline){this.invoker.go("removePolyline",arguments);polyline.onmap=false;this.polylineRemoved.fire({polyline:polyline})};Mapstraction.prototype.removePolyline=function(polyline){var current_polyline;for(var i=0;i0){current_polyline=this.polylines.pop();removePolylineImpl.call(this,current_polyline)}};var collectPoints=function(bMarkers,bPolylines,predicate){var points=[];if(bMarkers){for(var i=0;i0){var padPoints=[];for(var i=0;i=100){opacity=100}var c=opacity/100;var d=document.getElementById(id);if(typeof(d.style.filter)=="string"){d.style.filter="alpha(opacity:"+opacity+")"}if(typeof(d.style.KHTMLOpacity)=="string"){d.style.KHTMLOpacity=c}if(typeof(d.style.MozOpacity)=="string"){d.style.MozOpacity=c}if(typeof(d.style.opacity)=="string"){d.style.opacity=c}};Mapstraction.prototype.setImagePosition=function(id){var imgElement=document.getElementById(id);var oContext={latLng:{top:imgElement.getAttribute("north"),left:imgElement.getAttribute("west"),bottom:imgElement.getAttribute("south"),right:imgElement.getAttribute("east")},pixels:{top:0,right:0,bottom:0,left:0}};this.invoker.go("setImagePosition",arguments,{context:oContext});imgElement.style.top=oContext.pixels.top.toString()+"px";imgElement.style.left=oContext.pixels.left.toString()+"px";imgElement.style.width=(oContext.pixels.right-oContext.pixels.left).toString()+"px";imgElement.style.height=(oContext.pixels.bottom-oContext.pixels.top).toString()+"px"};Mapstraction.prototype.addJSON=function(json){var features;if(typeof(json)=="string"){features=eval("("+json+")")}else{features=json}features=features.features;var map=this.maps[this.api];var html="";var item;var polyline;var marker;var markers=[];if(features.type=="FeatureCollection"){this.addJSON(features.features)}for(var i=0;i"+item.title+"

"+item.description+"

";marker=new Marker(new LatLonPoint(item.geometry.coordinates[1],item.geometry.coordinates[0]));markers.push(marker);this.addMarkerWithData(marker,{infoBubble:html,label:item.title,date:'new Date("'+item.date+'")',iconShadow:item.icon_shadow,marker:item.id,iconShadowSize:item.icon_shadow_size,icon:item.icon,iconSize:item.icon_size,category:item.source_id,draggable:false,hover:false});break;case"Polygon":var points=[];polyline=new Polyline(points);mapstraction.addPolylineWithData(polyline,{fillColor:item.poly_color,date:'new Date("'+item.date+'")',category:item.source_id,width:item.line_width,opacity:item.line_opacity,color:item.line_color,polygon:true});markers.push(polyline);break;default:}}return markers};Mapstraction.prototype.addTileLayer=function(tile_url,opacity,copyright_text,min_zoom,max_zoom,map_type){if(!tile_url){return}opacity=opacity||0.6;copyright_text=copyright_text||"Mapstraction";min_zoom=min_zoom||1;max_zoom=max_zoom||18;map_type=map_type||false;return this.invoker.go("addTileLayer",[tile_url,opacity,copyright_text,min_zoom,max_zoom,map_type])};Mapstraction.prototype.addFilter=function(field,operator,value){if(!this.filters){this.filters=[]}this.filters.push([field,operator,value])};Mapstraction.prototype.removeFilter=function(field,operator,value){if(!this.filters){return}var del;for(var f=0;ff[2]){vis=false}break;case"eq":if(o.getAttribute(f[0])==f[2]){vis=false}break}return vis};Mapstraction.prototype.getAttributeExtremes=function(field){var min;var max;for(var m=0;mthis.markers[m].getAttribute(field)){min=this.markers[m].getAttribute(field)}if(!max||maxthis.polylines[p].getAttribute(field)){min=this.polylines[p].getAttribute(field)}if(!max||max=this.sw.lat&&point.lat<=this.ne.lat&&point.lon>=this.sw.lon&&point.lon<=this.ne.lon};BoundingBox.prototype.toSpan=function(){return new LatLonPoint(Math.abs(this.sw.lat-this.ne.lat),Math.abs(this.sw.lon-this.ne.lon))};BoundingBox.prototype.extend=function(point){if(this.sw.lat>point.lat){this.sw.lat=point.lat}if(this.sw.lon>point.lon){this.sw.lon=point.lon}if(this.ne.lat=tolerance){reduced[reduced.length]=this.points[i];markerPoint=i}}reduced[reduced.length]=this.points[this.points.length-1];this.points=reduced};var Radius=mxn.Radius=function(center,quality){this.center=center;var latConv=center.latConv();var lonConv=center.lonConv();var rad=Math.PI/180;this.calcs=[];for(var i=0;i<360;i+=quality){this.calcs.push([Math.cos(i*rad)/latConv,Math.sin(i*rad)/lonConv])}};Radius.prototype.getPolyline=function(radius,color){var points=[];for(var i=0;i 0) { - this.onload[this.api].shift().apply(this); //run deferred calls - } -}; - -///////////////////////// -// -// Event Handling -// -// FIXME need to consolidate some of these handlers... -// -/////////////////////////// - -// Click handler attached to native API -Mapstraction.prototype.clickHandler = function(lat, lon, me) { - this.callEventListeners('click', { - location: new LatLonPoint(lat, lon) - }); -}; - -// Move and zoom handler attached to native API -Mapstraction.prototype.moveendHandler = function(me) { - this.callEventListeners('moveend', {}); -}; - -/** - * Add a listener for an event. - * @param {String} type Event type to attach listener to - * @param {Function} func Callback function - * @param {Object} caller Callback object - */ -Mapstraction.prototype.addEventListener = function() { - var listener = {}; - listener.event_type = arguments[0]; - listener.callback_function = arguments[1]; - - // added the calling object so we can retain scope of callback function - if(arguments.length == 3) { - listener.back_compat_mode = false; - listener.callback_object = arguments[2]; - } - else { - listener.back_compat_mode = true; - listener.callback_object = null; - } - this.eventListeners.push(listener); -}; - -/** - * Call listeners for a particular event. - * @param {String} sEventType Call listeners of this event type - * @param {Object} oEventArgs Event args object to pass back to the callback - */ -Mapstraction.prototype.callEventListeners = function(sEventType, oEventArgs) { - oEventArgs.source = this; - for(var i = 0; i < this.eventListeners.length; i++) { - var evLi = this.eventListeners[i]; - if(evLi.event_type == sEventType) { - // only two cases for this, click and move - if(evLi.back_compat_mode) { - if(evLi.event_type == 'click') { - evLi.callback_function(oEventArgs.location); - } - else { - evLi.callback_function(); - } - } - else { - var scope = evLi.callback_object || this; - evLi.callback_function.call(scope, oEventArgs); - } - } - } -}; - - -//////////////////// -// -// map manipulation -// -///////////////////// - - -/** - * addControls adds controls to the map. You specify which controls to add in - * the associative array that is the only argument. - * addControls can be called multiple time, with different args, to dynamically change controls. - * - * args = { - * pan: true, - * zoom: 'large' || 'small', - * overview: true, - * scale: true, - * map_type: true, - * } - * @param {array} args Which controls to switch on - */ -Mapstraction.prototype.addControls = function( args ) { - this.addControlsArgs = args; - this.invoker.go('addControls', arguments); -}; - -/** - * Adds a marker pin to the map - * @param {Marker} marker The marker to add - * @param {Boolean} old If true, doesn't add this marker to the markers array. Used by the "swap" method - */ -Mapstraction.prototype.addMarker = function(marker, old) { - marker.mapstraction = this; - marker.api = this.api; - marker.location.api = this.api; - marker.map = this.maps[this.api]; - var propMarker = this.invoker.go('addMarker', arguments); - marker.setChild(propMarker); - if (!old) { - this.markers.push(marker); - } - this.markerAdded.fire({'marker': marker}); -}; - -/** - * addMarkerWithData will addData to the marker, then add it to the map - * @param {Marker} marker The marker to add - * @param {Object} data A data has to add - */ -Mapstraction.prototype.addMarkerWithData = function(marker, data) { - marker.addData(data); - this.addMarker(marker); -}; - -/** - * addPolylineWithData will addData to the polyline, then add it to the map - * @param {Polyline} polyline The polyline to add - * @param {Object} data A data has to add - */ -Mapstraction.prototype.addPolylineWithData = function(polyline, data) { - polyline.addData(data); - this.addPolyline(polyline); -}; - -/** - * removeMarker removes a Marker from the map - * @param {Marker} marker The marker to remove - */ -Mapstraction.prototype.removeMarker = function(marker) { - var current_marker; - for(var i = 0; i < this.markers.length; i++){ - current_marker = this.markers[i]; - if(marker == current_marker) { - this.invoker.go('removeMarker', arguments); - marker.onmap = false; - this.markers.splice(i, 1); - this.markerRemoved.fire({'marker': marker}); - break; - } - } -}; - -/** - * removeAllMarkers removes all the Markers on a map - */ -Mapstraction.prototype.removeAllMarkers = function() { - var current_marker; - while(this.markers.length > 0) { - current_marker = this.markers.pop(); - this.invoker.go('removeMarker', [current_marker]); - } -}; - -/** - * Declutter the markers on the map, group together overlapping markers. - * @param {Object} opts Declutter options - */ -Mapstraction.prototype.declutterMarkers = function(opts) { - if(this.loaded[this.api] === false) { - var me = this; - this.onload[this.api].push( function() { - me.declutterMarkers(opts); - } ); - return; - } - - var map = this.maps[this.api]; - - switch(this.api) - { - // case 'yahoo': - // - // break; - // case 'google': - // - // break; - // case 'openstreetmap': - // - // break; - // case 'microsoft': - // - // break; - // case 'openlayers': - // - // break; - case 'multimap': - /* - * Multimap supports quite a lot of decluttering options such as whether - * to use an accurate of fast declutter algorithm and what icon to use to - * represent a cluster. Using all this would mean abstracting all the enums - * etc so we're only implementing the group name function at the moment. - */ - map.declutterGroup(opts.groupName); - break; - // case 'mapquest': - // - // break; - // case 'map24': - // - // break; - case ' dummy': - break; - default: - if(this.debug) { - alert(this.api + ' not supported by Mapstraction.declutterMarkers'); - } - } -}; - -/** - * Add a polyline to the map - * @param {Polyline} polyline The Polyline to add to the map - * @param {Boolean} old If true replaces an existing Polyline - */ -Mapstraction.prototype.addPolyline = function(polyline, old) { - polyline.api = this.api; - polyline.map = this.maps[this.api]; - var propPoly = this.invoker.go('addPolyline', arguments); - polyline.setChild(propPoly); - if(!old) { - this.polylines.push(polyline); - } - this.polylineAdded.fire({'polyline': polyline}); -}; - -// Private remove implementation -var removePolylineImpl = function(polyline) { - this.invoker.go('removePolyline', arguments); - polyline.onmap = false; - this.polylineRemoved.fire({'polyline': polyline}); -}; - -/** - * Remove the polyline from the map - * @param {Polyline} polyline The Polyline to remove from the map - */ -Mapstraction.prototype.removePolyline = function(polyline) { - var current_polyline; - for(var i = 0; i < this.polylines.length; i++){ - current_polyline = this.polylines[i]; - if(polyline == current_polyline) { - this.polylines.splice(i, 1); - removePolylineImpl.call(this, polyline); - break; - } - } -}; - -/** - * Removes all polylines from the map - */ -Mapstraction.prototype.removeAllPolylines = function() { - var current_polyline; - while(this.polylines.length > 0) { - current_polyline = this.polylines.pop(); - removePolylineImpl.call(this, current_polyline); - } -}; - -var collectPoints = function(bMarkers, bPolylines, predicate) { - var points = []; - - if (bMarkers) { - for (var i = 0; i < this.markers.length; i++) { - var mark = this.markers[i]; - if (!predicate || predicate(mark)) { - points.push(mark.location); - } - } - } - - if (bPolylines) { - for(i = 0; i < this.polylines.length; i++) { - var poly = this.polylines[i]; - if (!predicate || predicate(poly)) { - for (var j = 0; j < poly.points.length; j++) { - points.push(poly.points[j]); - } - } - } - } - - return points; -}; - -/** - * Sets the center and zoom of the map to the smallest bounding box - * containing all markers and polylines - */ -Mapstraction.prototype.autoCenterAndZoom = function() { - var points = collectPoints.call(this, true, true); - - this.centerAndZoomOnPoints(points); -}; - -/** - * centerAndZoomOnPoints sets the center and zoom of the map from an array of points - * - * This is useful if you don't want to have to add markers to the map - */ -Mapstraction.prototype.centerAndZoomOnPoints = function(points) { - var bounds = new BoundingBox(90, 180, -90, -180); - - for (var i = 0, len = points.length; i < len; i++) { - bounds.extend(points[i]); - } - - this.setBounds(bounds); -}; - -/** - * 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" - */ -Mapstraction.prototype.visibleCenterAndZoom = function() { - var predicate = function(obj) { - return obj.getAttribute("visible"); - }; - var points = collectPoints.call(this, true, true, predicate); - - this.centerAndZoomOnPoints(points); -}; - -/** - * Automatically sets center and zoom level to show all polylines - * @param {Number} padding Optional number of kilometers to pad around polyline - */ -Mapstraction.prototype.polylineCenterAndZoom = function(padding) { - padding = padding || 0; - - var points = collectPoints.call(this, false, true); - - if (padding > 0) { - var padPoints = []; - for (var i = 0; i < points.length; i++) { - var point = points[i]; - - var kmInOneDegreeLat = point.latConv(); - var kmInOneDegreeLon = point.lonConv(); - - var latPad = padding / kmInOneDegreeLat; - var lonPad = padding / kmInOneDegreeLon; - - var ne = new LatLonPoint(point.lat + latPad, point.lon + lonPad); - var sw = new LatLonPoint(point.lat - latPad, point.lon - lonPad); - - padPoints.push(ne, sw); - } - points = points.concat(padPoints); - } - - this.centerAndZoomOnPoints(points); -}; - -/** - * addImageOverlay layers an georeferenced image over the map - * @param {id} unique DOM identifier - * @param {src} url of image - * @param {opacity} opacity 0-100 - * @param {west} west boundary - * @param {south} south boundary - * @param {east} east boundary - * @param {north} north boundary - */ -Mapstraction.prototype.addImageOverlay = function(id, src, opacity, west, south, east, north) { - - var b = document.createElement("img"); - b.style.display = 'block'; - b.setAttribute('id',id); - b.setAttribute('src',src); - b.style.position = 'absolute'; - b.style.zIndex = 1; - b.setAttribute('west',west); - b.setAttribute('south',south); - b.setAttribute('east',east); - b.setAttribute('north',north); - - var oContext = { - imgElm: b - }; - - this.invoker.go('addImageOverlay', arguments, { context: oContext }); -}; - -Mapstraction.prototype.setImageOpacity = function(id, opacity) { - if (opacity < 0) { - opacity = 0; - } - if (opacity >= 100) { - opacity = 100; - } - var c = opacity / 100; - var d = document.getElementById(id); - if(typeof(d.style.filter)=='string'){ - d.style.filter='alpha(opacity:'+opacity+')'; - } - if(typeof(d.style.KHTMLOpacity)=='string'){ - d.style.KHTMLOpacity=c; - } - if(typeof(d.style.MozOpacity)=='string'){ - d.style.MozOpacity=c; - } - if(typeof(d.style.opacity)=='string'){ - d.style.opacity=c; - } -}; - -Mapstraction.prototype.setImagePosition = function(id) { - var imgElement = document.getElementById(id); - var oContext = { - latLng: { - top: imgElement.getAttribute('north'), - left: imgElement.getAttribute('west'), - bottom: imgElement.getAttribute('south'), - right: imgElement.getAttribute('east') - }, - pixels: { top: 0, right: 0, bottom: 0, left: 0 } - }; - - this.invoker.go('setImagePosition', arguments, { context: oContext }); - - imgElement.style.top = oContext.pixels.top.toString() + 'px'; - imgElement.style.left = oContext.pixels.left.toString() + 'px'; - imgElement.style.width = (oContext.pixels.right - oContext.pixels.left).toString() + 'px'; - imgElement.style.height = (oContext.pixels.bottom - oContext.pixels.top).toString() + 'px'; -}; - -Mapstraction.prototype.addJSON = function(json) { - var features; - if (typeof(json) == "string") { - features = eval('(' + json + ')'); - } else { - features = json; - } - features = features.features; - var map = this.maps[this.api]; - var html = ""; - var item; - var polyline; - var marker; - var markers = []; - - if(features.type == "FeatureCollection") { - this.addJSON(features.features); - } - - for (var i = 0; i < features.length; i++) { - item = features[i]; - switch(item.geometry.type) { - case "Point": - html = "" + item.title + "

" + item.description + "

"; - marker = new Marker(new LatLonPoint(item.geometry.coordinates[1],item.geometry.coordinates[0])); - markers.push(marker); - this.addMarkerWithData(marker,{ - infoBubble : html, - label : item.title, - date : "new Date(\""+item.date+"\")", - iconShadow : item.icon_shadow, - marker : item.id, - iconShadowSize : item.icon_shadow_size, - icon : item.icon, - iconSize : item.icon_size, - category : item.source_id, - draggable : false, - hover : false - }); - break; - case "Polygon": - var points = []; - polyline = new Polyline(points); - mapstraction.addPolylineWithData(polyline,{ - fillColor : item.poly_color, - date : "new Date(\""+item.date+"\")", - category : item.source_id, - width : item.line_width, - opacity : item.line_opacity, - color : item.line_color, - polygon : true - }); - markers.push(polyline); - break; - default: - // console.log("Geometry: " + features.items[i].geometry.type); - } - } - return markers; -}; - -/** - * Adds a Tile Layer to the map - * - * Requires providing a parameterized tile url. Use {Z}, {X}, and {Y} to specify where the parameters - * should go in the URL. - * - * For example, the OpenStreetMap tiles are: - * m.addTileLayer("http://tile.openstreetmap.org/{Z}/{X}/{Y}.png", 1.0, "OSM", 1, 19, true); - * - * @param {tile_url} template url of the tiles. - * @param {opacity} opacity of the tile layer - 0 is transparent, 1 is opaque. (default=0.6) - * @param {copyright_text} copyright text to use for the tile layer. (default=Mapstraction) - * @param {min_zoom} Minimum (furtherest out) zoom level that tiles are available (default=1) - * @param {max_zoom} Maximum (closest) zoom level that the tiles are available (default=18) - * @param {map_type} Should the tile layer be a selectable map type in the layers palette (default=false) - */ -Mapstraction.prototype.addTileLayer = function(tile_url, opacity, copyright_text, min_zoom, max_zoom, map_type) { - if(!tile_url) { - return; - } - - opacity = opacity || 0.6; - copyright_text = copyright_text || "Mapstraction"; - min_zoom = min_zoom || 1; - max_zoom = max_zoom || 18; - map_type = map_type || false; - - return this.invoker.go('addTileLayer', [ tile_url, opacity, copyright_text, min_zoom, max_zoom, map_type] ); -}; - -/** - * addFilter adds a marker filter - * @param {field} name of attribute to filter on - * @param {operator} presently only "ge" or "le" - * @param {value} the value to compare against - */ -Mapstraction.prototype.addFilter = function(field, operator, value) { - if (!this.filters) { - this.filters = []; - } - this.filters.push( [field, operator, value] ); -}; - -/** - * Remove the specified filter - * @param {Object} field - * @param {Object} operator - * @param {Object} value - */ -Mapstraction.prototype.removeFilter = function(field, operator, value) { - if (!this.filters) { - return; - } - - var del; - for (var f=0; f