@maptiler/geocoding-control
Advanced tools
Comparing version 0.0.61 to 0.0.72
{ | ||
"name": "@maptiler/geocoding-control", | ||
"version": "0.0.61", | ||
"version": "0.0.72", | ||
"type": "module", | ||
@@ -28,29 +28,48 @@ "author": { | ||
"maplibre-control", | ||
"control" | ||
"control", | ||
"react", | ||
"svelte" | ||
], | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build && mv dist/maplibregl.umd.cjs dist/maplibregl.umd.js && FLAVOUR=leaflet vite build && mv dist/leaflet.umd.cjs dist/leaflet.umd.js && tsc --outDir dist --declaration --emitDeclarationOnly", | ||
"build": "concurrently --names \"MAPLIBRE,MAPLIB-C,LEAFLET ,LEAFLE-C,REACT ,TYPES \" \"npm run build-maplibre\" \"npm run build-maplibre-controller\" \"npm run build-leaflet\" \"npm run build-leaflet-controller\" \"npm run build-react\" \"npm run build-types\"", | ||
"build-maplibre": "FLAVOUR=maplibre vite build && mv dist/maplibregl.umd.cjs dist/maplibregl.umd.js", | ||
"build-maplibre-controller": "FLAVOUR=maplibregl-controller vite build && mv dist/maplibregl-controller.umd.cjs dist/maplibregl-controller.umd.js", | ||
"build-leaflet": "FLAVOUR=leaflet vite build && mv dist/leaflet.umd.cjs dist/leaflet.umd.js", | ||
"build-leaflet-controller": "FLAVOUR=leaflet-controller vite build && mv dist/leaflet-controller.umd.cjs dist/leaflet-controller.umd.js", | ||
"build-react": "FLAVOUR=react vite build && mv dist/react.umd.cjs dist/react.umd.js", | ||
"build-types": "tsc --outDir dist --declaration --emitDeclarationOnly", | ||
"clean": "rm -rf dist", | ||
"order-dist-files": "mv dist/ReactGeocodingControl.d.ts dist/react.d.ts && mv dist/MaplibreglGeocodingControl.d.ts dist/maplibre.d.ts && mv dist/maplibreglMapController.d.ts dist/maplibregl-controller.d.ts && mv dist/LeafletGeocodingControl.d.ts dist/leaflet.d.ts && mv dist/leafletMapController.d.ts dist/leaflet-controller.d.ts && cp -r package.json src dist", | ||
"build-and-order-dist-files": "npm run clean && npm run build && npm run order-dist-files", | ||
"pack": "npm run build-and-order-dist-files && cd dist && npm pack", | ||
"publish": "npm run build-and-order-dist-files && cd dist && npm publish", | ||
"preview": "vite preview", | ||
"check": "svelte-check --tsconfig ./tsconfig.json" | ||
}, | ||
"files": [ | ||
"dist", | ||
"src/lib" | ||
], | ||
"exports": { | ||
"./leaflet": { | ||
"import": "./dist/leaflet.js", | ||
"require": "./dist/leaflet.umd.js", | ||
"types": "./dist/lib/LeafletGeocodingControl.d.ts" | ||
"import": "./leaflet.js", | ||
"require": "./leaflet.umd.js" | ||
}, | ||
"./leaflet-controller": { | ||
"import": "./leaflet-controller.js", | ||
"require": "./leaflet-controller.umd.js" | ||
}, | ||
"./maplibregl": { | ||
"import": "./dist/maplibregl.js", | ||
"require": "./dist/maplibregl.umd.js", | ||
"types": "./dist/lib/MaplibreglGeocodingControl.d.ts" | ||
"import": "./maplibregl.js", | ||
"require": "./maplibregl.umd.js" | ||
}, | ||
"./dist/style.css": { | ||
"import": "./dist/style.css", | ||
"require": "./dist/style.css" | ||
"./maplibregl-controller": { | ||
"import": "./maplibregl-controller.js", | ||
"require": "./maplibregl-controller.umd.js" | ||
}, | ||
"./react": { | ||
"import": "./react.js", | ||
"require": "./react.umd.js" | ||
}, | ||
"./style.css": { | ||
"import": "./style.css", | ||
"require": "./style.css" | ||
}, | ||
"./src/lib/GeocodingControl.svelte": { | ||
@@ -61,3 +80,5 @@ "import": "./src/lib/GeocodingControl.svelte", | ||
}, | ||
"types": "./dist/lib/index.d.ts", | ||
"dependencies": { | ||
"@types/geojson": "^7946.0.10" | ||
}, | ||
"devDependencies": { | ||
@@ -70,4 +91,11 @@ "@sveltejs/vite-plugin-svelte": "^2.0.2", | ||
"@types/leaflet": "^1.9.0", | ||
"@types/react": "^18.0.27", | ||
"@types/react-dom": "^18.0.10", | ||
"concurrently": "^7.6.0", | ||
"leaflet": "^1.9.3", | ||
"maplibre-gl": "^2.4.0", | ||
"prettier": "^2.8.3", | ||
"prettier-plugin-svelte": "^2.9.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"svelte": "^3.55.1", | ||
@@ -82,3 +110,4 @@ "svelte-check": "^3.0.3", | ||
"leaflet": "^1.9.3", | ||
"maplibre-gl": "^2.4.0" | ||
"maplibre-gl": "^2.4.0", | ||
"react": "^18.2.0" | ||
}, | ||
@@ -91,4 +120,7 @@ "peerDependenciesMeta": { | ||
"optional": true | ||
}, | ||
"react": { | ||
"optional": true | ||
} | ||
} | ||
} |
@@ -12,2 +12,3 @@ import * as L from "leaflet"; | ||
import { setMask } from "./mask"; | ||
import type { GeoJSON } from "geojson"; | ||
@@ -167,3 +168,3 @@ export function createLeafletMapController( | ||
function setData(data?: GeoJSON.GeoJSON) { | ||
function setData(data?: GeoJSON) { | ||
resultLayer.clearLayers(); | ||
@@ -265,7 +266,5 @@ | ||
marker | ||
.addTo(map) | ||
.bindTooltip(feature.place_name.replace(/,.*/, ""), { | ||
direction: "top", | ||
}); | ||
marker.addTo(map).bindTooltip(feature.place_name.replace(/,.*/, ""), { | ||
direction: "top", | ||
}); | ||
@@ -272,0 +271,0 @@ const element = marker.getElement(); |
@@ -14,3 +14,3 @@ import type MapLibreGL from "maplibre-gl"; | ||
import MarkerIcon from "./MarkerIcon.svelte"; | ||
import type { Feature, MapController, MapEvent, Proximity } from "./types"; | ||
import type { Feature, MapController, MapEvent, Proximity } from "./types.js"; | ||
import union from "@turf/union"; | ||
@@ -24,4 +24,5 @@ import type { | ||
import { setMask } from "./mask"; | ||
import type { FeatureCollection, GeoJSON } from "geojson"; | ||
let emptyGeojson: GeoJSON.FeatureCollection = { | ||
let emptyGeojson: FeatureCollection = { | ||
type: "FeatureCollection", | ||
@@ -223,3 +224,3 @@ features: [], | ||
function setData(data: GeoJSON.GeoJSON) { | ||
function setData(data: GeoJSON) { | ||
(map.getSource("full-geom") as GeoJSONSource)?.setData(data); | ||
@@ -226,0 +227,0 @@ } |
@@ -9,2 +9,3 @@ import type { | ||
import buffer from "@turf/buffer"; | ||
import type { GeoJSON } from "geojson"; | ||
@@ -28,3 +29,3 @@ // see https://maplibre.org/maplibre-gl-js-docs/example/line-across-180th-meridian/ | ||
picked: TurfFeature<Polygon | MultiPolygon>, | ||
setData: (data: GeoJSON.GeoJSON) => void | ||
setData: (data: GeoJSON) => void | ||
) { | ||
@@ -31,0 +32,0 @@ const diff = difference( |
@@ -1,2 +0,4 @@ | ||
export type Feature = GeoJSON.Feature & { | ||
import type { Feature as FeatureType } from "geojson"; | ||
export type Feature = FeatureType & { | ||
id: string; | ||
@@ -3,0 +5,0 @@ text: string; |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
3922625
37
71958
4
21
5
1
0
8
7
+ Added@types/geojson@^7946.0.10
+ Addedjs-tokens@4.0.0(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedreact@18.3.1(transitive)