@geolonia/embed 3.3.0 → 4.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geolonia/embed",
3
- "version": "3.3.0",
3
+ "version": "4.0.0",
4
4
  "description": "Geolonia embed JS API",
5
5
  "main": "dist/embed.js",
6
6
  "types": "src/embed.d.ts",
@@ -47,13 +47,12 @@
47
47
  "webpack-dev-server": "^4.11.1"
48
48
  },
49
49
  "dependencies": {
50
- "@geolonia/mbgl-geolonia-control": "^0.4.2",
51
50
  "@geolonia/mbgl-gesture-handling": "^1.0.15",
52
51
  "@mapbox/geojson-extent": "^1.0.0",
53
52
  "@mapbox/point-geometry": "^0.1.0",
54
53
  "@turf/center": "^6.0.1",
55
54
  "core-js": "^3.26.1",
56
- "maplibre-gl": "2.4.0",
55
+ "maplibre-gl": "3.0.1",
57
56
  "pmtiles": "^2.7.2",
58
57
  "promise-polyfill": "^8.2.3",
59
58
  "sanitize-html": "^2.8.0",
@@ -0,0 +1,34 @@
1
+ export class GeoloniaControl {
2
+ onAdd() {
3
+ this.container = document.createElement('div');
4
+ this.container.className = 'maplibregl-ctrl';
5
+
6
+ const img = document.createElement('img');
7
+ img.src = 'https://cdn.geolonia.com/logo/geolonia-symbol_1.png';
8
+ img.style.width = '16px';
9
+ img.style.height = '16px';
10
+ img.style.display = 'block';
11
+ img.style.cursor = 'pointer';
12
+ img.style.padding = '0';
13
+ img.style.margin = '0';
14
+ img.style.border = 'none';
15
+ img.alt = 'Geolonia';
16
+
17
+ const link = document.createElement('a');
18
+ link.href = 'https://geolonia.com/';
19
+ link.appendChild(img);
20
+ link.title = 'Powered by Geolonia';
21
+
22
+ this.container.appendChild(link);
23
+
24
+ return this.container;
25
+ }
26
+
27
+ onRemove() {
28
+ this.container.parentNode.removeChild(this.container);
29
+ }
30
+
31
+ getDefaultPosition() {
32
+ return 'bottom-left';
33
+ }
34
+ }
@@ -1,7 +1,7 @@
1
1
  import 'whatwg-fetch';
2
2
  import 'promise-polyfill/src/polyfill';
3
3
  import maplibregl from 'maplibre-gl';
4
- import GeoloniaControl from '@geolonia/mbgl-geolonia-control';
4
+ import { GeoloniaControl } from './controls/geolonia-control';
5
5
  import CustomAttributionControl from './CustomAttributionControl';
6
6
  import GestureHandling from '@geolonia/mbgl-gesture-handling';
7
7
  import parseAtts from './parse-atts';
@@ -1,6 +1,6 @@
1
1
  import 'whatwg-fetch';
2
2
  import { getContainer } from '../util';
3
- import GeoloniaControl from '@geolonia/mbgl-geolonia-control';
3
+ import { GeoloniaControl } from '../controls/geolonia-control';
4
4
 
5
5
  const AWS_SDK_URL = 'https://sdk.amazonaws.com/js/aws-sdk-2.775.0.min.js';
6
6
  const AMPLIFY_URL = 'https://unpkg.com/@aws-amplify/core@3.7.0/dist/aws-amplify-core.min.js';
package/src/lib/util.js CHANGED
@@ -198,7 +198,7 @@ export function getOptions(container, params, atts) {
198
198
  pitch: parseFloat(atts.pitch),
199
199
  zoom: parseFloat(atts.zoom),
200
200
  hash: (atts.hash === 'on'),
201
- localIdeographFontFamily: undefined,
201
+ localIdeographFontFamily: 'sans-serif',
202
202
  attributionControl: false,
203
203
  };
204
204
 
package/src/style.css CHANGED
@@ -112,22 +112,18 @@
112
112
 
113
113
  /* CSS for Attribution */
114
114
  /* Fix: https://github.com/geolonia/embed/issues/291 */
115
- .mapboxgl-map,
116
115
  .maplibregl-map {
117
116
  display: block!important;
118
117
  }
119
118
 
120
- .maplibregl-ctrl-attrib-inner.mapboxgl-ctrl-attrib-inner {
119
+ .maplibregl-ctrl-attrib-inner {
121
120
  display: block!important;
122
121
  }
123
122
 
124
- .mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner,
125
123
  .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner {
126
124
  display: none!important;
127
125
  }
128
126
 
129
- .mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,
130
- .mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,
131
127
  .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner,
132
128
  .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button {
133
129
  display: block!important;