@geolonia/embed 4.2.0 → 4.2.2
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.
- package/dist/embed +1 -1
- package/dist/embed.js +1 -1
- package/dist/lib/CustomAttributionControl.d.ts +2 -0
- package/dist/lib/geolonia-map.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/lib/CustomAttributionControl.ts +20 -0
- package/src/lib/geolonia-map.ts +1 -1
- package/src/style.css +6 -0
|
@@ -31,6 +31,8 @@ declare class CustomAttributionControl implements IControl {
|
|
|
31
31
|
private _attribHTML;
|
|
32
32
|
private styleId;
|
|
33
33
|
private styleOwner;
|
|
34
|
+
private printQuery;
|
|
35
|
+
private onMediaPrintChange;
|
|
34
36
|
constructor(options?: {});
|
|
35
37
|
getDefaultPosition(): ControlPosition;
|
|
36
38
|
onAdd(map: any): any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import maplibregl from 'maplibre-gl';
|
|
2
2
|
import type { MapOptions, StyleOptions, StyleSpecification, StyleSwapOptions } from 'maplibre-gl';
|
|
3
|
-
export type GeoloniaMapOptions =
|
|
3
|
+
export type GeoloniaMapOptions = MapOptions & {
|
|
4
4
|
interactive?: boolean;
|
|
5
5
|
};
|
|
6
6
|
/**
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.2.
|
|
1
|
+
export declare const VERSION = "4.2.2";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geolonia/embed",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.2",
|
|
4
4
|
"description": "Geolonia embed JS API",
|
|
5
5
|
"main": "dist/embed.js",
|
|
6
6
|
"types": "dist/embed.d.ts",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"@mapbox/geojson-extent": "^1.0.0",
|
|
54
54
|
"@mapbox/point-geometry": "^0.1.0",
|
|
55
55
|
"@turf/center": "^6.0.1",
|
|
56
|
-
"maplibre-gl": "3.
|
|
57
|
-
"pmtiles": "
|
|
56
|
+
"maplibre-gl": "3.4.1",
|
|
57
|
+
"pmtiles": "2.11.0",
|
|
58
58
|
"sanitize-html": "^2.8.0",
|
|
59
59
|
"tinycolor2": "^1.4.1"
|
|
60
60
|
}
|
|
@@ -35,6 +35,8 @@ class CustomAttributionControl implements IControl {
|
|
|
35
35
|
private _attribHTML;
|
|
36
36
|
private styleId;
|
|
37
37
|
private styleOwner;
|
|
38
|
+
private printQuery;
|
|
39
|
+
private onMediaPrintChange;
|
|
38
40
|
|
|
39
41
|
constructor(options = {}) {
|
|
40
42
|
this.options = options;
|
|
@@ -190,6 +192,12 @@ class CustomAttributionControl implements IControl {
|
|
|
190
192
|
}
|
|
191
193
|
}
|
|
192
194
|
|
|
195
|
+
@media print {
|
|
196
|
+
.maplibregl-ctrl-attrib-button {
|
|
197
|
+
display: none!important;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
193
201
|
.maplibregl-ctrl-attrib a {
|
|
194
202
|
color: rgba(0,0,0,.75);
|
|
195
203
|
text-decoration: none;
|
|
@@ -218,6 +226,16 @@ class CustomAttributionControl implements IControl {
|
|
|
218
226
|
shadow.appendChild(style);
|
|
219
227
|
shadow.appendChild(this._shadowContainer);
|
|
220
228
|
|
|
229
|
+
this.printQuery = window.matchMedia('print');
|
|
230
|
+
this.onMediaPrintChange = (e) => {
|
|
231
|
+
if (e.matches) {
|
|
232
|
+
// force open
|
|
233
|
+
this._shadowContainer.setAttribute('open', '');
|
|
234
|
+
this._shadowContainer.classList.remove('maplibregl-compact-show');
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
this.printQuery.addEventListener('change', this.onMediaPrintChange);
|
|
238
|
+
|
|
221
239
|
return this._container;
|
|
222
240
|
}
|
|
223
241
|
|
|
@@ -233,6 +251,8 @@ class CustomAttributionControl implements IControl {
|
|
|
233
251
|
this._map = undefined;
|
|
234
252
|
this._compact = undefined;
|
|
235
253
|
this._attribHTML = undefined;
|
|
254
|
+
|
|
255
|
+
this.printQuery.removeEventListener('change', this.onMediaPrintChange);
|
|
236
256
|
}
|
|
237
257
|
|
|
238
258
|
_setElementTitle(element, title) {
|
package/src/lib/geolonia-map.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { getContainer, getOptions, getSessionId, getStyle, handleRestrictedMode,
|
|
|
12
12
|
|
|
13
13
|
import type { MapOptions, PointLike, StyleOptions, StyleSpecification, StyleSwapOptions } from 'maplibre-gl';
|
|
14
14
|
|
|
15
|
-
export type GeoloniaMapOptions =
|
|
15
|
+
export type GeoloniaMapOptions = MapOptions & { interactive?: boolean };
|
|
16
16
|
|
|
17
17
|
type Container = HTMLElement & {
|
|
18
18
|
geoloniaMap: GeoloniaMap;
|