Path: blob/main/docs/advanced_guide/override_leaflet_class_methods.md
2046 views
Overriding Leaflet class methods
Customizing Leaflet behavior
Sometimes you want to override Leaflet's javascript behavior. This can be done using the Class.include statement. This mimics Leaflet's L.Class.include method. See here for more details.
Example: adding an authentication header to a TileLayer
One such use case is if you need to override the createTile on L.TileLayer, because your tiles are hosted on an oauth2 protected server. This can be done like this: