@file-viewer/renderer-geo 2.1.16 → 2.1.18

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.
Files changed (2) hide show
  1. package/dist/geo.js +16 -0
  2. package/package.json +3 -3
package/dist/geo.js CHANGED
@@ -927,6 +927,20 @@ const mountMapLibre = async (host, root, parsed, options, basemap, t) => {
927
927
  const onMapMoveEnd = () => {
928
928
  emitViewStateChange('map-move', 'user');
929
929
  };
930
+ const applyGeoFit = (request) => {
931
+ fit();
932
+ zoomEmitter.emit();
933
+ const state = emitViewStateChange('fit', request.source);
934
+ return {
935
+ applied: true,
936
+ mode: request.mode,
937
+ resize: request.resize,
938
+ scale: state.scale,
939
+ source: request.source,
940
+ provider: 'view-state',
941
+ state,
942
+ };
943
+ };
930
944
  map.on('zoomend', onMapZoomEnd);
931
945
  map.on('moveend', onMapMoveEnd);
932
946
  registerFileViewerZoomProvider(root, {
@@ -953,6 +967,7 @@ const mountMapLibre = async (host, root, parsed, options, basemap, t) => {
953
967
  zoomEmitter.emit();
954
968
  return createZoomState(map, parsed.bounds);
955
969
  },
970
+ fit: applyGeoFit,
956
971
  getState: () => createZoomState(map, parsed.bounds),
957
972
  subscribe: zoomEmitter.subscribe,
958
973
  });
@@ -991,6 +1006,7 @@ const mountMapLibre = async (host, root, parsed, options, basemap, t) => {
991
1006
  }
992
1007
  return getGeoViewState();
993
1008
  },
1009
+ fit: applyGeoFit,
994
1010
  subscribe: viewStateEmitter.subscribe,
995
1011
  });
996
1012
  const ResizeObserverCtor = (_a = host.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.ResizeObserver;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@file-viewer/renderer-geo",
3
- "version": "2.1.16",
3
+ "version": "2.1.18",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Standalone geospatial renderer plugin for Flyfish File Viewer with GeoJSON, KML, GPX, SHP parsing, CRS normalization, MapLibre overlay rendering, SVG fallback, and offline-friendly lazy loading.",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "funding": {
37
37
  "type": "individual",
38
- "url": "https://dev.flyfish.group/shop"
38
+ "url": "https://dev.flyfish.group/donate?source=npm"
39
39
  },
40
40
  "main": "./dist/index.js",
41
41
  "module": "./dist/index.js",
@@ -55,7 +55,7 @@
55
55
  "LICENSE"
56
56
  ],
57
57
  "dependencies": {
58
- "@file-viewer/core": "^2.1.16",
58
+ "@file-viewer/core": "^2.1.18",
59
59
  "@tmcw/togeojson": "^7.1.2",
60
60
  "maplibre-gl": "^5.24.0",
61
61
  "proj4": "^2.20.9",