http://patrickarlt.github.io/extending-leaflet-talk / @patrickarlt
L.Class
.L.Class
also mixins (includes), statics and default options.A standard set of methods for defineing how things work.
L.MyLayer = L.Class.extend({
statics: {
FOO: 'bar'
},
includes: L.Mixin.Events,
options: {
size: 512
},
initialize: function(options){
/* mix passed options with defaults */
L.Util.setOptions(this, options);
},
onAdd: function(map){
/* how to add your layer to the map */
},
onRemove: function(map){
/* how to remove your layer from the map */
}
});
Create a consistant tile like grid to query an API with. This reduces calls for duplicate areas and results in smaller requests.
Request Instagram content in each grid cell.
http://patrickarlt.github.io/extending-leaflet-talk / @patrickarlt