mapbox-gl-controls
Advanced tools
Comparing version 1.6.4 to 1.6.5
@@ -85,2 +85,4 @@ import mapboxgl from 'mapbox-gl'; | ||
* @param {String} [options.secondaryColor='#fff'] - Color of halo and inner marker background. | ||
* @param {String} [options.fontSize='12'] - Label font size | ||
* @param {String} [options.fontHalo='1'] - Label font halo | ||
*/ | ||
@@ -101,2 +103,4 @@ | ||
this.font = options.font || ['Roboto Medium']; | ||
this.fontSize = options.fontSize || 12; | ||
this.fontHalo = options.fontHalo || 1; | ||
this.labelFormat = options.labelFormat || defaultLabelFormat; | ||
@@ -149,3 +153,3 @@ this.mainColor = options.mainColor || MAIN_COLOR; | ||
'text-anchor': 'top', | ||
'text-size': 12, | ||
'text-size': this.fontSize, | ||
'text-offset': [0, 0.8] | ||
@@ -156,3 +160,3 @@ }, | ||
'text-halo-color': this.secondaryColor, | ||
'text-halo-width': 1 | ||
'text-halo-width': this.fontHalo | ||
} | ||
@@ -234,3 +238,3 @@ }); | ||
return coordinates.map(function (coordinate, index) { | ||
if (index === 0) return 0; | ||
if (index === 0) return labelFormat(0); | ||
sum += distance(coordinates[index - 1], coordinates[index], { | ||
@@ -237,0 +241,0 @@ units: units |
{ | ||
"name": "mapbox-gl-controls", | ||
"version": "1.6.4", | ||
"version": "1.6.5", | ||
"main": "./lib/index.js", | ||
@@ -8,22 +8,23 @@ "description": "Controls for mapbox-gl", | ||
"lint": "eslint src", | ||
"watch": "npm run watch:js & npm run watch:css", | ||
"build": "rollup --config && postcss src/theme.scss --output theme.css && cp ./theme.css ./docs", | ||
"watch:js": "rollup --config --watch", | ||
"watch:css": "postcss src/theme.scss --watch --output theme.css", | ||
"build": "rollup --config && postcss src/theme.scss --output theme.css && cp ./theme.css ./docs", | ||
"docs": "documentation readme src/** --section=API --markdown-toc=false" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.9.6", | ||
"@babel/preset-env": "^7.9.6", | ||
"@rollup/plugin-babel": "^5.0.0", | ||
"@rollup/plugin-commonjs": "^11.1.0", | ||
"@rollup/plugin-node-resolve": "^7.1.3", | ||
"documentation": "^13.0.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-airbnb-base": "^14.1.0", | ||
"eslint-plugin-import": "^2.20.2", | ||
"mapbox-gl": "^1.10.1", | ||
"@babel/core": "^7.10.5", | ||
"@babel/preset-env": "^7.10.4", | ||
"@rollup/plugin-babel": "^5.1.0", | ||
"@rollup/plugin-commonjs": "^14.0.0", | ||
"@rollup/plugin-node-resolve": "^8.4.0", | ||
"documentation": "^13.0.2", | ||
"eslint": "^7.5.0", | ||
"eslint-config-airbnb-base": "^14.2.0", | ||
"eslint-plugin-import": "^2.22.0", | ||
"mapbox-gl": "^1.11.1", | ||
"postcss-cli": "^7.1.1", | ||
"postcss-import": "^12.0.1", | ||
"postcss-nested": "^4.2.1", | ||
"rollup": "^2.10.4", | ||
"postcss-nested": "^4.2.3", | ||
"rollup": "^2.22.1", | ||
"rollup-plugin-svg-import": "^1.5.1" | ||
@@ -30,0 +31,0 @@ }, |
@@ -153,2 +153,4 @@ # Mapbox Controls | ||
- `options.secondaryColor` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Color of halo and inner marker background. (optional, default `'#fff'`) | ||
- `options.fontSize` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Label font size (optional, default `'12'`) | ||
- `options.fontHalo` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Label font halo (optional, default `'1'`) | ||
@@ -155,0 +157,0 @@ #### StylesControl |
@@ -55,2 +55,4 @@ import mapboxgl from 'mapbox-gl'; | ||
* @param {String} [options.secondaryColor='#fff'] - Color of halo and inner marker background. | ||
* @param {String} [options.fontSize='12'] - Label font size | ||
* @param {String} [options.fontHalo='1'] - Label font halo | ||
*/ | ||
@@ -66,2 +68,4 @@ | ||
this.font = options.font || ['Roboto Medium']; | ||
this.fontSize = options.fontSize || 12; | ||
this.fontHalo = options.fontHalo || 1; | ||
this.labelFormat = options.labelFormat || defaultLabelFormat; | ||
@@ -114,3 +118,3 @@ this.mainColor = options.mainColor || MAIN_COLOR; | ||
'text-anchor': 'top', | ||
'text-size': 12, | ||
'text-size': this.fontSize, | ||
'text-offset': [0, 0.8], | ||
@@ -121,3 +125,3 @@ }, | ||
'text-halo-color': this.secondaryColor, | ||
'text-halo-width': 1, | ||
'text-halo-width': this.fontHalo, | ||
}, | ||
@@ -192,3 +196,3 @@ }); | ||
return coordinates.map((coordinate, index) => { | ||
if (index === 0) return 0; | ||
if (index === 0) return labelFormat(0); | ||
sum += distance(coordinates[index - 1], coordinates[index], { units }); | ||
@@ -195,0 +199,0 @@ return labelFormat(sum); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
184
79588
35
1902