UNPKG

gis-api

Version:

GIS API for DHIS 2 based on Leaflet

19 lines (13 loc) 484 B
import L from 'leaflet'; export const TileLayer = L.TileLayer.extend({ options: { errorTileUrl: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=', }, initialize(opts = {}) { const options = L.setOptions(this, opts); L.TileLayer.prototype.initialize.call(this, options.url, options); }, }); export default function tileLayer(options) { return new TileLayer(options); }