diff --git a/CHANGELOG.md b/CHANGELOG.md index a531e66..90496d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format ## [Unreleased] +## [v2.5.0](https://github.com/studiometa/vue-mapbox-gl/compare/2.4.0...2.5.0) (2024-03-05) + +### Added + +- **StoreLocator:** add `disableFeatureClickZoom` prop to disable the zoom on feature click ([#136](https://github.com/studiometa/vue-mapbox-gl/pull/136)) + ## [v2.4.0](https://github.com/studiometa/vue-mapbox-gl/compare/2.3.4...2.4.0) (2024-02-23) ### Added diff --git a/package-lock.json b/package-lock.json index e57fdff..2e8fbef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@studiometa/vue-mapbox-gl-workspace", - "version": "2.4.0", + "version": "2.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@studiometa/vue-mapbox-gl-workspace", - "version": "2.4.0", + "version": "2.5.0", "workspaces": [ "packages/*" ], @@ -18996,7 +18996,7 @@ }, "packages/demo": { "name": "@studiometa/vue-mapbox-gl-demo", - "version": "2.4.0", + "version": "2.5.0", "dependencies": { "@mapbox/mapbox-gl-geocoder": "^5.0.2", "@studiometa/vue-mapbox-gl": "*", @@ -19050,7 +19050,7 @@ }, "packages/docs": { "name": "@studiometa/vue-mapbox-gl-docs", - "version": "2.4.0", + "version": "2.5.0", "devDependencies": { "sass": "^1.71.1", "tailwindcss": "^3.4.1", @@ -19059,7 +19059,7 @@ }, "packages/vue-mapbox-gl": { "name": "@studiometa/vue-mapbox-gl", - "version": "2.4.0", + "version": "2.5.0", "license": "GPL-3.0-or-later", "devDependencies": { "@mapbox/mapbox-gl-geocoder": "^5.0.1", diff --git a/package.json b/package.json index 7e9f0de..167bfc4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@studiometa/vue-mapbox-gl-workspace", "private": true, - "version": "2.4.0", + "version": "2.5.0", "workspaces": [ "packages/*" ], diff --git a/packages/demo/package.json b/packages/demo/package.json index 976cb1c..1d4ce69 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -1,6 +1,6 @@ { "name": "@studiometa/vue-mapbox-gl-demo", - "version": "2.4.0", + "version": "2.5.0", "scripts": { "dev": "nuxt dev", "build": "nuxt build" diff --git a/packages/docs/components/StoreLocator/index.md b/packages/docs/components/StoreLocator/index.md index 8dfcb2d..e0c464c 100644 --- a/packages/docs/components/StoreLocator/index.md +++ b/packages/docs/components/StoreLocator/index.md @@ -219,6 +219,13 @@ interface StoreLocatorClassesProp { Props to add a custom filtering on the `items` props. That is triggered on `onMapCreated` `onMapMoveend` event. +### `disableFeatureClickZoom` + +- Type `Boolean` +- Default `false` + +Disable the zoom on a feature click. + ## Events ### `map-created` diff --git a/packages/docs/package.json b/packages/docs/package.json index ac59a29..dcbe03d 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -2,7 +2,7 @@ "name": "@studiometa/vue-mapbox-gl-docs", "private": true, "type": "module", - "version": "2.4.0", + "version": "2.5.0", "scripts": { "dev": "vitepress", "build": "vitepress build" diff --git a/packages/vue-mapbox-gl/components/StoreLocator/StoreLocator.vue b/packages/vue-mapbox-gl/components/StoreLocator/StoreLocator.vue index bd5b3db..f68c31f 100644 --- a/packages/vue-mapbox-gl/components/StoreLocator/StoreLocator.vue +++ b/packages/vue-mapbox-gl/components/StoreLocator/StoreLocator.vue @@ -111,6 +111,11 @@ type: [Function, Boolean], default: false, }, + + /** + * Disable the zoom when clicking on a Feature. + */ + disableFeatureClickZoom: Boolean, }); const emit = defineEmits(); @@ -269,6 +274,11 @@ if (item) { emit('select-item', item); selectedItem.value = item; + + if (props.disableFeatureClickZoom) { + return; + } + unref(map).flyTo({ center: feature.geometry.coordinates, zoom: props.itemZoomLevel }); } } diff --git a/packages/vue-mapbox-gl/package.json b/packages/vue-mapbox-gl/package.json index aaa66ce..179153b 100644 --- a/packages/vue-mapbox-gl/package.json +++ b/packages/vue-mapbox-gl/package.json @@ -1,6 +1,6 @@ { "name": "@studiometa/vue-mapbox-gl", - "version": "2.4.0", + "version": "2.5.0", "description": "A small components library to use Mapbox GL in Vue 3.", "homepage": "https://github.com/studiometa/vue-mapbox-gl#readme", "bugs": {