Skip to content

Bigemap JavaScript API, a Leaflet Plugin for working with Bigemap Server.

License

Notifications You must be signed in to change notification settings

bigemap/bigemap.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bigemap.js

Bigemap JavaScript API, a Leaflet Plugin for working with Bigemap Server.

API Docs

Table of Contents

Map Object

Map

src/map.js:39-240

Extends L.Map

Create and automatically configure a map with layers, markers, and interactivity.

Parameters
  • element (HTMLElement | string) The HTML element in which Bigemap.js will render the map, or the element's string id. The specified element must have no children.
  • id (string | Object) The map's id string examples.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 a L.bigemap.tileLayer based on the TileJSON. Set to false to disable the L.bigemap.tileLayer.
    • featureLayer L.bigemap.featureLayer options. Options passed to a L.bigemap.featureLayer based on the TileJSON. Set to false to disable the L.bigemap.featureLayer.
    • legendControl L.bigemap.legendControl options. Options passed to a L.bigemap.legendControl based on the TileJSON. Set to false to disable the L.bigemap.legendControl.
Examples
// 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');

Properties and options

Bigemap.js's global properties and options that you can access while initializing your map or accessing information about its status.

accessToken

src/bigemap.js:44-46

Gets and sets the map's access token.

Type: string

Examples
L.bigemap.accessToken = myAccessToken;

Returns string The currently set access token.

apiUrl

src/bigemap.js:60-62

Gets and sets the map's default API URL.

Type: string

Examples
L.bigemap.apiUrl = 'https://api.bigemap.com';

Returns string The current base API URL.

version

src/bigemap.js:77-77

Gets the version of Bigemap.js.

Type: string

Examples
console.log(`Bigmeap.js v${L.bigemap.VERSION}`);

Layers

FeatureLayer

src/feature_layer.js:29-157

Extends L.FeatureGroup

L.bigemap.featureLayer provides an easy way to integrate GeoJSON from Bigemap and elsewhere into your map.

Parameters
  • id (string | Object) Must bu either* An id string like examples.map-foo.
    • A GeoJSON object, from your own Javascript code.
  • options Object? If provided, it is the same options as provided to L.FeatureGroup, with the following addition:* accessToken: Bigemap Server API access token. Overrides L.bigemap.accessToken for this layer.
Examples
var featureLayer = L.bigemap.featureLayer(geojson).addTo(map);

Returns FeatureLayer A L.bigemap.featureLayer object.

TileLayer

src/tile_layer.js:23-137

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.

Parameters
  • id (string | Object) An id string like examples.map-foo.
  • options Object? If provided, it is the same options as provided to L.TileLayer, with the following addition:* accessToken: Bigemap Server API access token. Overrides L.bigemap.accessToken for this layer.
Examples
// the second argument is optional
var layer = L.bigemap.tileLayer('bigemap.streets');

Markers and controls

icon

src/marker.js:18-52

A core icon generator used in L.bigemap.marker.style.

Parameters
  • fp Object A GeoJSON feature's properties object.
  • options Object? If provided, it may include accessToken: Bigemap.js access token. Overrides L.bigemap.accessToken for marker api.
Examples
var icon = L.bigemap.marker.icon(properties);

Returns L.Icon A L.Icon object with custom settings for iconUrl, iconSize, iconAnchor, and popupAnchor.

style

src/marker.js:67-72

Given a GeoJSON Feature with optional simplestyle-spec properties, return an options object formatted to be used as Leaflet Path options.

Parameters
  • f Object A GeoJSON feature object.
  • latlon (Array<number> | L.LatLng) The latitude, longitude position of the marker.
  • options Object? If provided, it may include accessToken: Bigemap.js access token. Overrides L.bigemap.accessToken for marker api.
Examples
var marker = L.bigemap.marker.style(feature, latlon);

Returns L.Marker A L.Marker object with the latitude, longitude position and a styled marker.

LegendControl

src/legend_control.js:14-81

Extends L.Control

A map control that shows legends added to maps in Bigemap. Legends are auto-detected from active layers.

Parameters
  • options Object? If provided, it is the same options as provided to L.Control.
Examples
var map = L.bigemap.map('map').setView([38, -77], 5);
map.addControl(L.bigemap.legendControl());

About

Bigemap JavaScript API, a Leaflet Plugin for working with Bigemap Server.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published