Skip to content

Instantly share code, notes, and snippets.

@patrickarlt
Created October 6, 2014 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrickarlt/f8c825ee00f896c5c034 to your computer and use it in GitHub Desktop.
Save patrickarlt/f8c825ee00f896c5c034 to your computer and use it in GitHub Desktop.
// when you create everyting for the first time
var shapes = {};
for (var i = shapes.length - 1; i >= 0; i--) {
var shape = shapes[i];
shapes[shape.id] = L.geoJson(shape);
}
//when you update things
for (var i = shapes.length - 1; i >= 0; i--) {
var shape = shapes[shape.id];
shape.setStyle(/*something to update the style either options or a function*/);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment