Bigemap JavaScript API, a Leaflet Plugin for working with Bigemap Server.
Extends L.Map
Create and automatically configure a map with layers, markers, and interactivity.
element
(HTMLElement | string) The HTML element in which Bigemap.js will render the map, or the element's stringid
. The specified element must have no children.id
(string | Object) The map'sid
stringexamples.map-foo
.options
Object? If provided, it is the same options as provided to L.Map with the following additions:*tileLayer
L.TileLayer option. Options passed to aL.bigemap.tileLayer
based on the TileJSON. Set tofalse
to disable theL.bigemap.tileLayer
.featureLayer
L.bigemap.featureLayer
options. Options passed to aL.bigemap.featureLayer
based on the TileJSON. Set tofalse
to disable theL.bigemap.featureLayer
.legendControl
L.bigemap.legendControl
options. Options passed to aL.bigemap.legendControl
based on the TileJSON. Set tofalse
to disable theL.bigemap.legendControl
.
// map refers to a <div> element with the ID map
// bigemap.streets is the ID of a map on Bigemap.com
var map = L.bigemap.map('map', 'bigemap.streets');
// This map will have no layers initially
var map = L.bigemap.map('map');
Bigemap.js's global properties and options that you can access while initializing your map or accessing information about its status.
Gets and sets the map's access token.
Type: string
L.bigemap.accessToken = myAccessToken;
Returns string The currently set access token.
Gets and sets the map's default API URL.
Type: string
L.bigemap.apiUrl = 'https://api.bigemap.com';
Returns string The current base API URL.
Gets the version of Bigemap.js.
Type: string
console.log(`Bigmeap.js v${L.bigemap.VERSION}`);
Extends L.FeatureGroup
L.bigemap.featureLayer
provides an easy way to integrate GeoJSON
from Bigemap and elsewhere into your map.
id
(string | Object) Must bu either* Anid
string likeexamples.map-foo
.- A GeoJSON object, from your own Javascript code.
options
Object? If provided, it is the same options as provided toL.FeatureGroup
, with the following addition:*accessToken
: Bigemap Server API access token. OverridesL.bigemap.accessToken
for this layer.
var featureLayer = L.bigemap.featureLayer(geojson).addTo(map);
Returns FeatureLayer A L.bigemap.featureLayer
object.
Extends L.TileLayer
You can add a tiled layer to your map with L.bigemap.tileLayer()
, a simple
interface to layers from Bigemap and elsewhere.
id
(string | Object) Anid
string likeexamples.map-foo
.options
Object? If provided, it is the same options as provided toL.TileLayer
, with the following addition:*accessToken
: Bigemap Server API access token. OverridesL.bigemap.accessToken
for this layer.
// the second argument is optional
var layer = L.bigemap.tileLayer('bigemap.streets');
A core icon generator used in L.bigemap.marker.style
.
fp
Object A GeoJSON feature's properties object.options
Object? If provided, it may includeaccessToken
: Bigemap.js access token. OverridesL.bigemap.accessToken
for marker api.
var icon = L.bigemap.marker.icon(properties);
Returns L.Icon A L.Icon
object with custom settings for iconUrl
, iconSize
, iconAnchor
,
and popupAnchor
.
Given a GeoJSON Feature with optional simplestyle-spec properties, return an options object formatted to be used as Leaflet Path options.
f
Object A GeoJSON feature object.latlon
(Array<number> | L.LatLng) The latitude, longitude position of the marker.options
Object? If provided, it may includeaccessToken
: Bigemap.js access token. OverridesL.bigemap.accessToken
for marker api.
var marker = L.bigemap.marker.style(feature, latlon);
Returns L.Marker A L.Marker
object with the latitude, longitude position and a styled marker.
Extends L.Control
A map control that shows legends added to maps in Bigemap. Legends are auto-detected from active layers.
var map = L.bigemap.map('map').setView([38, -77], 5);
map.addControl(L.bigemap.legendControl());