Classes
Constructor
new Map(id, options)
Object for interacting with a generic map.
OptionsbaseLayer
Either a Leaflet.Layer, or the name of one of the supported base layers (currently 'Minimal' and 'WorldImagery'. Default: Minimalcenter
Centre position of the map. Default: -28, 134zoom
the initial zoom level. Default: 4maxZoom
the maximum allowed zoom level. Default: 20maxAutoZoom
the maximum zoom level to automatically zoom to (when zoomToObject = true). Default: 15defaultLayersControl
true to use the default layers control, false to use your own. Default: truescrollWheelZoom
whether to enable zooming in/out by scrolling the mouse. Default: falsefullscreenControl
whether to include a full-screen option. Default: truefullscreenControlOptions:
position
position of the button on the map. Default: topleft
drawControl
whether to include drawing controls or not. Default: truedrawOptions
if drawing control is to be included, then specify options to pass to drawing control here.editOptions
if edit option in drawing control is enabled, then specify options to pass to edit control here.singleDraw
whether to allow more than 1 shape or region to be drawn at a time. This does NOT apply to markers - only layers and other shapes. See also singleMarker and markerOrShapeNotBoth. Default: truesingleMarker
whether to allow more than 1 marker to be drawn at a time.. Default: truemarkerZoomToMax
whether to allow zoom to maximum permitted level of current base layermarkerOrShapeNotBoth
whether to allow users to draw both markers and regions/shapes at the same time. Default: trueshowFitBoundsToggle
whether to include a button to toggle between the initial map zoom and the bounds of the data. Default: falseuseMyLocation
whether to include a "Use My Location" button to place a marker on the map at the user's location. Default: trueallowSearchLocationByAddress
whether to allow the user to search by address to place a marker on the map. Default: trueallowSearchRegionByAddress
whether to allow the user to search by address to draw a polygon on the map. Default: truegeocodeRegionOptions
additional configuration options when using the allowSearchRegionByAddress control. Only relevant when allowSearchRegionByAddress = true:pointToCircle
true to render any point locations returned by the geocode service as circles. Default: truepointRadiusMeters
The radius of the circle to use when pointToCircle = true. Units are in meters. Default: 500zoomToObject
whether to automatically fit the map to the bounds of a new object when added. Default: truedraggableMarkers
whether to allow point markers to be draggable by default. Default: truewmsFeatureUrl
the URL to call to fetch features of a WMS layer (e.g. http://spatial-dev.ala.org.au/geoserver/wms/reflect?). The PID will be appended to this URL. Default:wmsLayerUrl
the URL to call to retrieve a WMS layer. The PID will be appended to this URL. Default:sleep
True to disable mouse wheel zooming once the mouse has been out of the map for a certain time. Clicking in the map re-enables it. Overrides scrollWheelZoom. Default: truesleepTime
Time (milliseconds) until the map 'sleeps' up after the mouse moves away from the map. Only relevant if sleep = true. Default: 750hoverToWake
True to wake the map up after the mouse has been held over the map for a certain time (wakeTime). Only relevant if sleep = true. Default: truewakeTime
Time (milliseconds) until the map wakes up after mouse over. Only relevant if sleep = true and hoverToWake = true. Default: 750sleepNote
True to display text over the map when it is sleeping. Only relevant if sleep = true. Default: falsesleepOpacity
Opacity of the sleep text. Only relevant if sleep = true and sleepNote = true. Default: 0.7wakeMessage
Text to display over the map when it is sleeping. Only relevant if sleep = true and sleepNote = true. Default: 'Click or hover to wake'.
Parameters
Name | Type | Description |
---|---|---|
id | String | Unique id of the map container div. Mandatory. |
options | Object | Configuration options for the map. Optional - sensible defaults will be used if not provided. See the list above. |
Constructor
new MapConstants()
Constructor
new MapUtils()
Constructor
new OccurrenceMap(id, biocacheBaseUrl, queryString, options)
Object for interacting with an ALA Occurrence map. This map is designed for displaying ALA occurrence records, with the ability for users to control the query facets behind the data.
The resulting query can be extracted and saved for later re-use.
The query is used to interact with a biocache instance (the client must provide the base URL for the biocache). Some additional parameters are stored in the query string and used to control the appearance of the map (e.g. colour by options, which are not part of the query itself but are used to colour the results).
Options
mapOptions
Object containing configuration options for the underlying map. See ALA.Map for details. If not provided, the defaults from ALA.Map will be used.showFacets
True to allow the user to change the facets used for the query. Default: truefacetNameMapping
Object containing a mapping from the default facet field names to display labels to be used. The format must be{fieldName: "label", ...}
. All values displayed in the facet list can be mapped using this construct, regardless of the display level. If not provided then the ALA.OccurrenceMapUtils.DEFAULT_FACET_NAME object will be used, or field names will be formatted into human-readable form (capitalised, camel-case changed to sentence case, underscores replaced with spaces, etc).excludeFacets
List of facet names to exclude from dislay. This list can contain items from any level in the facet list. If not provided, all available facets will be displayed.excludeSingles
True to hide any facet group which only contains a single option. Default: truemaximumFacets
The maximum number of facets that can be selected via the 'choose more' dialog. Default: 15wms
True to use a WMS layer to display occurrences, false to render individual points as circles on a clustered map. Default: truemapAttribution
Attribution text to be displayed on the map. Default: blankallowColourBy
True to include a colour-by control. Default: trueshowLegend
True to include a legend for coloured maps. Default: truepoints
Config options for the points on the map:colour
The initial colour (in hex, without the #) to use for rendering occurrence points on the map. Default: #FF9900name
The point type (circle, etc). Default: circlesize
The point radius in px. Default: 4pxopacity
The point opacity (0 - 1). Default: 1
Parameters
Name | Type | Description |
---|---|---|
id | String | Unique id of the map container div. Mandatory. |
biocacheBaseUrl | String | The base URL of the Biocache instance that will be used as the source for all data. Mandatory. |
queryString | String | The initial query string to use to populate map (it will be passed to the Biocache's search service). This property must include the q= parameter at a minimum. Mandatory. |
options | Object | Configuration options for the map. Optional - sensible defaults will be used if not provided. See the list above. |