Socket
Socket
Sign inDemoInstall

leaflet-geojson-stream

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaflet-geojson-stream

leaflet geojson loading with streaming


Version published
Weekly downloads
13
decreased by-31.58%
Maintainers
1
Weekly downloads
 
Created
Source

leaflet-geojson-stream

Stream GeoJSON features into a Leaflet layer.

api

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

Request all features from a given url with 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

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, which is in turn just a bit of sugar on JSONStream.

Keywords

FAQs

Package last updated on 18 Oct 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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