UNPKG

@tianditu/wc

Version:

Web components for tianditu, powered by Demo Macro.

175 lines (174 loc) 5.8 kB
/*! * MIT © Demo Macro */ import { Host, h } from "@stencil/core"; import { filterProps, onload } from "../../utils/use"; export class TdtControlZoom { constructor() { this.position = "topleft"; this.zoomInText = undefined; this.zoomInTitle = undefined; this.zoomOutText = undefined; this.zoomOutTitle = undefined; this.uniqueId = undefined; this.control = undefined; this.map = undefined; } connectedCallback() { onload(() => { this.map = globalThis[this.uniqueId]; this.control = new T.Control.Zoom(filterProps({ position: this.position, zoomInText: this.zoomInText, zoomInTitle: this.zoomInTitle, zoomOutText: this.zoomOutText, zoomOutTitle: this.zoomOutTitle, })); this.map.addControl(this.control); }); } render() { return (h(Host, { key: '773062392af8eba280a0c89174f51f29e0f7d16f' }, h("slot", { key: '244b2ba65daf8eb0e2335b68cff94dd268929347' }))); } static get is() { return "tdt-control-zoom"; } static get encapsulation() { return "shadow"; } static get properties() { return { "position": { "type": "string", "mutable": false, "complexType": { "original": "T.ControlPosition", "resolved": "\"bottomleft\" | \"bottomright\" | \"topleft\" | \"topright\"", "references": { "T": { "location": "global", "id": "global::T" } } }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "position", "reflect": true, "defaultValue": "\"topleft\"" }, "zoomInText": { "type": "string", "mutable": false, "complexType": { "original": "T.ControlZoomOptions[\"zoomInText\"]", "resolved": "string | undefined", "references": { "T": { "location": "global", "id": "global::T" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "zoom-in-text", "reflect": true }, "zoomInTitle": { "type": "string", "mutable": false, "complexType": { "original": "T.ControlZoomOptions[\"zoomInTitle\"]", "resolved": "string | undefined", "references": { "T": { "location": "global", "id": "global::T" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "zoom-in-title", "reflect": true }, "zoomOutText": { "type": "string", "mutable": false, "complexType": { "original": "T.ControlZoomOptions[\"zoomOutText\"]", "resolved": "string | undefined", "references": { "T": { "location": "global", "id": "global::T" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "zoom-out-text", "reflect": true }, "zoomOutTitle": { "type": "string", "mutable": false, "complexType": { "original": "T.ControlZoomOptions[\"zoomOutTitle\"]", "resolved": "string | undefined", "references": { "T": { "location": "global", "id": "global::T" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "zoom-out-title", "reflect": true }, "uniqueId": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": true, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "unique-id", "reflect": true } }; } static get states() { return { "control": {}, "map": {} }; } } //# sourceMappingURL=tdt-control-zoom.js.map