@maplibre-yaml/core 0.2.0 → 0.2.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/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +7 -7
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/{map-renderer-8-c51Ww7.d.ts → map-renderer-SjO3KQmx.d.ts} +3 -3
- package/dist/register.browser.js +7 -7
- package/dist/register.browser.js.map +1 -1
- package/dist/register.d.ts +1 -1
- package/dist/register.js +7 -7
- package/dist/register.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { R as RootSchema, M as MapBlockSchema, S as ScrollytellingBlockSchema, L as LayerSchema, a as LegendConfigSchema, b as MapConfigSchema, c as LayerSourceSchema, C as ControlsConfigSchema } from './page.schema-Cad2FFqh.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import
|
|
3
|
+
import { Map, LngLat } from 'maplibre-gl';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file YAML parser for MapLibre configuration files
|
|
@@ -516,12 +516,12 @@ interface MapRendererEvents {
|
|
|
516
516
|
'layer:click': {
|
|
517
517
|
layerId: string;
|
|
518
518
|
feature: any;
|
|
519
|
-
lngLat:
|
|
519
|
+
lngLat: LngLat;
|
|
520
520
|
};
|
|
521
521
|
'layer:hover': {
|
|
522
522
|
layerId: string;
|
|
523
523
|
feature: any;
|
|
524
|
-
lngLat:
|
|
524
|
+
lngLat: LngLat;
|
|
525
525
|
};
|
|
526
526
|
}
|
|
527
527
|
/**
|
package/dist/register.browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Map as Map$1, Popup, NavigationControl, GeolocateControl, ScaleControl, FullscreenControl } from 'maplibre-gl';
|
|
2
2
|
|
|
3
3
|
// @maplibre-yaml/core - Browser build with bundled dependencies
|
|
4
4
|
var __create = Object.create;
|
|
@@ -15337,7 +15337,7 @@ var EventHandler = class {
|
|
|
15337
15337
|
showPopup(content, feature, lngLat) {
|
|
15338
15338
|
this.activePopup?.remove();
|
|
15339
15339
|
const html = this.popupBuilder.build(content, feature.properties);
|
|
15340
|
-
this.activePopup = new
|
|
15340
|
+
this.activePopup = new Popup().setLngLat(lngLat).setHTML(html).addTo(this.map);
|
|
15341
15341
|
}
|
|
15342
15342
|
/**
|
|
15343
15343
|
* Detach events for a layer
|
|
@@ -15442,14 +15442,14 @@ var ControlsManager = class {
|
|
|
15442
15442
|
if (config.navigation) {
|
|
15443
15443
|
const options = typeof config.navigation === "object" ? config.navigation : {};
|
|
15444
15444
|
const position = options.position || "top-right";
|
|
15445
|
-
const control = new
|
|
15445
|
+
const control = new NavigationControl();
|
|
15446
15446
|
this.map.addControl(control, position);
|
|
15447
15447
|
this.addedControls.push(control);
|
|
15448
15448
|
}
|
|
15449
15449
|
if (config.geolocate) {
|
|
15450
15450
|
const options = typeof config.geolocate === "object" ? config.geolocate : {};
|
|
15451
15451
|
const position = options.position || "top-right";
|
|
15452
|
-
const control = new
|
|
15452
|
+
const control = new GeolocateControl({
|
|
15453
15453
|
positionOptions: { enableHighAccuracy: true },
|
|
15454
15454
|
trackUserLocation: true
|
|
15455
15455
|
});
|
|
@@ -15459,14 +15459,14 @@ var ControlsManager = class {
|
|
|
15459
15459
|
if (config.scale) {
|
|
15460
15460
|
const options = typeof config.scale === "object" ? config.scale : {};
|
|
15461
15461
|
const position = options.position || "bottom-left";
|
|
15462
|
-
const control = new
|
|
15462
|
+
const control = new ScaleControl();
|
|
15463
15463
|
this.map.addControl(control, position);
|
|
15464
15464
|
this.addedControls.push(control);
|
|
15465
15465
|
}
|
|
15466
15466
|
if (config.fullscreen) {
|
|
15467
15467
|
const options = typeof config.fullscreen === "object" ? config.fullscreen : {};
|
|
15468
15468
|
const position = options.position || "top-right";
|
|
15469
|
-
const control = new
|
|
15469
|
+
const control = new FullscreenControl();
|
|
15470
15470
|
this.map.addControl(control, position);
|
|
15471
15471
|
this.addedControls.push(control);
|
|
15472
15472
|
}
|
|
@@ -15494,7 +15494,7 @@ var MapRenderer = class {
|
|
|
15494
15494
|
constructor(container, config, layers = [], options = {}, sources) {
|
|
15495
15495
|
this.eventListeners = /* @__PURE__ */ new Map();
|
|
15496
15496
|
this.isLoaded = false;
|
|
15497
|
-
this.map = new
|
|
15497
|
+
this.map = new Map$1({
|
|
15498
15498
|
...config,
|
|
15499
15499
|
container: typeof container === "string" ? container : container,
|
|
15500
15500
|
style: config.mapStyle,
|