@geolonia/embed 2.1.7 → 2.1.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geolonia/embed",
3
- "version": "2.1.7",
3
+ "version": "2.1.8",
4
4
  "description": "Geolonia embed JS API",
5
5
  "main": "dist/embed.js",
6
6
  "types": "src/embed.d.ts",
@@ -5,6 +5,23 @@ import { DOM, bindAll } from './maplibre-util';
5
5
  * https://github.com/maplibre/maplibre-gl-js/blob/main/src/ui/control/attribution_control.ts
6
6
  */
7
7
 
8
+ /**
9
+ * When the map is too small to display the full attribution, it will be
10
+ * collapsed in to a "i" icon. It is open by default, and will hide itself
11
+ * when user interaction is detected.
12
+ * For more information on why this is open by default, see the following links:
13
+ *
14
+ * The OSM Foundation attribution guidelines.
15
+ * https://wiki.osmfoundation.org/wiki/Licence/Attribution_Guidelines#Interactive_maps
16
+ * > You may use a mechanism to fade/collapse the attribution under certain conditions:
17
+ * > * immediately with a dismiss interaction, for example clicking an ‘x’ in the corner of a dialog
18
+ * > * automatically on map interaction such as panning, clicking, or zooming
19
+ * > * automatically after five seconds. This also applies to splash screens or pop-ups.
20
+ *
21
+ * This is the issue where attribution is open by default in the MapLibre GL JS library:
22
+ * https://github.com/maplibre/maplibre-gl-js/issues/205
23
+ */
24
+
8
25
  class CustomAttributionControl {
9
26
 
10
27
  constructor(options = {}) {
@@ -152,7 +152,7 @@ class SimpleStyleVector {
152
152
  type: 'circle',
153
153
  source: this.sourceName,
154
154
  'source-layer': 'g-simplestyle-v1',
155
- filter: ['==', '$type', 'Point'],
155
+ filter: ['all', ['==', '$type', 'Point'], ['!has', 'marker-symbol']],
156
156
  paint: {
157
157
  'circle-radius': [
158
158
  'case',
@@ -180,11 +180,7 @@ class SimpleStyleVector {
180
180
  'text-halo-width': 1,
181
181
  },
182
182
  layout: {
183
- 'icon-image': [
184
- 'case',
185
- ['==', 'large', ['get', 'marker-size']], ['image', ['concat', ['get', 'marker-symbol'], '-15']],
186
- ['image', ['concat', ['get', 'marker-symbol'], '-11']],
187
- ],
183
+ 'icon-image': ['get', 'marker-symbol'],
188
184
  'text-field': ['get', 'title'],
189
185
  'text-font': ['Noto Sans Regular'],
190
186
  'text-size': 12,
@@ -201,6 +197,7 @@ class SimpleStyleVector {
201
197
  });
202
198
 
203
199
  this.setPopup(map, 'vt-circle-simple-style-points');
200
+ this.setPopup(map, 'vt-geolonia-simple-style-points');
204
201
  }
205
202
 
206
203
  async setPopup(map, source) {
@@ -196,7 +196,7 @@ class SimpleStyle {
196
196
  id: `${this.options.id}-circle-points`,
197
197
  type: 'circle',
198
198
  source: `${this.options.id}-points`,
199
- filter: ['!', ['has', 'point_count']],
199
+ filter: ['all', ['!has', 'point_count'], ['!has', 'marker-symbol']],
200
200
  paint: {
201
201
  'circle-radius': [
202
202
  'case',
@@ -223,11 +223,7 @@ class SimpleStyle {
223
223
  'text-halo-width': 1,
224
224
  },
225
225
  layout: {
226
- 'icon-image': [
227
- 'case',
228
- ['==', 'large', ['get', 'marker-size']], ['image', ['concat', ['get', 'marker-symbol'], '-15']],
229
- ['image', ['concat', ['get', 'marker-symbol'], '-11']],
230
- ],
226
+ 'icon-image': ['get', 'marker-symbol'],
231
227
  'text-field': ['get', 'title'],
232
228
  'text-font': ['Noto Sans Regular'],
233
229
  'text-size': 12,
@@ -244,6 +240,7 @@ class SimpleStyle {
244
240
  });
245
241
 
246
242
  this.setPopup(this.map, `${this.options.id}-circle-points`);
243
+ this.setPopup(this.map, `${this.options.id}-symbol-points`);
247
244
  }
248
245
 
249
246
  async setPopup(map, source) {