@teipublisher/pb-components 1.32.0 → 1.33.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.
- package/CHANGELOG.md +37 -0
- package/dist/demo/demos.json +4 -1
- package/dist/demo/pb-timeline.html +122 -0
- package/dist/demo/pb-timeline2.html +94 -0
- package/dist/demo/timeline-dev-data.json +3 -0
- package/dist/pb-components-bundle.js +508 -252
- package/dist/pb-elements.json +275 -3
- package/dist/pb-leaflet-map.js +2 -2
- package/i18n/common/de.json +4 -0
- package/i18n/common/en.json +4 -0
- package/package.json +1 -1
- package/pb-elements.json +275 -3
- package/src/parse-date-service.js +266 -0
- package/src/pb-browse-docs.js +1 -0
- package/src/pb-components.js +1 -0
- package/src/pb-geolocation.js +12 -0
- package/src/pb-leaflet-map.js +45 -9
- package/src/pb-split-list.js +3 -3
- package/src/pb-timeline.js +741 -0
- package/src/search-result-service.js +521 -0
package/src/pb-leaflet-map.js
CHANGED
|
@@ -9,9 +9,22 @@ import './pb-map-layer.js';
|
|
|
9
9
|
*
|
|
10
10
|
* @slot - may contain a series of `pb-map-layer` configurations
|
|
11
11
|
* @fires pb-leaflet-marker-click - Fires event to be processed by the map upon click
|
|
12
|
-
* @fires pb-update-map - When received, redraws the map to fit markers passed in with the event
|
|
13
|
-
*
|
|
14
|
-
* @fires pb-
|
|
12
|
+
* @fires pb-update-map - When received, redraws the map to fit markers passed in with the event.
|
|
13
|
+
* Event details should include an array of locations, see `pb-geolocation` event below.
|
|
14
|
+
* @fires pb-update - When received, redraws the map to show markers for all pb-geolocation elements found in the content of the pb-view
|
|
15
|
+
* @fires pb-geolocation - When received, focuses the map on the geocoordinates passed in with the event.
|
|
16
|
+
* The event details should include an object:
|
|
17
|
+
* ```
|
|
18
|
+
* {
|
|
19
|
+
* coordinates: {
|
|
20
|
+
* latitude: Number,
|
|
21
|
+
* longitude: Number
|
|
22
|
+
* },
|
|
23
|
+
* label: string - the label to show on mouseover,
|
|
24
|
+
* zoom: Number - fixed zoom level to zoom to,
|
|
25
|
+
* fitBounds: Boolean - if true, recompute current zoom level to show all markers
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
15
28
|
*/
|
|
16
29
|
export class PbLeafletMap extends pbMixin(LitElement) {
|
|
17
30
|
static get properties() {
|
|
@@ -43,6 +56,16 @@ export class PbLeafletMap extends pbMixin(LitElement) {
|
|
|
43
56
|
cluster: {
|
|
44
57
|
type: Boolean
|
|
45
58
|
},
|
|
59
|
+
/**
|
|
60
|
+
* Limits up to which zoom level markers are arranged into clusters.
|
|
61
|
+
* Using a higher zoom level here will result in more markers to be shown.
|
|
62
|
+
*
|
|
63
|
+
* Requires `cluster` option to be enabled.
|
|
64
|
+
*/
|
|
65
|
+
disableClusteringAt: {
|
|
66
|
+
type: Number,
|
|
67
|
+
attribute: 'disable-clustering-at'
|
|
68
|
+
},
|
|
46
69
|
/**
|
|
47
70
|
* If enabled, the map will not automatically scroll to the coordinates received via `pb-geolocation`
|
|
48
71
|
*/
|
|
@@ -89,6 +112,7 @@ export class PbLeafletMap extends pbMixin(LitElement) {
|
|
|
89
112
|
this.disabled = true;
|
|
90
113
|
this.cluster = false;
|
|
91
114
|
this.fitMarkers = false;
|
|
115
|
+
this.disableClusteringAt = null;
|
|
92
116
|
}
|
|
93
117
|
|
|
94
118
|
connectedCallback() {
|
|
@@ -183,7 +207,7 @@ export class PbLeafletMap extends pbMixin(LitElement) {
|
|
|
183
207
|
if (this.toggle) {
|
|
184
208
|
this.disabled = false;
|
|
185
209
|
}
|
|
186
|
-
this._locationChanged(this.latitude, this.longitude);
|
|
210
|
+
this._locationChanged(this.latitude, this.longitude, ev.detail.zoom);
|
|
187
211
|
}
|
|
188
212
|
});
|
|
189
213
|
}
|
|
@@ -252,7 +276,11 @@ export class PbLeafletMap extends pbMixin(LitElement) {
|
|
|
252
276
|
this._configureLayers();
|
|
253
277
|
|
|
254
278
|
if (this.cluster) {
|
|
255
|
-
|
|
279
|
+
const options = {};
|
|
280
|
+
if (this.disableClusteringAt) {
|
|
281
|
+
options.disableClusteringAtZoom = this.disableClusteringAt;
|
|
282
|
+
}
|
|
283
|
+
this._markerLayer = L.markerClusterGroup(options);
|
|
256
284
|
} else {
|
|
257
285
|
this._markerLayer = L.layerGroup();
|
|
258
286
|
}
|
|
@@ -351,16 +379,24 @@ export class PbLeafletMap extends pbMixin(LitElement) {
|
|
|
351
379
|
}
|
|
352
380
|
}
|
|
353
381
|
|
|
354
|
-
_locationChanged(lat, long) {
|
|
382
|
+
_locationChanged(lat, long, zoom) {
|
|
355
383
|
if (this._map) {
|
|
356
384
|
const coords = L.latLng([lat, long]);
|
|
357
385
|
this._markerLayer.eachLayer((layer) => {
|
|
358
386
|
if (layer.getLatLng().equals(coords)) {
|
|
359
|
-
|
|
387
|
+
if (zoom && !this.noScroll) {
|
|
388
|
+
layer.openTooltip();
|
|
389
|
+
this._map.setView(coords, zoom);
|
|
390
|
+
} else if (this.cluster) {
|
|
391
|
+
this._markerLayer.zoomToShowLayer(layer, () =>
|
|
392
|
+
layer.openTooltip()
|
|
393
|
+
);
|
|
394
|
+
} else {
|
|
395
|
+
layer.openTooltip();
|
|
396
|
+
this._map.setView(coords, this.zoom);
|
|
397
|
+
}
|
|
360
398
|
}
|
|
361
399
|
});
|
|
362
|
-
if (!this.noScroll)
|
|
363
|
-
this._map.setView(coords, this.zoom);
|
|
364
400
|
}
|
|
365
401
|
}
|
|
366
402
|
|
package/src/pb-split-list.js
CHANGED
|
@@ -159,10 +159,10 @@ export class PbSplitList extends pbMixin(LitElement) {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
header {
|
|
162
|
-
display:
|
|
163
|
-
|
|
164
|
-
width: 100%;
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-wrap: wrap;
|
|
165
164
|
column-gap: 10px;
|
|
165
|
+
width: 100%;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
#items {
|