@geolonia/embed 3.2.4 → 3.3.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/dist/embed +1 -1
- package/dist/embed.js +1 -1
- package/package.json +1 -1
- package/src/lib/geolonia-map.js +9 -0
- package/src/lib/parse-atts.js +1 -1
- package/src/lib/parse-atts.test.js +1 -1
package/package.json
CHANGED
package/src/lib/geolonia-map.js
CHANGED
|
@@ -37,6 +37,15 @@ const isCssSelector = (string) => {
|
|
|
37
37
|
export default class GeoloniaMap extends maplibregl.Map {
|
|
38
38
|
constructor(params) {
|
|
39
39
|
const container = util.getContainer(params);
|
|
40
|
+
|
|
41
|
+
if (!container) {
|
|
42
|
+
if ( typeof params === 'string') {
|
|
43
|
+
throw new Error(`[Geolonia] No HTML elements found matching \`${params}\`. Please ensure the map container element exists.`);
|
|
44
|
+
} else {
|
|
45
|
+
throw new Error('[Geolonia] No HTML elements found. Please ensure the map container element exists.');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
40
49
|
if (container.geoloniaMap) {
|
|
41
50
|
return container.geoloniaMap;
|
|
42
51
|
}
|
package/src/lib/parse-atts.js
CHANGED