UNPKG

@nextgis/ngw-leaflet

Version:

Single-file bundle for rapid deployment of Leaflet-based web-gis applications with NextGIS services

103 lines (94 loc) 3.23 kB
/** Bundle of @nextgis/ngw-leaflet; version: 3.0.1; author: NextGIS */ import LeafletMapAdapter from '@nextgis/leaflet-map-adapter'; import { NgwMap } from '@nextgis/ngw-map'; import { Icon } from 'leaflet'; import iconUrl from 'leaflet/dist/images/marker-icon.png'; import iconRetinaUrl from 'leaflet/dist/images/marker-icon-2x.png'; import shadowUrl from 'leaflet/dist/images/marker-shadow.png'; import 'leaflet/dist/leaflet.css'; function styleInject(css, ref) { if ( ref === void 0 ) ref = {}; var insertAt = ref.insertAt; if (typeof document === 'undefined') { return; } var head = document.head || document.getElementsByTagName('head')[0]; var style = document.createElement('style'); style.type = 'text/css'; if (insertAt === 'top') { if (head.firstChild) { head.insertBefore(style, head.firstChild); } else { head.appendChild(style); } } else { head.appendChild(style); } if (style.styleSheet) { style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); } } var css_248z = ".ngw-map-container.leaflet-container{background:#fff}.leaflet-pane .leaflet-popup-pane{z-index:9999999999}"; styleInject(css_248z); var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __async = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { var fulfilled = (value) => { try { step(generator.next(value)); } catch (e) { reject(e); } }; var rejected = (value) => { try { step(generator.throw(value)); } catch (e) { reject(e); } }; var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); step((generator = generator.apply(__this, __arguments)).next()); }); }; delete Icon.Default.prototype._getIconUrl; Icon.Default.mergeOptions({ iconRetinaUrl, iconUrl, shadowUrl }); class NgwLeaflet extends NgwMap { constructor(options) { options = __spreadProps(__spreadValues({}, options), { mapAdapter: new LeafletMapAdapter() }); super(options); } static create(options) { return __async(this, null, function* () { const ngwMap = new NgwLeaflet(options); return ngwMap.onLoad(); }); } } if (window && !window.NgwMap) { window.NgwMap = NgwLeaflet; } export { NgwLeaflet as default }; //# sourceMappingURL=ngw-leaflet.esm-bundler.js.map