ALA

Classes

Map
MapConstants
MapUtils
OccurrenceMap

Constructor

new Map(id, options)

Object for interacting with a generic map.

Options

  • baseLayer Either a Leaflet.Layer, or the name of one of the supported base layers (currently 'Minimal' and 'WorldImagery'. Default: Minimal
  • center Centre position of the map. Default: -28, 134
  • zoom the initial zoom level. Default: 4
  • maxZoom the maximum allowed zoom level. Default: 20
  • maxAutoZoom the maximum zoom level to automatically zoom to (when zoomToObject = true). Default: 15
  • defaultLayersControl true to use the default layers control, false to use your own. Default: true
  • scrollWheelZoom whether to enable zooming in/out by scrolling the mouse. Default: false
  • fullscreenControl whether to include a full-screen option. Default: true
  • fullscreenControlOptions:
    • position position of the button on the map. Default: topleft
  • drawControl whether to include drawing controls or not. Default: true
  • drawOptions 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: true
  • singleMarker whether to allow more than 1 marker to be drawn at a time.. Default: true
  • markerZoomToMax whether to allow zoom to maximum permitted level of current base layer
  • markerOrShapeNotBoth whether to allow users to draw both markers and regions/shapes at the same time. Default: true
  • showFitBoundsToggle whether to include a button to toggle between the initial map zoom and the bounds of the data. Default: false
  • useMyLocation whether to include a "Use My Location" button to place a marker on the map at the user's location. Default: true
  • allowSearchLocationByAddress whether to allow the user to search by address to place a marker on the map. Default: true
  • allowSearchRegionByAddress whether to allow the user to search by address to draw a polygon on the map. Default: true
  • geocodeRegionOptions 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: true
    • pointRadiusMeters The radius of the circle to use when pointToCircle = true. Units are in meters. Default: 500
  • zoomToObject whether to automatically fit the map to the bounds of a new object when added. Default: true
  • draggableMarkers whether to allow point markers to be draggable by default. Default: true
  • wmsFeatureUrl 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: true
  • sleepTime Time (milliseconds) until the map 'sleeps' up after the mouse moves away from the map. Only relevant if sleep = true. Default: 750
  • hoverToWake 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: true
  • wakeTime Time (milliseconds) until the map wakes up after mouse over. Only relevant if sleep = true and hoverToWake = true. Default: 750
  • sleepNote True to display text over the map when it is sleeping. Only relevant if sleep = true. Default: false
  • sleepOpacity Opacity of the sleep text. Only relevant if sleep = true and sleepNote = true. Default: 0.7
  • wakeMessage 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: true
  • facetNameMapping 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: true
  • maximumFacets The maximum number of facets that can be selected via the 'choose more' dialog. Default: 15
  • wms True to use a WMS layer to display occurrences, false to render individual points as circles on a clustered map. Default: true
  • mapAttribution Attribution text to be displayed on the map. Default: blank
  • allowColourBy True to include a colour-by control. Default: true
  • showLegend True to include a legend for coloured maps. Default: true
  • pointsConfig 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: #FF9900
    • name The point type (circle, etc). Default: circle
    • size The point radius in px. Default: 4px
    • opacity 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.

ALA

Classes

Map
MapConstants
MapUtils
OccurrenceMap

Constructor

new Map(id, options)

Object for interacting with a generic map.

Options

  • baseLayer Either a Leaflet.Layer, or the name of one of the supported base layers (currently 'Minimal' and 'WorldImagery'. Default: Minimal
  • center Centre position of the map. Default: -28, 134
  • zoom the initial zoom level. Default: 4
  • maxZoom the maximum allowed zoom level. Default: 20
  • maxAutoZoom the maximum zoom level to automatically zoom to (when zoomToObject = true). Default: 15
  • defaultLayersControl true to use the default layers control, false to use your own. Default: true
  • scrollWheelZoom whether to enable zooming in/out by scrolling the mouse. Default: false
  • fullscreenControl whether to include a full-screen option. Default: true
  • fullscreenControlOptions:
    • position position of the button on the map. Default: topleft
  • drawControl whether to include drawing controls or not. Default: true
  • drawOptions 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: true
  • singleMarker whether to allow more than 1 marker to be drawn at a time.. Default: true
  • markerZoomToMax whether to allow zoom to maximum permitted level of current base layer
  • markerOrShapeNotBoth whether to allow users to draw both markers and regions/shapes at the same time. Default: true
  • showFitBoundsToggle whether to include a button to toggle between the initial map zoom and the bounds of the data. Default: false
  • useMyLocation whether to include a "Use My Location" button to place a marker on the map at the user's location. Default: true
  • allowSearchLocationByAddress whether to allow the user to search by address to place a marker on the map. Default: true
  • allowSearchRegionByAddress whether to allow the user to search by address to draw a polygon on the map. Default: true
  • geocodeRegionOptions 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: true
    • pointRadiusMeters The radius of the circle to use when pointToCircle = true. Units are in meters. Default: 500
  • zoomToObject whether to automatically fit the map to the bounds of a new object when added. Default: true
  • draggableMarkers whether to allow point markers to be draggable by default. Default: true
  • wmsFeatureUrl 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: true
  • sleepTime Time (milliseconds) until the map 'sleeps' up after the mouse moves away from the map. Only relevant if sleep = true. Default: 750
  • hoverToWake 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: true
  • wakeTime Time (milliseconds) until the map wakes up after mouse over. Only relevant if sleep = true and hoverToWake = true. Default: 750
  • sleepNote True to display text over the map when it is sleeping. Only relevant if sleep = true. Default: false
  • sleepOpacity Opacity of the sleep text. Only relevant if sleep = true and sleepNote = true. Default: 0.7
  • wakeMessage 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: true
  • facetNameMapping 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: true
  • maximumFacets The maximum number of facets that can be selected via the 'choose more' dialog. Default: 15
  • wms True to use a WMS layer to display occurrences, false to render individual points as circles on a clustered map. Default: true
  • mapAttribution Attribution text to be displayed on the map. Default: blank
  • allowColourBy True to include a colour-by control. Default: true
  • showLegend True to include a legend for coloured maps. Default: true
  • pointsConfig 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: #FF9900
    • name The point type (circle, etc). Default: circle
    • size The point radius in px. Default: 4px
    • opacity 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.