mirror of
https://github.com/maputnik/editor.git
synced 2026-08-27 15:37:27 +00:00
Update geocoder to 1.6.0 (#920)
This is to update geocoder to latest version which now have types and is fully modernized.
This commit is contained in:
Generated
+7
-6
@@ -10,7 +10,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mapbox/mapbox-gl-rtl-text": "^0.2.3",
|
"@mapbox/mapbox-gl-rtl-text": "^0.2.3",
|
||||||
"@maplibre/maplibre-gl-geocoder": "^1.5.0",
|
"@maplibre/maplibre-gl-geocoder": "^1.6.0",
|
||||||
"@maplibre/maplibre-gl-inspect": "^1.6.3",
|
"@maplibre/maplibre-gl-inspect": "^1.6.3",
|
||||||
"@maplibre/maplibre-gl-style-spec": "^20.1.1",
|
"@maplibre/maplibre-gl-style-spec": "^20.1.1",
|
||||||
"@mdi/js": "^7.4.47",
|
"@mdi/js": "^7.4.47",
|
||||||
@@ -1626,20 +1626,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@maplibre/maplibre-gl-geocoder": {
|
"node_modules/@maplibre/maplibre-gl-geocoder": {
|
||||||
"version": "1.5.0",
|
"version": "1.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-geocoder/-/maplibre-gl-geocoder-1.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-geocoder/-/maplibre-gl-geocoder-1.6.0.tgz",
|
||||||
"integrity": "sha512-PsAbV7WFIOu5QYZne95FiXoV7AV1/6ULMjQxgInhZ5DdB0hDLjciQPegnyDgkzI8JfeqoUMZVS/MglZnSZYhyQ==",
|
"integrity": "sha512-SU4cv1P+8ALZlGYLPNvlENadH4zzn8Lw5ajmhbmJgWdC/NzxGFS+u4TITSL8tjzhMFU4jepo42HvNmGtDJjFuQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"events": "^3.3.0",
|
||||||
"lodash.debounce": "^4.0.6",
|
"lodash.debounce": "^4.0.6",
|
||||||
"subtag": "^0.5.0",
|
"subtag": "^0.5.0",
|
||||||
"suggestions-list": "^0.0.2",
|
"suggestions-list": "^0.0.2",
|
||||||
"xtend": "^4.0.1"
|
"xtend": "^4.0.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6"
|
"node": ">=18"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"maplibre-gl": ">=1.14.0"
|
"maplibre-gl": ">=4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@maplibre/maplibre-gl-inspect": {
|
"node_modules/@maplibre/maplibre-gl-inspect": {
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@
|
|||||||
"homepage": "https://github.com/maplibre/maputnik#readme",
|
"homepage": "https://github.com/maplibre/maputnik#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mapbox/mapbox-gl-rtl-text": "^0.2.3",
|
"@mapbox/mapbox-gl-rtl-text": "^0.2.3",
|
||||||
"@maplibre/maplibre-gl-geocoder": "^1.5.0",
|
"@maplibre/maplibre-gl-geocoder": "^1.6.0",
|
||||||
"@maplibre/maplibre-gl-inspect": "^1.6.3",
|
"@maplibre/maplibre-gl-inspect": "^1.6.3",
|
||||||
"@maplibre/maplibre-gl-style-spec": "^20.1.1",
|
"@maplibre/maplibre-gl-style-spec": "^20.1.1",
|
||||||
"@mdi/js": "^7.4.47",
|
"@mdi/js": "^7.4.47",
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ import { HighlightedLayer, colorHighlightedLayer } from '../libs/highlight'
|
|||||||
import 'maplibre-gl/dist/maplibre-gl.css'
|
import 'maplibre-gl/dist/maplibre-gl.css'
|
||||||
import '../maplibregl.css'
|
import '../maplibregl.css'
|
||||||
import '../libs/maplibre-rtl'
|
import '../libs/maplibre-rtl'
|
||||||
//@ts-ignore
|
import MaplibreGeocoder, { MaplibreGeocoderApi, MaplibreGeocoderApiConfig } from '@maplibre/maplibre-gl-geocoder';
|
||||||
import MaplibreGeocoder from '@maplibre/maplibre-gl-geocoder';
|
|
||||||
import '@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css';
|
import '@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css';
|
||||||
import { withTranslation, WithTranslation } from 'react-i18next'
|
import { withTranslation, WithTranslation } from 'react-i18next'
|
||||||
|
|
||||||
@@ -222,7 +221,7 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
|
|||||||
|
|
||||||
initGeocoder(map: Map) {
|
initGeocoder(map: Map) {
|
||||||
const geocoderConfig = {
|
const geocoderConfig = {
|
||||||
forwardGeocode: async (config:{query: string, limit: number, language: string[]}) => {
|
forwardGeocode: async (config: MaplibreGeocoderApiConfig) => {
|
||||||
const features = [];
|
const features = [];
|
||||||
try {
|
try {
|
||||||
const request = `https://nominatim.openstreetmap.org/search?q=${config.query}&format=geojson&polygon_geojson=1&addressdetails=1`;
|
const request = `https://nominatim.openstreetmap.org/search?q=${config.query}&format=geojson&polygon_geojson=1&addressdetails=1`;
|
||||||
@@ -255,8 +254,8 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
|
|||||||
return {
|
return {
|
||||||
features
|
features
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
};
|
} as unknown as MaplibreGeocoderApi;
|
||||||
const geocoder = new MaplibreGeocoder(geocoderConfig, {
|
const geocoder = new MaplibreGeocoder(geocoderConfig, {
|
||||||
placeholder: this.props.t("Search"),
|
placeholder: this.props.t("Search"),
|
||||||
maplibregl: MapLibreGl,
|
maplibregl: MapLibreGl,
|
||||||
|
|||||||
Reference in New Issue
Block a user