@mcp-b/geo-maplibre 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/LICENSE +21 -0
  2. package/dist/circle-CFH3gDcY.js +146 -0
  3. package/dist/components/circle/circle.d.ts +51 -0
  4. package/dist/components/circle/circle.js +2 -0
  5. package/dist/components/control/control.d.ts +42 -0
  6. package/dist/components/control/control.js +2 -0
  7. package/dist/components/geojson/geojson.d.ts +74 -0
  8. package/dist/components/geojson/geojson.js +2 -0
  9. package/dist/components/layer/layer.d.ts +35 -0
  10. package/dist/components/layer/layer.js +2 -0
  11. package/dist/components/map/map.d.ts +43 -0
  12. package/dist/components/map/map.js +2 -0
  13. package/dist/components/marker/marker.d.ts +42 -0
  14. package/dist/components/marker/marker.js +2 -0
  15. package/dist/components/polygon/polygon.d.ts +46 -0
  16. package/dist/components/polygon/polygon.js +2 -0
  17. package/dist/components/polyline/polyline.d.ts +44 -0
  18. package/dist/components/polyline/polyline.js +2 -0
  19. package/dist/components/popup/popup.d.ts +27 -0
  20. package/dist/components/popup/popup.js +2 -0
  21. package/dist/components/scale-control/scale-control.d.ts +33 -0
  22. package/dist/components/scale-control/scale-control.js +2 -0
  23. package/dist/components/tilelayer/tilelayer.d.ts +65 -0
  24. package/dist/components/tilelayer/tilelayer.js +2 -0
  25. package/dist/control-Bka68vGo.js +61 -0
  26. package/dist/decorate-DcF3lt7P.js +9 -0
  27. package/dist/docs/custom-elements.json +1596 -0
  28. package/dist/geojson-BW9JQxtv.js +240 -0
  29. package/dist/index.d.ts +12 -0
  30. package/dist/index.js +12 -0
  31. package/dist/layer-COvBRP1h.js +61 -0
  32. package/dist/map-CYqh-osb.js +135 -0
  33. package/dist/marker-DzWveHNW.js +79 -0
  34. package/dist/polygon-BJ-z1X7p.js +119 -0
  35. package/dist/polyline-Dt4yBInz.js +98 -0
  36. package/dist/popup-BNRD9rNd.js +30 -0
  37. package/dist/scale-control-DPWq0EHU.js +58 -0
  38. package/dist/tilelayer-CCmClbSv.js +85 -0
  39. package/package.json +75 -0
@@ -0,0 +1,65 @@
1
+ import { LitElement, PropertyValues } from "lit";
2
+
3
+ //#region src/components/tilelayer/tilelayer.d.ts
4
+ /**
5
+ * A tile layer for a MapLibre map. Supports both vector tile styles (via
6
+ * `style-url`) and raster XYZ tile sources (via `url`).
7
+ *
8
+ * Must be a child of `<sigvelo-maplibre-map>`.
9
+ *
10
+ * @tag sigvelo-maplibre-tilelayer
11
+ *
12
+ * @example Vector tiles (style JSON)
13
+ * ```html
14
+ * <sigvelo-maplibre-tilelayer
15
+ * style-url="https://demotiles.maplibre.org/style.json"
16
+ * ></sigvelo-maplibre-tilelayer>
17
+ * ```
18
+ *
19
+ * @example Raster XYZ tiles
20
+ * ```html
21
+ * <sigvelo-maplibre-tilelayer
22
+ * url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
23
+ * attribution="&copy; OpenStreetMap contributors"
24
+ * ></sigvelo-maplibre-tilelayer>
25
+ * ```
26
+ */
27
+ declare class SigveloMaplibreTilelayer extends LitElement {
28
+ /** @internal */
29
+ static styles: import("lit").CSSResult[];
30
+ /**
31
+ * URL to a MapLibre/Mapbox style JSON document. When set, the map's
32
+ * entire style is replaced with this document (vector tiles, labels,
33
+ * styling rules are all defined in the style JSON).
34
+ */
35
+ styleUrl: string;
36
+ /**
37
+ * XYZ raster tile URL template. When set (and `style-url` is empty),
38
+ * adds a raster tile source and layer to the current map style.
39
+ */
40
+ url: string;
41
+ /** Attribution text (used with raster `url` tiles). */
42
+ attribution: string;
43
+ /** Opacity of the tile layer (0-1). */
44
+ opacity: number;
45
+ /** @internal */
46
+ private _rasterSourceId;
47
+ /** @internal */
48
+ private _rasterLayerId;
49
+ /** @internal */
50
+ private _mapEl;
51
+ connectedCallback(): Promise<void>;
52
+ disconnectedCallback(): void;
53
+ private _applyTiles;
54
+ private _addRasterLayer;
55
+ private _removeRasterLayer;
56
+ protected updated(changed: PropertyValues): void;
57
+ render(): import("lit-html").TemplateResult<1>;
58
+ }
59
+ declare global {
60
+ interface HTMLElementTagNameMap {
61
+ "sigvelo-maplibre-tilelayer": SigveloMaplibreTilelayer;
62
+ }
63
+ }
64
+ //#endregion
65
+ export { SigveloMaplibreTilelayer };
@@ -0,0 +1,2 @@
1
+ import { t as SigveloMaplibreTilelayer } from "../../tilelayer-CCmClbSv.js";
2
+ export { SigveloMaplibreTilelayer };
@@ -0,0 +1,61 @@
1
+ import { t as __decorate } from "./decorate-DcF3lt7P.js";
2
+ import { LitElement, css, html } from "lit";
3
+ import { customElement, property } from "lit/decorators.js";
4
+ //#region src/components/control/control.styles.ts
5
+ var control_styles_default = css`
6
+ :host {
7
+ display: none;
8
+ }
9
+ `;
10
+ //#endregion
11
+ //#region src/components/control/control.ts
12
+ let SigveloMaplibreControl = class SigveloMaplibreControl extends LitElement {
13
+ constructor(..._args) {
14
+ super(..._args);
15
+ this.position = "bottom-left";
16
+ this._control = null;
17
+ this._mapEl = null;
18
+ }
19
+ static {
20
+ this.styles = [control_styles_default];
21
+ }
22
+ async connectedCallback() {
23
+ super.connectedCallback();
24
+ this._mapEl = this.closest("sigvelo-maplibre-map");
25
+ if (this._mapEl) {
26
+ await this._mapEl.mapReady;
27
+ this._addControl();
28
+ }
29
+ }
30
+ disconnectedCallback() {
31
+ super.disconnectedCallback();
32
+ if (this._control && this._mapEl?.map) this._mapEl.map.removeControl(this._control);
33
+ this._control = null;
34
+ }
35
+ /** @internal */
36
+ _addControl() {
37
+ const map = this._mapEl?.map;
38
+ if (!map) return;
39
+ const children = Array.from(this.children);
40
+ let container;
41
+ this._control = {
42
+ onAdd: () => {
43
+ container = document.createElement("div");
44
+ container.className = "maplibregl-ctrl sigvelo-maplibre-custom-control";
45
+ for (const child of children) container.appendChild(child);
46
+ return container;
47
+ },
48
+ onRemove: () => {
49
+ container?.remove();
50
+ }
51
+ };
52
+ map.addControl(this._control, this.position);
53
+ }
54
+ render() {
55
+ return html` <slot></slot> `;
56
+ }
57
+ };
58
+ __decorate([property()], SigveloMaplibreControl.prototype, "position", void 0);
59
+ SigveloMaplibreControl = __decorate([customElement("sigvelo-maplibre-control")], SigveloMaplibreControl);
60
+ //#endregion
61
+ export { SigveloMaplibreControl as t };
@@ -0,0 +1,9 @@
1
+ //#region \0@oxc-project+runtime@0.138.0/helpers/esm/decorate.js
2
+ function __decorate(decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ }
8
+ //#endregion
9
+ export { __decorate as t };