# mapbox-gl-datascope

> Scope your vector tile data in Mapbox GL JS.

Latest version **1.2.1** (published 2016-05-02) · 0 weekly downloads

## Install

```sh
npm install mapbox-gl-datascope
pnpm add mapbox-gl-datascope
yarn add mapbox-gl-datascope
bun add mapbox-gl-datascope
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2016-05-02 |
| First published | 2016-05-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | anandthakker |
| Keywords | mapbox, mapbox-gl, mapbox-gl-js, data, data-driven, plugin |

## Links

- npm: https://www.npmjs.com/package/mapbox-gl-datascope
- npm.io page: https://npm.io/package/mapbox-gl-datascope

## Dependencies (5)

- [yo-yo](https://npm.io/package/yo-yo.md) ^1.2.0
- [d3-array](https://npm.io/package/d3-array.md) ^0.7.1
- [turf-extent](https://npm.io/package/turf-extent.md) ^1.0.4
- [mapbox-gl-draw](https://npm.io/package/mapbox-gl-draw.md) ^0.6.0-rc9
- [geojson-polygon-aggregate](https://npm.io/package/geojson-polygon-aggregate.md) ^2.0.0

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2016-05-02
- 1.2.0 — 2016-05-02
- 1.1.0 — 2016-05-02
- 1.0.0 — 2016-05-01

## README

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

Scope your vector tile data.

## Install

    npm install mapbox-gl-datascope

## Usage

```js
mapboxgl.datascope(map, {
  layers: layers,
  properties: { 'road_density': 'Road Density (km/km2)' },
  popup: new mapboxgl.Popup({ closeButton: false }).addTo(map)
})
```

See also [example.html](https://anandthakker.github.com/mapbox-gl-datascope/example.html).

## API

### datascope

Scope your data

**Parameters**

-   `map` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Mapbox GL map instance
-   `options` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `options.layers` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).&lt;[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** List of layers to query for data.
    -   `options.properties` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object mapping feature property keys to { name, format } where `format` is an optional format function for the property value.  Only these properties will be shown.
    -   `options.summaries` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)=** Object mapping property keys to aggregation function name from [geojson-polygon-aggregate](https://github.com/developmentseed/geojson-polygon-aggregate) or 'reducer' function `(accumulator, clippedFeature) -> accumulator`
    -   `options.popup` **Popup=** A mapbox-gl-js Popup control; if supplied, the popup will be populated with the rendered property data.
    -   `options.event` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)=** Mouse event to use (mousemove, click) (optional, default `'mousemove'`)
    -   `options.radius` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)=** Feature query radius (optional, default `0`)
    -   `options.filter` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)=** Optional feature filter.

Returns **DOMNode** DOM node that is kept updated with rendered property data.

---
_Source: https://npm.io/package/mapbox-gl-datascope · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
