@mcp-b/geo-leaflet 0.2.0 → 0.2.1
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.
|
@@ -26,6 +26,8 @@ declare class SigveloLeafletMap extends GeoMapElement {
|
|
|
26
26
|
attributionControl: boolean;
|
|
27
27
|
/** @internal */
|
|
28
28
|
private _map;
|
|
29
|
+
/** @internal */
|
|
30
|
+
private attributionFooter?;
|
|
29
31
|
/** Access the underlying Leaflet map instance (after mapReady resolves). */
|
|
30
32
|
get map(): L.Map | null;
|
|
31
33
|
protected createMap(container: HTMLElement): void;
|
|
@@ -34,6 +36,7 @@ declare class SigveloLeafletMap extends GeoMapElement {
|
|
|
34
36
|
protected invalidateSize(): void;
|
|
35
37
|
flyTo(options: FlyToOptions): void;
|
|
36
38
|
fitBounds(options: FitBoundsOptions): void;
|
|
39
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
37
40
|
}
|
|
38
41
|
declare global {
|
|
39
42
|
interface HTMLElementTagNameMap {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as SigveloLeafletMap } from "../../map-
|
|
1
|
+
import { t as SigveloLeafletMap } from "../../map-DzUl12tT.js";
|
|
2
2
|
export { SigveloLeafletMap };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as SigveloLeafletMap } from "./map-
|
|
1
|
+
import { t as SigveloLeafletMap } from "./map-DzUl12tT.js";
|
|
2
2
|
import { t as SigveloLeafletTilelayer } from "./tilelayer-DI2cPv01.js";
|
|
3
3
|
import { t as SigveloLeafletMarker } from "./marker-D4gW4fyF.js";
|
|
4
4
|
import { t as SigveloLeafletPopup } from "./popup-BDNUUZWQ.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
2
2
|
import * as L from "leaflet";
|
|
3
3
|
import iconUrl from "leaflet/dist/images/marker-icon.png";
|
|
4
|
-
import { css, unsafeCSS } from "lit";
|
|
5
|
-
import { customElement, property } from "lit/decorators.js";
|
|
4
|
+
import { css, html, unsafeCSS } from "lit";
|
|
5
|
+
import { customElement, property, query } from "lit/decorators.js";
|
|
6
6
|
import { GeoMapElement } from "@mcp-b/geo-support/base/geo-map-element";
|
|
7
7
|
import { SigveloMapClickEvent, SigveloMapLoadEvent, SigveloMapMoveEndEvent, SigveloMapMoveEvent, SigveloMapZoomEndEvent, SigveloMapZoomEvent } from "@mcp-b/geo-support/events";
|
|
8
8
|
import leafletCss from "leaflet/dist/leaflet.css?raw";
|
|
@@ -21,8 +21,22 @@ var map_styles_default = css`
|
|
|
21
21
|
background: var(--sigvelo-color-surface-sunken, #171717);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
.map-layout {
|
|
25
|
+
position: absolute;
|
|
26
|
+
inset: 0;
|
|
27
|
+
display: grid;
|
|
28
|
+
grid-template-rows: minmax(0, 1fr) auto;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.map-layout > .map-host {
|
|
32
|
+
position: relative;
|
|
33
|
+
inset: auto;
|
|
34
|
+
min-height: 0;
|
|
35
|
+
height: auto;
|
|
36
|
+
}
|
|
37
|
+
|
|
24
38
|
.leaflet-container {
|
|
25
|
-
border-radius:
|
|
39
|
+
border-radius: 0;
|
|
26
40
|
background: var(--sigvelo-color-surface-sunken, #171717);
|
|
27
41
|
font-family: inherit;
|
|
28
42
|
}
|
|
@@ -34,13 +48,18 @@ var map_styles_default = css`
|
|
|
34
48
|
* underlining it satisfies the rule without depending on hue, and the
|
|
35
49
|
* control picks up the active theme instead of Leaflet's fixed palette.
|
|
36
50
|
*/
|
|
37
|
-
.
|
|
38
|
-
|
|
51
|
+
.attribution-footer {
|
|
52
|
+
display: flex;
|
|
53
|
+
box-sizing: border-box;
|
|
39
54
|
width: 100%;
|
|
40
|
-
|
|
55
|
+
min-width: 0;
|
|
56
|
+
justify-content: flex-end;
|
|
57
|
+
border-top: 1px solid var(--sigvelo-color-neutral-border-muted, rgb(255 255 255 / 15%));
|
|
58
|
+
color: var(--sigvelo-color-text-muted, #b4b4b4);
|
|
59
|
+
background: var(--sigvelo-color-surface, #181818);
|
|
41
60
|
}
|
|
42
61
|
|
|
43
|
-
.
|
|
62
|
+
.attribution-footer .leaflet-control-attribution {
|
|
44
63
|
float: none;
|
|
45
64
|
box-sizing: border-box;
|
|
46
65
|
width: 100%;
|
|
@@ -48,10 +67,9 @@ var map_styles_default = css`
|
|
|
48
67
|
margin: 0;
|
|
49
68
|
padding: 4px 8px;
|
|
50
69
|
border: 0;
|
|
51
|
-
border-top: 1px solid var(--sigvelo-color-neutral-border-muted, rgb(255 255 255 / 15%));
|
|
52
70
|
border-radius: 0;
|
|
53
71
|
color: var(--sigvelo-color-text-muted, #b4b4b4);
|
|
54
|
-
background:
|
|
72
|
+
background: transparent;
|
|
55
73
|
box-shadow: none;
|
|
56
74
|
font-size: 11px;
|
|
57
75
|
line-height: 1.35;
|
|
@@ -60,7 +78,7 @@ var map_styles_default = css`
|
|
|
60
78
|
pointer-events: auto;
|
|
61
79
|
}
|
|
62
80
|
|
|
63
|
-
.
|
|
81
|
+
.attribution-footer .leaflet-control-attribution a {
|
|
64
82
|
color: var(--sigvelo-color-primary-text, #ececec);
|
|
65
83
|
text-decoration: underline;
|
|
66
84
|
text-underline-offset: 2px;
|
|
@@ -125,6 +143,10 @@ let SigveloLeafletMap = class SigveloLeafletMap extends GeoMapElement {
|
|
|
125
143
|
zoomControl: this.zoomControl,
|
|
126
144
|
attributionControl: this.attributionControl
|
|
127
145
|
});
|
|
146
|
+
if (this.attributionControl) {
|
|
147
|
+
const attribution = this._map.attributionControl.getContainer();
|
|
148
|
+
if (attribution && this.attributionFooter) this.attributionFooter.append(attribution);
|
|
149
|
+
}
|
|
128
150
|
this._map.on("click", (e) => {
|
|
129
151
|
this.dispatchEvent(new SigveloMapClickEvent({
|
|
130
152
|
lat: e.latlng.lat,
|
|
@@ -190,6 +212,19 @@ let SigveloLeafletMap = class SigveloLeafletMap extends GeoMapElement {
|
|
|
190
212
|
maxZoom: options.maxZoom
|
|
191
213
|
});
|
|
192
214
|
}
|
|
215
|
+
render() {
|
|
216
|
+
return html`
|
|
217
|
+
<div class="map-layout">
|
|
218
|
+
<div class="map-host" part="map"></div>
|
|
219
|
+
${this.attributionControl ? html`<footer
|
|
220
|
+
class="attribution-footer"
|
|
221
|
+
part="attribution"
|
|
222
|
+
aria-label="Map attribution"
|
|
223
|
+
></footer>` : null}
|
|
224
|
+
</div>
|
|
225
|
+
<slot></slot>
|
|
226
|
+
`;
|
|
227
|
+
}
|
|
193
228
|
};
|
|
194
229
|
__decorate([property({
|
|
195
230
|
attribute: "zoom-control",
|
|
@@ -199,6 +234,7 @@ __decorate([property({
|
|
|
199
234
|
attribute: "attribution-control",
|
|
200
235
|
type: Boolean
|
|
201
236
|
})], SigveloLeafletMap.prototype, "attributionControl", void 0);
|
|
237
|
+
__decorate([query(".attribution-footer")], SigveloLeafletMap.prototype, "attributionFooter", void 0);
|
|
202
238
|
SigveloLeafletMap = __decorate([customElement("sigvelo-leaflet-map")], SigveloLeafletMap);
|
|
203
239
|
//#endregion
|
|
204
240
|
export { SigveloLeafletMap as t };
|