Classes
Constructor
new Map(id, options)
Object for interacting with a generic map.
OptionsbaseLayerEither a Leaflet.Layer, or the name of one of the supported base layers (currently 'Minimal' and 'WorldImagery'. Default: MinimalcenterCentre position of the map. Default: -28, 134zoomthe initial zoom level. Default: 4maxZoomthe maximum allowed zoom level. Default: 20maxAutoZoomthe maximum zoom level to automatically zoom to (when zoomToObject = true). Default: 15defaultLayersControltrue to use the default layers control, false to use your own. Default: truescrollWheelZoomwhether to enable zooming in/out by scrolling the mouse. Default: falsefullscreenControlwhether to include a full-screen option. Default: truefullscreenControlOptions:positionposition of the button on the map. Default: topleft
drawControlwhether to include drawing controls or not. Default: truedrawOptionsif drawing control is to be included, then specify options to pass to drawing control here.editOptionsif edit option in drawing control is enabled, then specify options to pass to edit control here.singleDrawwhether 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: truesingleMarkerwhether to allow more than 1 marker to be drawn at a time.. Default: truemarkerZoomToMaxwhether to allow zoom to maximum permitted level of current base layermarkerOrShapeNotBothwhether to allow users to draw both markers and regions/shapes at the same time. Default: trueshowFitBoundsTogglewhether to include a button to toggle between the initial map zoom and the bounds of the data. Default: falseuseMyLocationwhether to include a "Use My Location" button to place a marker on the map at the user's location. Default: trueallowSearchLocationByAddresswhether to allow the user to search by address to place a marker on the map. Default: trueallowSearchRegionByAddresswhether to allow the user to search by address to draw a polygon on the map. Default: truegeocodeRegionOptionsadditional configuration options when using the allowSearchRegionByAddress control. Only relevant when allowSearchRegionByAddress = true:pointToCircletrue to render any point locations returned by the geocode service as circles. Default: truepointRadiusMetersThe radius of the circle to use when pointToCircle = true. Units are in meters. Default: 500zoomToObjectwhether to automatically fit the map to the bounds of a new object when added. Default: truedraggableMarkerswhether to allow point markers to be draggable by default. Default: truewmsFeatureUrlthe 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:wmsLayerUrlthe URL to call to retrieve a WMS layer. The PID will be appended to this URL. Default:sleepTrue 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: truesleepTimeTime (milliseconds) until the map 'sleeps' up after the mouse moves away from the map. Only relevant if sleep = true. Default: 750hoverToWakeTrue 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: truewakeTimeTime (milliseconds) until the map wakes up after mouse over. Only relevant if sleep = true and hoverToWake = true. Default: 750sleepNoteTrue to display text over the map when it is sleeping. Only relevant if sleep = true. Default: falsesleepOpacityOpacity of the sleep text. Only relevant if sleep = true and sleepNote = true. Default: 0.7wakeMessageText 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
mapOptionsObject containing configuration options for the underlying map. See ALA.Map for details. If not provided, the defaults from ALA.Map will be used.showFacetsTrue to allow the user to change the facets used for the query. Default: truefacetNameMappingObject 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).excludeFacetsList 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.excludeSinglesTrue to hide any facet group which only contains a single option. Default: truemaximumFacetsThe maximum number of facets that can be selected via the 'choose more' dialog. Default: 15wmsTrue to use a WMS layer to display occurrences, false to render individual points as circles on a clustered map. Default: truemapAttributionAttribution text to be displayed on the map. Default: blankallowColourByTrue to include a colour-by control. Default: trueshowLegendTrue to include a legend for coloured maps. Default: truepointsConfig options for the points on the map:colourThe initial colour (in hex, without the #) to use for rendering occurrence points on the map. Default: #FF9900nameThe point type (circle, etc). Default: circlesizeThe point radius in px. Default: 4pxopacityThe 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. |