🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

mapbox-gl-controls

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mapbox-gl-controls - npm Package Compare versions

Comparing version

to
1.3.2

4

lib/compass.js

@@ -30,4 +30,4 @@ function _classCallCheck(instance, Constructor) {

/**
* @param {object} options
* @param {boolean} [options.instant=true] - Show compass if bearing is 0
* @param {Object} options
* @param {Boolean} [options.instant=true] - Show compass if bearing is 0
*/

@@ -34,0 +34,0 @@

@@ -75,7 +75,7 @@ function _classCallCheck(instance, Constructor) {

* Language can be set dynamically with `.setLanguage(lang)` method.
* @param {object} options
* @param {array} [options.supportedLanguages] - (Supported languages)[https://docs.mapbox.com/help/troubleshooting/change-language/]
* @param {string} [options.language] - One of the supported languages to apply
* @param {array} [options.excludedLayerIds=[]] - Array of layer id to exclude from localization
* @param {function} [options.getLanguageField] - Accepts language and returns language field.
* @param {Object} options
* @param {Array} [options.supportedLanguages] - (Supported languages)[https://docs.mapbox.com/help/troubleshooting/change-language/]
* @param {String} [options.language] - One of the supported languages to apply
* @param {Array} [options.excludedLayerIds=[]] - Array of layer id to exclude from localization
* @param {Function} [options.getLanguageField] - Accepts language and returns language field.
* By default fields are `name_LANGUAGE` and `name` for multi language (mul).

@@ -82,0 +82,0 @@ */

@@ -34,5 +34,5 @@ import mapboxgl from 'mapbox-gl';

* Fires map `ruler.on` and `ruler.off`events at the beginning and at the end of measuring.
* @param {object} options
* @param {string} [options.units='kilometers'] - Any units [@turf/distance](https://github.com/Turfjs/turf/tree/master/packages/turf-distance) supports
* @param {function} [options.labelFormat] - Accepts number and returns label.
* @param {Object} options
* @param {String} [options.units='kilometers'] - Any units [@turf/distance](https://github.com/Turfjs/turf/tree/master/packages/turf-distance) supports
* @param {Function} [options.labelFormat] - Accepts number and returns label.
* Can be used to convert value to any measuring units

@@ -39,0 +39,0 @@ */

@@ -33,8 +33,8 @@ function _classCallCheck(instance, Constructor) {

/**
* @param {object} options
* @param {object} [options.styles] - Style params
* @param {string} [options.styles.label] - Style label to display on switcher
* @param {string} [options.styles.styleName] - [Style name from spec](https://docs.mapbox.com/mapbox-gl-js/style-spec/#root-name)
* @param {string} [options.styles.styleUrl] - Style url
* @param {function} [options.onChange] - Triggered on style change. Accepts `style` object
* @param {Object} options
* @param {Array} [options.styles] - Array of style objects:
* @param {String} options.styles.label - Style label to display on switcher
* @param {String} options.styles.styleName - [Style name from spec](https://docs.mapbox.com/mapbox-gl-js/style-spec/#root-name)
* @param {String} options.styles.styleUrl - Style url
* @param {Function} [options.onChange] - Triggered on style change. Accepts `style` object
*/

@@ -41,0 +41,0 @@

{
"name": "mapbox-gl-controls",
"version": "1.3.1",
"version": "1.3.2",
"license": "MIT",

@@ -20,3 +20,3 @@ "homepage": "https://bravecow.github.io/mapbox-gl-controls/",

"eslint-plugin-import": "^2.18.2",
"mapbox-gl": "^1.2.1",
"mapbox-gl": "^1.3.1",
"postcss-cli": "^6.1.3",

@@ -23,0 +23,0 @@ "postcss-import": "^12.0.1",

@@ -44,13 +44,16 @@ # Mapbox Controls

// with custom styles:
map.addControl(new StylesControl([
{
label: 'Streets',
styleName: 'Mapbox Streets',
styleUrl: 'mapbox://styles/mapbox/streets-v9',
}, {
label: 'Satellite',
styleName: 'Satellite',
styleUrl: 'mapbox://styles/mapbox/satellite-v9',
},
]), 'top-left');
map.addControl(new StylesControl({
styles: [
{
label: 'Streets',
styleName: 'Mapbox Streets',
styleUrl: 'mapbox://styles/mapbox/streets-v9',
}, {
label: 'Satellite',
styleName: 'Satellite',
styleUrl: 'mapbox://styles/mapbox/satellite-v9',
},
],
onChange: (style) => console.log(style),
}), 'top-left');
```

@@ -100,4 +103,4 @@

- `options` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
- `options.instant` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Show compass if bearing is 0 (optional, default `true`)
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
- `options.instant` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Show compass if bearing is 0 (optional, default `true`)

@@ -110,7 +113,7 @@ #### Language

- `options` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
- `options.supportedLanguages` **[array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** (Supported languages)[https://docs.mapbox.com/help/troubleshooting/change-language/]
- `options.language` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** One of the supported languages to apply
- `options.excludedLayerIds` **[array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** Array of layer id to exclude from localization (optional, default `[]`)
- `options.getLanguageField` **[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** Accepts language and returns language field.
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
- `options.supportedLanguages` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** (Supported languages)[https://docs.mapbox.com/help/troubleshooting/change-language/]
- `options.language` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** One of the supported languages to apply
- `options.excludedLayerIds` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** Array of layer id to exclude from localization (optional, default `[]`)
- `options.getLanguageField` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** Accepts language and returns language field.
By default fields are `name_LANGUAGE` and `name` for multi language (mul).

@@ -124,5 +127,5 @@

- `options` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
- `options.units` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Any units [@turf/distance](https://github.com/Turfjs/turf/tree/master/packages/turf-distance) supports (optional, default `'kilometers'`)
- `options.labelFormat` **[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** Accepts number and returns label.
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
- `options.units` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Any units [@turf/distance](https://github.com/Turfjs/turf/tree/master/packages/turf-distance) supports (optional, default `'kilometers'`)
- `options.labelFormat` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** Accepts number and returns label.
Can be used to convert value to any measuring units

@@ -134,7 +137,7 @@

- `options` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
- `options.styles` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Style params
- `options.styles.label` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Style label to display on switcher
- `options.styles.styleName` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** [Style name from spec](https://docs.mapbox.com/mapbox-gl-js/style-spec/#root-name)
- `options.styles.styleUrl` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Style url
- `options.onChange` **[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** Triggered on style change. Accepts `style` object
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
- `options.styles` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Array of style objects:
- `options.styles.label` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Style label to display on switcher
- `options.styles.styleName` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** [Style name from spec](https://docs.mapbox.com/mapbox-gl-js/style-spec/#root-name)
- `options.styles.styleUrl` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Style url
- `options.onChange` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** Triggered on style change. Accepts `style` object

@@ -6,4 +6,4 @@ import iconCCW from './icon-ccw';

/**
* @param {object} options
* @param {boolean} [options.instant=true] - Show compass if bearing is 0
* @param {Object} options
* @param {Boolean} [options.instant=true] - Show compass if bearing is 0
*/

@@ -10,0 +10,0 @@

@@ -5,7 +5,7 @@ const SUPPORTED_LANGUAGES = ['en', 'es', 'fr', 'de', 'ru', 'zh', 'pt', 'ar', 'ja', 'ko', 'mul'];

* Language can be set dynamically with `.setLanguage(lang)` method.
* @param {object} options
* @param {array} [options.supportedLanguages] - (Supported languages)[https://docs.mapbox.com/help/troubleshooting/change-language/]
* @param {string} [options.language] - One of the supported languages to apply
* @param {array} [options.excludedLayerIds=[]] - Array of layer id to exclude from localization
* @param {function} [options.getLanguageField] - Accepts language and returns language field.
* @param {Object} options
* @param {Array} [options.supportedLanguages] - (Supported languages)[https://docs.mapbox.com/help/troubleshooting/change-language/]
* @param {String} [options.language] - One of the supported languages to apply
* @param {Array} [options.excludedLayerIds=[]] - Array of layer id to exclude from localization
* @param {Function} [options.getLanguageField] - Accepts language and returns language field.
* By default fields are `name_LANGUAGE` and `name` for multi language (mul).

@@ -12,0 +12,0 @@ */

@@ -12,5 +12,5 @@ import mapboxgl from 'mapbox-gl';

* Fires map `ruler.on` and `ruler.off`events at the beginning and at the end of measuring.
* @param {object} options
* @param {string} [options.units='kilometers'] - Any units [@turf/distance](https://github.com/Turfjs/turf/tree/master/packages/turf-distance) supports
* @param {function} [options.labelFormat] - Accepts number and returns label.
* @param {Object} options
* @param {String} [options.units='kilometers'] - Any units [@turf/distance](https://github.com/Turfjs/turf/tree/master/packages/turf-distance) supports
* @param {Function} [options.labelFormat] - Accepts number and returns label.
* Can be used to convert value to any measuring units

@@ -17,0 +17,0 @@ */

@@ -14,8 +14,8 @@ const defaultStyles = [

/**
* @param {object} options
* @param {object} [options.styles] - Style params
* @param {string} [options.styles.label] - Style label to display on switcher
* @param {string} [options.styles.styleName] - [Style name from spec](https://docs.mapbox.com/mapbox-gl-js/style-spec/#root-name)
* @param {string} [options.styles.styleUrl] - Style url
* @param {function} [options.onChange] - Triggered on style change. Accepts `style` object
* @param {Object} options
* @param {Array} [options.styles] - Array of style objects:
* @param {String} options.styles.label - Style label to display on switcher
* @param {String} options.styles.styleName - [Style name from spec](https://docs.mapbox.com/mapbox-gl-js/style-spec/#root-name)
* @param {String} options.styles.styleUrl - Style url
* @param {Function} [options.onChange] - Triggered on style change. Accepts `style` object
*/

@@ -22,0 +22,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet