# cesium-multi-item-picker

> Simple multi-item picker for Cesium

Latest version **1.0.18** (published 2021-01-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install cesium-multi-item-picker
pnpm add cesium-multi-item-picker
yarn add cesium-multi-item-picker
bun add cesium-multi-item-picker
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.18 |
| Published | 2021-01-11 |
| First published | 2020-05-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 23.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Chris Mcleese |
| Maintainers | cmcleese |
| Keywords | cesium, entities, imagery |

## Links

- npm: https://www.npmjs.com/package/cesium-multi-item-picker
- Repository: https://github.com/cmcleese/cesium-multi-item-picker
- Homepage: https://github.com/cmcleese/cesium-multi-item-picker#readme
- Issues: https://github.com/cmcleese/cesium-multi-item-picker/issues
- npm.io page: https://npm.io/package/cesium-multi-item-picker

## Dependencies (1)

- [cesium](https://npm.io/package/cesium.md) ^1.0.0

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.18 (latest) — 2021-01-11
- 1.0.17 — 2021-01-11
- 1.0.16 — 2021-01-11
- 1.0.15 — 2020-10-08
- 1.0.14 — 2020-06-05
- 1.0.13 — 2020-06-04
- 1.0.12 — 2020-06-04
- 1.0.11 — 2020-06-03
- 1.0.10 — 2020-06-02
- 1.0.9 — 2020-06-02
- 1.0.8 — 2020-05-28
- 1.0.7 — 2020-05-28
- 1.0.6 — 2020-05-28
- 1.0.5 — 2020-05-27
- 1.0.4 — 2020-05-27
- … 4 more at https://npm.io/package/cesium-multi-item-picker/versions

## README

# cesium-multi-item-picker

Simple multi item picker for Cesium.

This add the ability to drill pick any entities or imagery layers based on the cursor position on the map.

What is then returned is an array with the entities, Cesium3DTileFeature and/or the imagery layer feature info.

## Install
`yarn add cesium-multi-item-picker`
or
`npm install cesium-multi-item-picker`

## Usage

### Init
```js
import CesiumMultiItemPickerMixin from 'cesium-multi-item-picker'
```
Subscribe to the `onPicked` event.
```js
const viewer = new Cesium.Viewer('cesiumContainer')
viewer.extend(CesiumMultiItemPickerMixin)
viewer.CesiumMultiItemPickerMixin.onPicked.addEventListener(picked => {
    // output ex: [ {Entity}, {Entity}, {ImageryLayerFeatureInfo}, {Cesium3DTileFeature} ]
    console.log(picked)
}, this)
 ```
## Methods
### Destroy
Destroys the mixin.

__Note:__
The destroy method also gets called automatically when calling `viewer.destroy()`.

So it's not entirely necessary to call this method.

__Example__
```js
viewer.CesiumMultiItemPickerMixin.destroy()
```

## Events
### onPicked
Fired when a `Left Click` event is triggered on the Cesium Ellipsoid.
Also trigger by a 'Tap' event.

See [Cesium.ScreenSpaceEventType.LEFT_CLICK](https://cesium.com/docs/cesiumjs-ref-doc/ScreenSpaceEventType.html?classFilter=ScreenSpaceEventType#.LEFT_CLICK)

__Returns__
- `[Array]`
Types: [Entity](https://cesium.com/docs/cesiumjs-ref-doc/Entity.html?classFilter=entity) , [ImageryLayerFeatureInfo](https://cesium.com/docs/cesiumjs-ref-doc/ImageryLayerFeatureInfo.html?classFilter=feature), [Cesium3DTileset](https://cesium.com/docs/cesiumjs-ref-doc/Cesium3DTileset.html?classFilter=Cesium3DTileset)

  __ex__: `[ {Entity}, {Entity}, {ImageryLayerFeatureInfo}, {Cesium3DTileFeature} ]`

__Example__

```js
viewer.CesiumMultiItemPickerMixin.onPicked.addEventListener( picked => {
    // output ex: [ {Entity}, {Entity}, {ImageryLayerFeatureInfo}, {Cesium3DTileFeature} ]
    console.log(picked)
}, this)
```

## [License](./LICENSE)

---
_Source: https://npm.io/package/cesium-multi-item-picker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
