Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 2.0.0 to 2.1.0

4

lib/Base/Base.d.ts

@@ -12,5 +12,5 @@ import { Map } from 'mapbox-gl';

onRemoveControl(): void;
private onAdd;
private onRemove;
onAdd(map: Map): HTMLDivElement;
onRemove(): void;
}
export default Base;

@@ -7,5 +7,2 @@ import Base from '../Base/Base';

}
/**
* Compass control
*/
export default class CompassControl extends Base {

@@ -12,0 +9,0 @@ button: Button;

import iconPointer from '../icons/pointer';
import Base from '../Base/Base';
import Button from '../Button/Button';
/**
* Compass control
*/
export default class CompassControl extends Base {

@@ -8,0 +5,0 @@ constructor(options) {

import { LngLat, MapboxGeoJSONFeature, MapMouseEvent } from 'mapbox-gl';
import Base from '../Base/Base';
import Button from '../Button/Button';
/**
* Inspect control to debug style layers and source
*/
export default class InspectControl extends Base {

@@ -8,0 +5,0 @@ popupNode: HTMLDivElement;

@@ -5,5 +5,2 @@ import Base from '../Base/Base';

import iconInspect from '../icons/inspect';
/**
* Inspect control to debug style layers and source
*/
export default class InspectControl extends Base {

@@ -10,0 +7,0 @@ constructor() {

@@ -12,5 +12,2 @@ import Base from '../Base/Base';

}
/**
* Localize map. Language can be set dynamically with `.setLanguage(lang)` method.
*/
export default class LanguageControl extends Base {

@@ -17,0 +14,0 @@ supportedLanguages: string[];

@@ -5,5 +5,2 @@ import getLanguageField from './getLanguageField';

const SUPPORTED_LANGUAGES = ['en', 'es', 'fr', 'de', 'ru', 'zh', 'pt', 'ar', 'ja', 'ko', 'mul'];
/**
* Localize map. Language can be set dynamically with `.setLanguage(lang)` method.
*/
export default class LanguageControl extends Base {

@@ -10,0 +7,0 @@ constructor(options) {

@@ -30,5 +30,2 @@ import { Marker } from 'mapbox-gl';

}
/**
* Fires map `ruler.on` and `ruler.off`events at the beginning and at the end of measuring.
*/
export default class RulerControl extends Base {

@@ -35,0 +32,0 @@ isMeasuring: boolean;

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

const HALO_COLOR = '#fff';
/**
* Fires map `ruler.on` and `ruler.off`events at the beginning and at the end of measuring.
*/
export default class RulerControl extends Base {

@@ -20,0 +17,0 @@ constructor(options) {

@@ -10,3 +10,2 @@ import Base from '../Base/Base';

}
/** Adds style switcher similar to Google Maps. */
export default class StylesControl extends Base {

@@ -13,0 +12,0 @@ styles: StyleOption[];

import Base from '../Base/Base';
import { defaultStyleOptions } from './StyleOption';
import Button from '../Button/Button';
/** Adds style switcher similar to Google Maps. */
export default class StylesControl extends Base {

@@ -6,0 +5,0 @@ constructor(options) {

@@ -9,5 +9,2 @@ import { LngLat, MapLayerEventType, MapMouseEvent } from 'mapbox-gl';

}
/**
* Shows tooltip on hover on some layer or whole map.
*/
export default class TooltipControl extends Base {

@@ -14,0 +11,0 @@ layer: string;

import Base from '../Base/Base';
/**
* Shows tooltip on hover on some layer or whole map.
*/
export default class TooltipControl extends Base {

@@ -6,0 +3,0 @@ constructor(options) {

import Base from '../Base/Base';
import Button from '../Button/Button';
/**
* Zoom control
*/
export default class ZoomControl extends Base {

@@ -7,0 +4,0 @@ zoomIn: Button;

@@ -5,5 +5,2 @@ import Base from '../Base/Base';

import iconMinus from '../icons/minus';
/**
* Zoom control
*/
export default class ZoomControl extends Base {

@@ -10,0 +7,0 @@ constructor() {

{
"name": "mapbox-gl-controls",
"version": "2.0.0",
"version": "2.1.0",
"main": "./lib/index.js",

@@ -10,3 +10,3 @@ "description": "Controls for mapbox-gl",

"build": "tsc && sass src/index.scss:lib/controls.css",
"docs": "rollup --config docs/rollup.config.js"
"docs": "cp lib/controls.css docs && rollup --config docs/rollup.config.js"
},

@@ -35,3 +35,4 @@ "devDependencies": {

"repository": "bravecow/mapbox-gl-controls",
"keywords": ["mapbox"],
"license": "MIT"
}

@@ -31,2 +31,4 @@ # Mapbox Controls

Adds style switcher similar to Google Maps.
```javascript

@@ -73,2 +75,4 @@ import { StylesControl } from 'mapbox-gl-controls';

Localize map. Language can be set dynamically with `.setLanguage(lang)` method.
```javascript

@@ -92,2 +96,6 @@ import { LanguageControl } from 'mapbox-gl-controls';

Inspect control to debug style layers and source
![Inspect Control](./docs/inspect.png)
```javascript

@@ -101,6 +109,17 @@ import { InspectControl } from 'mapbox-gl-controls';

Shows tooltip on hover on some layer or whole map.
![Tooltip Control](./docs/tooltip.png)
```javascript
import { TooltipControl } from 'mapbox-gl-controls';
map.addLayer({
id: '$fill',
type: 'fill',
source: { type: 'geojson', data: polygon },
paint: { 'fill-opacity': 0.3, 'fill-color': '#4264fb' },
});
map.addControl(new TooltipControl({ layer: '$fill' }));
```

@@ -34,3 +34,3 @@ import { Map } from 'mapbox-gl';

private onAdd(map: Map) {
onAdd(map: Map) {
this.map = map;

@@ -41,3 +41,3 @@ this.onAddControl();

private onRemove() {
onRemove() {
this.onRemoveControl();

@@ -44,0 +44,0 @@ this.node.parentNode.removeChild(this.node);

@@ -10,5 +10,2 @@ import iconPointer from '../icons/pointer';

/**
* Compass control
*/
export default class CompassControl extends Base {

@@ -15,0 +12,0 @@ button: Button

@@ -7,5 +7,2 @@ import { LngLat, MapboxGeoJSONFeature, MapMouseEvent, PointLike } from 'mapbox-gl';

/**
* Inspect control to debug style layers and source
*/
export default class InspectControl extends Base {

@@ -12,0 +9,0 @@ popupNode: HTMLDivElement

@@ -18,5 +18,2 @@ import getLanguageField from './getLanguageField';

/**
* Localize map. Language can be set dynamically with `.setLanguage(lang)` method.
*/
export default class LanguageControl extends Base {

@@ -23,0 +20,0 @@ supportedLanguages: string[]

@@ -44,5 +44,2 @@ import mapboxgl, { GeoJSONSource, Marker } from 'mapbox-gl';

/**
* Fires map `ruler.on` and `ruler.off`events at the beginning and at the end of measuring.
*/
export default class RulerControl extends Base {

@@ -49,0 +46,0 @@ isMeasuring: boolean

@@ -12,3 +12,2 @@ import Base from '../Base/Base';

/** Adds style switcher similar to Google Maps. */
export default class StylesControl extends Base {

@@ -15,0 +14,0 @@ styles: StyleOption[]

@@ -11,5 +11,2 @@ import { LngLat, MapLayerEventType, MapMouseEvent } from 'mapbox-gl';

/**
* Shows tooltip on hover on some layer or whole map.
*/
export default class TooltipControl extends Base {

@@ -16,0 +13,0 @@ layer: string

@@ -6,5 +6,2 @@ import Base from '../Base/Base';

/**
* Zoom control
*/
export default class ZoomControl extends Base {

@@ -11,0 +8,0 @@ zoomIn: Button

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc