Code Monkey home page Code Monkey logo

leaflet.rain's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

leaflet.rain's Issues

How to group L.Rain together

I have more than one instance of L.Rain whose velocity and points are different from each other. I tried using L.layerGroup but it didn't work.

Here is my code. Note that rainSpots is a 3D array which contains arrays of [lat,long].
$.getJSON(precipitationFile, function(dat) {
// leaflet-rain layer
rainPoints = (dat['data']).reduce(function (acc, p) { if (p[2] > 0) { acc.push(p) } return acc; }, []);
console.log(rainPoints);
rainSpots = getRainSpots(rainPoints);
tempLayers = [];
for (i = 0; i < rainSpots.length; i++) {
rainSpot = rainSpots[i].map(function (p) { return [p[0], p[1]]; });
sumRainRate = (rainSpots[i].map(function (p) { return p[2]; })).reduce(function(a, b) { return a + b; });
rainRate = sumRainRate / rainSpots[i].length;
rainOptions = {
angle: 70,
width: 3,
spacing: 5,
length: 10,
interval: 11,
speed: rainRate,
color: '0x00FFFF'
};
temp = L.rain(rainSpots, rainOptions);
tempLayers.push(temp);
}
var rainLayers = new L.layerGroup(tempLayers);
layerControl.addOverlay(rainLayers, "Precipitation");
});

Here is the error message:
"There are too many active WebGL contexts on this page, the oldest context will be lost."

It actually contains a syntax error

The demo is nice on the website, but it seems it's hard to use on my map. Below is what I have encountered. Hope it can be a test case :)

ERROR TypeError: Failed to execute 'attachShader' on 'WebGLRenderingContext': parameter 2 is not of type 'WebGLShader'.
at NewClass._initShaders (L.Rain.js:196)
at NewClass.onAdd (L.Rain.js:31)
at NewClass._layerAdd (leaflet-src.js:6595)
at NewClass.whenReady (leaflet-src.js:4459)
at NewClass.addLayer (leaflet-src.js:6657)
at NewClass.addTo (L.Rain.js:72)
at HeatmapComponent.percipitationDataHandler (heatmap.component.ts:342)
at SafeSubscriber.schedulerFn [as _next] (core.js:31089)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:185)
at SafeSubscriber.next (Subscriber.js:124)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.