# leaflet-geojson-stream

> leaflet geojson loading with streaming

Latest version **0.0.0** (published 2013-10-18) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install leaflet-geojson-stream
pnpm add leaflet-geojson-stream
yarn add leaflet-geojson-stream
bun add leaflet-geojson-stream
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.0 |
| Published | 2013-10-18 |
| First published | 2013-10-18 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 59 |
| Author | Tom MacWright |
| Maintainers | tmcw |
| Keywords | leaflet, stream, ajax, geojson |

## Links

- npm: https://www.npmjs.com/package/leaflet-geojson-stream
- Repository: https://github.com/tmcw/leaflet-geojson-stream
- Issues: https://github.com/tmcw/leaflet-geojson-stream/issues
- npm.io page: https://npm.io/package/leaflet-geojson-stream

## Dependencies (3)

- [through](https://npm.io/package/through.md) ~2.3.4
- [hyperquest](https://npm.io/package/hyperquest.md) ~0.1.8
- [geojson-stream](https://npm.io/package/geojson-stream.md) 0.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.0 (latest) — 2013-10-18

## README

# leaflet-geojson-stream

![](http://i.imgur.com/lVF6xZl.gif)

Stream [GeoJSON](http://geojson.org/) features into a [Leaflet](http://leafletjs.com/)
layer.

## api

### `lgs.ajax(url: string, layer: L.geoJson instance)`

Request all features from a given `url` with [hyperquest](https://github.com/substack/hyperquest)
and add them incrementally to `layer`. Returns a stream of feature objects
that also emits `end` on completion.

### `lgs.layerPipe(layer: L.geoJson instance)`

Given a `L.geoJson` instance, return a writable stream that accepts GeoJSON Feature
objects.

## example

```js
var leafletStream = require('leaflet-geojson-stream'),
    map = L.map('map').setView([0, 0], 2),
    gj = L.geoJson().addTo(map);

leafletStream.ajax('/points.geojson', gj)
    .on('end', function() {
        alert('all done!');
    });
```

To run the prepackaged example:

    npm install
    cd example
    node server.js

And open http://localhost:3000/

## How

A simple abstraction on top of [geojson-stream](https://github.com/tmcw/geojson-stream),
which is in turn just a bit of sugar on [JSONStream](https://github.com/dominictarr/JSONStream).

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