@geolonia/maps-core 0.1.0 → 0.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.
@@ -814,7 +814,7 @@ var GeoloniaMarker = class extends import_maplibre_gl.default.Marker {
814
814
  };
815
815
 
816
816
  // src/lib/simplestyle.ts
817
- var import_geojson_extent = __toESM(require("@mapbox/geojson-extent"), 1);
817
+ var import_bbox = __toESM(require("@turf/bbox"), 1);
818
818
  var import_center = __toESM(require("@turf/center"), 1);
819
819
  var import_maplibre_gl2 = __toESM(require("maplibre-gl"), 1);
820
820
 
@@ -1123,7 +1123,7 @@ var SimpleStyle = class {
1123
1123
  padding: 30,
1124
1124
  ...options
1125
1125
  };
1126
- const bounds = (0, import_geojson_extent.default)(this.geojson);
1126
+ const bounds = this.geojson.features.length > 0 ? (0, import_bbox.default)(this.geojson) : void 0;
1127
1127
  if (bounds) {
1128
1128
  window.requestAnimationFrame(() => {
1129
1129
  this.map.fitBounds(bounds, _options);
@@ -775,7 +775,7 @@ var GeoloniaMarker = class extends maplibregl.Marker {
775
775
  };
776
776
 
777
777
  // src/lib/simplestyle.ts
778
- import geojsonExtent from "@mapbox/geojson-extent";
778
+ import bbox from "@turf/bbox";
779
779
  import turfCenter from "@turf/center";
780
780
  import maplibregl2 from "maplibre-gl";
781
781
 
@@ -1084,7 +1084,7 @@ var SimpleStyle = class {
1084
1084
  padding: 30,
1085
1085
  ...options
1086
1086
  };
1087
- const bounds = geojsonExtent(this.geojson);
1087
+ const bounds = this.geojson.features.length > 0 ? bbox(this.geojson) : void 0;
1088
1088
  if (bounds) {
1089
1089
  window.requestAnimationFrame(() => {
1090
1090
  this.map.fitBounds(bounds, _options);
package/package.json CHANGED
@@ -1,26 +1,26 @@
1
1
  {
2
2
  "name": "@geolonia/maps-core",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.js",
7
- "types": "dist/index.d.ts",
5
+ "main": "dist/npm/index.cjs",
6
+ "module": "dist/npm/index.js",
7
+ "types": "dist/npm/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js",
12
- "require": "./dist/index.cjs"
10
+ "types": "./dist/npm/index.d.ts",
11
+ "import": "./dist/npm/index.js",
12
+ "require": "./dist/npm/index.cjs"
13
13
  },
14
14
  "./css": "./src/assets/style.css"
15
15
  },
16
16
  "files": [
17
- "dist",
17
+ "dist/npm",
18
18
  "src/assets/style.css"
19
19
  ],
20
20
  "dependencies": {
21
21
  "@geolonia/mbgl-gesture-handling": "^1.0.15",
22
- "@mapbox/geojson-extent": "^1.0.0",
23
- "@turf/center": "^6.0.1",
22
+ "@turf/bbox": "^7.3.4",
23
+ "@turf/center": "^7.3.4",
24
24
  "pmtiles": "^4.4.0",
25
25
  "sanitize-html": "^2.8.0",
26
26
  "tinycolor2": "^1.4.1"
@@ -33,18 +33,20 @@
33
33
  "@playwright/test": "^1.58.2",
34
34
  "@types/sanitize-html": "^2.16.1",
35
35
  "@types/tinycolor2": "^1.4.6",
36
+ "@vitest/coverage-v8": "^4.1.2",
36
37
  "jsdom": "^29.0.1",
37
38
  "maplibre-gl": "5.7.0",
38
39
  "tsup": "^8",
39
40
  "typescript": "^5.8",
40
- "vite": "^7.3.1",
41
- "vitest": "^3.2.0"
41
+ "vite": "^7.3.2",
42
+ "vitest": "^4.1.2"
42
43
  },
43
44
  "scripts": {
44
- "prepare": "tsup src/index.ts --format esm,cjs --dts --external maplibre-gl",
45
- "build": "tsup src/index.ts --format esm,cjs --dts --external maplibre-gl",
45
+ "build": "tsup",
46
+ "build:umd": "vite build --config vite.umd.config.ts",
46
47
  "test": "vitest run",
47
48
  "test:watch": "vitest",
49
+ "test:coverage": "vitest run --coverage",
48
50
  "dev": "vite --config vite.config.ts",
49
51
  "e2e": "playwright test",
50
52
  "lint": "biome check src/ test/ e2e/ example/",
File without changes
File without changes