API

Overridable default parameters through URL GET parameters and Leaflet instance

URL GET parameters

Override your default settings through URL GET parameters:

GET parameters and format Description
view=<lat>,<lng> Center the view to specified latitude and longitude.
Example:
center view on Madagascar
zoom=<Integer or null> Set the map zoom level.
Example:
zoom in
zoomControl=<Integer> Enable or disable map zoom control.
Examples:
Enable or Disable
viewResetControl=<Boolean> Enable or disable map view reset control.
Examples:
Enable or Disable
viewResetGoesToFirstView=<Boolean> If true, the destination of view reset is the first view of the visitor. If false, destination is based on SEEMAP user settings (lat, lng, zoom).
Examples (move and zoom to see the difference):
Enable or Disable
layer=<String> Set the tile provider. View all
Example:
Stamen_TonerLite
gesture=<Boolean> Enable or disable gesture handling.
Examples:
Enable or Disable
fit=<Boolean> Enable or disable automatic fit to the view of markers bounds.
Examples:
Enable or Disable
cluster=<Boolean> Enable or disable marker cluster.
Examples:
Enable or Disable
Note that fit is set to false to bypass auto fit to marker bounds, only to display a relevant demo of marker cluster
routing=<Boolean> Enable or disable routing - Requires at least 2 markers.
Examples:
Enable or Disable
autocomplete=<Boolean> Enable or disable autocomplete search.
Examples:
Enable or Disable
autocompleteZoom=<Integer or null or false> Set or disable autocomplete map zoom level on autocompletion item click.
Example:
Set to 8 or Disable
language=<String> Set the interface language.
Example:
Set to french

Leaflet instance

SEEMAP is a helper for Leaflet, the whole Leaflet API of the instance is available at:

seemap.instance

Leaflet markers

All Leaflet markers are set at:

seemap.markers

SEEMAP methods

The SEEMAP specific helper methods.

addMarker

Create a marker on the map.

/**
  * @function addMarker
  * @description Create a marker on the map
  * @param {Object} options - Mandatory - Marker data
  * @param {Float} options.lat - Mandatory - The latitude of the marker
  * @param {Float} options.lng - Mandatory - The longitude of the marker
  * @param {String} options.content - Optional - The text or HTML of the marker popup
  * @param {Boolean} options.clusterable - Optional - Sets whether or not the marker has to be clustered (if marker cluster is enabled)
  * @param {Boolean} options.permalinkable - Optional - Sets whether or not the marker has to be enabled in permalink
*/
seemap.addMarker(options)

Example of a marker creation:

seemap.addMarker({
  lat: 45.12047878, // Mandatory
  lng: 2.389058, // Mandatory
  content: 'I am the marker popup content!' // Optional
})

getCurrentViewSettings

Returns an object with all parameters applied for the current view.

/**
 * @function getCurrentViewSettings
 * @description Returns an object with all parameters applied for the current view
 * @return {Object}
*/
seemap.getCurrentViewSettings()

Example returned

{
  "center": {
    "lat": 45,
    "lng": 2.499999999999991
  },
  "zoom": 11,
  "zoomControl": true,
  "viewResetControl": true,
  "viewResetGoesToFirstView": true,
  "cluster": true,
  "layer": "OpenStreetMap_Mapnik",
  "gesture": false,
  "routing": true,
  "autocomplete": true,
  "autocompleteZoom": 12,
  "fit": true,
  "markers": [
    {
      "lat": 45,
      "lng": 3,
      "content": ""
    },
    {
      "lat": 45,
      "lng": 2,
      "content": ""
    }
  ],
  "language": "en_GB"
}

getParameter

Get the specified URL search parameter. Returns empty string or value of the specified parameter.

/**
 * @function getParameter
 * @description Get the specified URL search parameter 
 * @param {String} str - The parameter name
 * @return {String}
*/
seemap.getParameter(str)

text

Returns SEEMAP interface text/message string from its specified id.

/**
 * @function text
 * @description Returns SEEMAP interface text/message string from its specified id
 * @param {String} string_id - The id of the interface text element
 * @return {String}
*/
seemap.text(string_id)

update

Initializes SEEMAP.

/**
  * @function update
  * @description Initializes SEEMAP
*/
seemap.update()

Create the link to the view currently applied.

/**
 * @function updatePermalink
 * @description Create the link to the view currently applied
 * @return {String}
*/
seemap.updatePermalink()