This is an incomplete pull request to demonstrate how we might structure a Leaflet plugin to work with both the aging L namespace and using es6 imports. Particularly, if we want to use multiple plugins that modify the same object. In this case it's TileLayer. The default behavior of a Leaflet plugin is to load it on top of a leaflet import so that everything uses the same L object.
With this fork we can import only the updates and integrate them ourselves, like
import { TileLayer } from "leaflet";
import { options, includes } from "Leaflet.TileLayer.NoGap.js";
import { options as options2, includes as includes2 } from "another.plugin.js"
TileLayer.mergeOptions(options);
TileLayer.mergeOptions(options2);
TileLayer.include(includes)
TileLayer.include(includes2);
This is an incomplete pull request to demonstrate how we might structure a Leaflet plugin to work with both the aging
L
namespace and using es6 imports. Particularly, if we want to use multiple plugins that modify the same object. In this case it'sTileLayer
. The default behavior of a Leaflet plugin is to load it on top of a leaflet import so that everything uses the sameL
object.With this fork we can import only the updates and integrate them ourselves, like
and then use that
TileLayer
in our code, orso that another app can use it.