@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
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { ColorOrExpressionSchema, ColorSchema, ContentBlockSchema, ContentElementSchema, ContentItemSchema, ExpressionSchema, LatitudeSchema, LngLatBoundsSchema, LngLatSchema, LongitudeSchema, NumberOrExpressionSchema, ValidTagNames, ZoomLevelSchema } from './schemas/index.js';
|
|
2
2
|
import { L as LayerSchema, P as PopupContentSchema, C as ControlsConfigSchema, d as MapConfig, G as GlobalConfig, e as MapBlock } from './page.schema-Cad2FFqh.js';
|
|
3
3
|
export { t as BackgroundLayerSchema, B as BaseLayerPropertiesSchema, _ as Block, W as BlockSchema, N as Chapter, O as ChapterAction, E as ChapterActionSchema, Q as ChapterLayers, J as ChapterLayersSchema, K as ChapterSchema, n as CircleLayerSchema, y as ControlPosition, w as ControlPositionSchema, z as ControlsConfig, r as FillExtrusionLayerSchema, F as FillLayerSchema, h as GeoJSONSourceSchema, Y as GlobalConfigSchema, H as HeatmapLayerSchema, s as HillshadeLayerSchema, I as ImageSourceSchema, l as InteractiveConfigSchema, v as LayerOrReferenceSchema, u as LayerReferenceSchema, c as LayerSourceSchema, A as LegendConfig, a as LegendConfigSchema, m as LegendItemSchema, o as LineLayerSchema, g as LoadingConfigSchema, M as MapBlockSchema, b as MapConfigSchema, D as MapFullPageBlock, x as MapFullPageBlockSchema, Z as MixedBlock, U as MixedBlockSchema, $ as Page, X as PageSchema, k as PopupContentItemSchema, q as RasterLayerSchema, i as RasterSourceSchema, a0 as RootConfig, R as RootSchema, T as ScrollytellingBlock, S as ScrollytellingBlockSchema, f as StreamConfigSchema, p as SymbolLayerSchema, V as VectorSourceSchema, j as VideoSourceSchema } from './page.schema-Cad2FFqh.js';
|
|
4
|
-
export { L as LegendBuilder, M as MapRenderer, c as MapRendererEvents, b as MapRendererOptions, P as ParseError, a as ParseResult, Y as YAMLParser, p as parseYAMLConfig, s as safeParseYAMLConfig } from './map-renderer-
|
|
4
|
+
export { L as LegendBuilder, M as MapRenderer, c as MapRendererEvents, b as MapRendererOptions, P as ParseError, a as ParseResult, Y as YAMLParser, p as parseYAMLConfig, s as safeParseYAMLConfig } from './map-renderer-SjO3KQmx.js';
|
|
5
5
|
import { Map, LngLat } from 'maplibre-gl';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import { FeatureCollection } from 'geojson';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z, ZodError } from 'zod';
|
|
2
2
|
import { parse } from 'yaml';
|
|
3
|
-
import
|
|
3
|
+
import { Popup, NavigationControl, GeolocateControl, ScaleControl, FullscreenControl, Map as Map$1 } from 'maplibre-gl';
|
|
4
4
|
|
|
5
5
|
// @maplibre-yaml/core - Declarative web maps with YAML
|
|
6
6
|
|
|
@@ -4029,7 +4029,7 @@ var EventHandler = class {
|
|
|
4029
4029
|
showPopup(content, feature, lngLat) {
|
|
4030
4030
|
this.activePopup?.remove();
|
|
4031
4031
|
const html = this.popupBuilder.build(content, feature.properties);
|
|
4032
|
-
this.activePopup = new
|
|
4032
|
+
this.activePopup = new Popup().setLngLat(lngLat).setHTML(html).addTo(this.map);
|
|
4033
4033
|
}
|
|
4034
4034
|
/**
|
|
4035
4035
|
* Detach events for a layer
|
|
@@ -4134,14 +4134,14 @@ var ControlsManager = class {
|
|
|
4134
4134
|
if (config.navigation) {
|
|
4135
4135
|
const options = typeof config.navigation === "object" ? config.navigation : {};
|
|
4136
4136
|
const position = options.position || "top-right";
|
|
4137
|
-
const control = new
|
|
4137
|
+
const control = new NavigationControl();
|
|
4138
4138
|
this.map.addControl(control, position);
|
|
4139
4139
|
this.addedControls.push(control);
|
|
4140
4140
|
}
|
|
4141
4141
|
if (config.geolocate) {
|
|
4142
4142
|
const options = typeof config.geolocate === "object" ? config.geolocate : {};
|
|
4143
4143
|
const position = options.position || "top-right";
|
|
4144
|
-
const control = new
|
|
4144
|
+
const control = new GeolocateControl({
|
|
4145
4145
|
positionOptions: { enableHighAccuracy: true },
|
|
4146
4146
|
trackUserLocation: true
|
|
4147
4147
|
});
|
|
@@ -4151,14 +4151,14 @@ var ControlsManager = class {
|
|
|
4151
4151
|
if (config.scale) {
|
|
4152
4152
|
const options = typeof config.scale === "object" ? config.scale : {};
|
|
4153
4153
|
const position = options.position || "bottom-left";
|
|
4154
|
-
const control = new
|
|
4154
|
+
const control = new ScaleControl();
|
|
4155
4155
|
this.map.addControl(control, position);
|
|
4156
4156
|
this.addedControls.push(control);
|
|
4157
4157
|
}
|
|
4158
4158
|
if (config.fullscreen) {
|
|
4159
4159
|
const options = typeof config.fullscreen === "object" ? config.fullscreen : {};
|
|
4160
4160
|
const position = options.position || "top-right";
|
|
4161
|
-
const control = new
|
|
4161
|
+
const control = new FullscreenControl();
|
|
4162
4162
|
this.map.addControl(control, position);
|
|
4163
4163
|
this.addedControls.push(control);
|
|
4164
4164
|
}
|
|
@@ -4186,7 +4186,7 @@ var MapRenderer = class {
|
|
|
4186
4186
|
constructor(container, config, layers = [], options = {}, sources) {
|
|
4187
4187
|
this.eventListeners = /* @__PURE__ */ new Map();
|
|
4188
4188
|
this.isLoaded = false;
|
|
4189
|
-
this.map = new
|
|
4189
|
+
this.map = new Map$1({
|
|
4190
4190
|
...config,
|
|
4191
4191
|
container: typeof container === "string" ? container : container,
|
|
4192
4192
|
style: config.mapStyle,
|