UNPKG

@tianditu/wc

Version:

Web components for tianditu, powered by Demo Macro.

61 lines (57 loc) 1.87 kB
/*! * MIT © Demo Macro */ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client'; import { o as onload } from './use.js'; const TdtControlScale$1 = /*@__PURE__*/ proxyCustomElement(class TdtControlScale extends HTMLElement { constructor() { super(); this.__registerHost(); this.__attachShadow(); this.position = "bottomleft"; this.color = undefined; this.uniqueId = undefined; this.control = undefined; this.map = undefined; } connectedCallback() { onload(() => { this.map = globalThis[this.uniqueId]; this.control = new T.Control.Scale({ position: this.position, }); this.map.addControl(this.control); }); } componentWillRender() { onload(() => { this.color && this.control.setColor(this.color); }); } render() { return (h(Host, { key: '8aadccd6ea8ebf1f0f26bd22e64b45e5555c1f29' }, h("slot", { key: 'e71e4d337a9c1de44b13eb205767e3ad6c122f06' }))); } }, [1, "tdt-control-scale", { "position": [513], "color": [513], "uniqueId": [513, "unique-id"], "control": [32], "map": [32] }]); function defineCustomElement$1() { if (typeof customElements === "undefined") { return; } const components = ["tdt-control-scale"]; components.forEach(tagName => { switch (tagName) { case "tdt-control-scale": if (!customElements.get(tagName)) { customElements.define(tagName, TdtControlScale$1); } break; } }); } const TdtControlScale = TdtControlScale$1; const defineCustomElement = defineCustomElement$1; export { TdtControlScale, defineCustomElement }; //# sourceMappingURL=tdt-control-scale.js.map