mapbox-gl-controls
Advanced tools
Comparing version 2.3.0 to 2.3.1
export { default as CompassControl } from './CompassControl/CompassControl'; | ||
export { default as ImageControl } from './ImageControl/ImageControl'; | ||
export { default as InspectControl } from './InspectControl/InspectControl'; | ||
@@ -3,0 +4,0 @@ export { default as LanguageControl } from './LanguageControl/LanguageControl'; |
export { default as CompassControl } from './CompassControl/CompassControl'; | ||
export { default as ImageControl } from './ImageControl/ImageControl'; | ||
export { default as InspectControl } from './InspectControl/InspectControl'; | ||
@@ -3,0 +4,0 @@ export { default as LanguageControl } from './LanguageControl/LanguageControl'; |
import Base from '../Base/Base'; | ||
import { StyleOption } from './StyleOption'; | ||
import Button from '../Button/Button'; | ||
import { StyleOption } from './types'; | ||
interface StylesControlOptions { | ||
@@ -16,4 +16,5 @@ /** Array of style options */ | ||
insert(): void; | ||
get defaultOptions(): StyleOption[]; | ||
onAddControl(): void; | ||
} | ||
export {}; |
import Base from '../Base/Base'; | ||
import { defaultStyleOptions } from './StyleOption'; | ||
import Button from '../Button/Button'; | ||
@@ -8,3 +7,3 @@ export default class StylesControl extends Base { | ||
super(); | ||
this.styles = (_a = options === null || options === void 0 ? void 0 : options.styles) !== null && _a !== void 0 ? _a : defaultStyleOptions; | ||
this.styles = (_a = options === null || options === void 0 ? void 0 : options.styles) !== null && _a !== void 0 ? _a : this.defaultOptions; | ||
this.onChange = options === null || options === void 0 ? void 0 : options.onChange; | ||
@@ -40,2 +39,15 @@ this.buttons = []; | ||
} | ||
get defaultOptions() { | ||
return [ | ||
{ | ||
label: 'Streets', | ||
styleName: 'Mapbox Streets', | ||
styleUrl: 'mapbox://styles/mapbox/streets-v11', | ||
}, { | ||
label: 'Satellite', | ||
styleName: 'Mapbox Satellite Streets', | ||
styleUrl: 'mapbox://sprites/mapbox/satellite-streets-v11', | ||
}, | ||
]; | ||
} | ||
onAddControl() { | ||
@@ -42,0 +54,0 @@ this.insert(); |
{ | ||
"name": "mapbox-gl-controls", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"main": "./lib/index.js", | ||
@@ -10,17 +10,18 @@ "description": "Controls for mapbox-gl", | ||
"build": "tsc && sass src/index.scss:lib/controls.css", | ||
"docs": "cp lib/controls.css docs && rollup --config docs/rollup.config.js" | ||
"docs": "cp lib/controls.css docs && rollup --config docs/rollup.config.js", | ||
"docs:watch": "cp lib/controls.css docs && rollup --config docs/rollup.config.js --watch" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^18.0.0", | ||
"@rollup/plugin-node-resolve": "^11.2.1", | ||
"@rollup/plugin-commonjs": "^19.0.0", | ||
"@rollup/plugin-node-resolve": "^13.0.0", | ||
"@types/geojson": "^7946.0.7", | ||
"@types/mapbox-gl": "^2.1.1", | ||
"@typescript-eslint/eslint-plugin": "^4.22.0", | ||
"@typescript-eslint/parser": "^4.22.0", | ||
"eslint": "^7.25.0", | ||
"@types/mapbox-gl": "^2.3.0", | ||
"@typescript-eslint/eslint-plugin": "^4.26.1", | ||
"@typescript-eslint/parser": "^4.26.1", | ||
"eslint": "^7.28.0", | ||
"eslint-config-xxx": "^1.0.0", | ||
"mapbox-gl": "^2.2.0", | ||
"rollup": "^2.45.2", | ||
"sass": "^1.32.11", | ||
"typescript": "^4.2.4" | ||
"mapbox-gl": "^2.3.0", | ||
"rollup": "^2.51.1", | ||
"sass": "^1.34.1", | ||
"typescript": "^4.3.2" | ||
}, | ||
@@ -27,0 +28,0 @@ "dependencies": { |
@@ -30,2 +30,3 @@ import { Map } from 'mapbox-gl'; | ||
} | ||
onRemoveControl() { | ||
@@ -32,0 +33,0 @@ // extend |
export { default as CompassControl } from './CompassControl/CompassControl'; | ||
export { default as ImageControl } from './ImageControl/ImageControl'; | ||
export { default as InspectControl } from './InspectControl/InspectControl'; | ||
@@ -3,0 +4,0 @@ export { default as LanguageControl } from './LanguageControl/LanguageControl'; |
import Base from '../Base/Base'; | ||
import { StyleOption, defaultStyleOptions } from './StyleOption'; | ||
import Button from '../Button/Button'; | ||
import { StyleOption } from './types'; | ||
@@ -19,3 +19,3 @@ interface StylesControlOptions { | ||
super(); | ||
this.styles = options?.styles ?? defaultStyleOptions; | ||
this.styles = options?.styles ?? this.defaultOptions; | ||
this.onChange = options?.onChange; | ||
@@ -52,2 +52,16 @@ this.buttons = []; | ||
get defaultOptions(): StyleOption[] { | ||
return [ | ||
{ | ||
label: 'Streets', | ||
styleName: 'Mapbox Streets', | ||
styleUrl: 'mapbox://styles/mapbox/streets-v11', | ||
}, { | ||
label: 'Satellite', | ||
styleName: 'Mapbox Satellite Streets', | ||
styleUrl: 'mapbox://sprites/mapbox/satellite-streets-v11', | ||
}, | ||
]; | ||
} | ||
onAddControl() { | ||
@@ -54,0 +68,0 @@ this.insert(); |
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
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
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
164393
137
2943