Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format

## [Unreleased]

## [v2.7.2](https://github.com/studiometa/vue-mapbox-gl/compare/2.7.1...2.7.2) (2025-02-12)

### Fixed

- Fix Mapbox trying to remove controls already removed ([#249](https://github.com/studiometa/vue-mapbox-gl/issues/249), [#259](https://github.com/studiometa/vue-mapbox-gl/pull/259), [0bfaea6](https://github.com/studiometa/vue-mapbox-gl/commit/0bfaea6))

## [v2.7.1](https://github.com/studiometa/vue-mapbox-gl/compare/2.7.0...2.7.1) (2025-02-04)

### Changed
Expand Down
893 changes: 497 additions & 396 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@studiometa/vue-mapbox-gl-workspace",
"private": true,
"version": "2.7.1",
"version": "2.7.2",
"type": "module",
"workspaces": [
"packages/*"
Expand Down Expand Up @@ -31,7 +31,7 @@
"dependencies": {
"@vitejs/plugin-vue": "5.2.1",
"@vue/tsconfig": "0.7.0",
"vite": "6.0.11",
"vite": "6.1.0",
"vite-plugin-dts": "4.5.0",
"vue-tsc": "2.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/demo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@studiometa/vue-mapbox-gl-demo",
"version": "2.7.1",
"version": "2.7.2",
"scripts": {
"dev": "nuxt dev",
"build": "nuxt build"
Expand Down
4 changes: 3 additions & 1 deletion packages/demo/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
import 'mapbox-gl/dist/mapbox-gl.css';
import '@mapbox/mapbox-gl-geocoder/lib/mapbox-gl-geocoder.css';

const { accessToken } = useRuntimeConfig();
const {
public: { accessToken },
} = useRuntimeConfig();
const lng = ref(0);
const lat = ref(0);
const zoom = ref(1);
Expand Down
25 changes: 25 additions & 0 deletions packages/demo/pages/issue-249.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<script setup>
import { ref } from 'vue';
import { MapboxMap, MapboxGeocoder } from '@studiometa/vue-mapbox-gl';
import 'mapbox-gl/dist/mapbox-gl.css';
import '@mapbox/mapbox-gl-geocoder/lib/mapbox-gl-geocoder.css';

const config = useRuntimeConfig();
const showMap = ref(true);
</script>

<template>
<div>
<label>
<input v-model="showMap" type="checkbox" />
toggle map
</label>
<MapboxMap
v-if="showMap"
style="height: 60vh"
:access-token="config.public.accessToken"
map-style="mapbox://styles/mapbox/streets-v11">
<MapboxGeocoder />
</MapboxMap>
</div>
</template>
4 changes: 3 additions & 1 deletion packages/demo/pages/issue-77.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import { MapboxMap, MapboxGeolocateControl } from '@studiometa/vue-mapbox-gl';
import 'mapbox-gl/dist/mapbox-gl.css';

const { accessToken } = useRuntimeConfig();
const {
public: { accessToken },
} = useRuntimeConfig();

const geolocate = ref();
const control = computed(() => geolocate.value?.control);
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"name": "@studiometa/vue-mapbox-gl-docs",
"private": true,
"type": "module",
"version": "2.7.1",
"version": "2.7.2",
"scripts": {
"dev": "vitepress",
"build": "vitepress build"
},
"devDependencies": {
"sass": "1.83.4",
"sass": "1.84.0",
"tailwindcss": "3.4.17",
"vitepress": "1.6.3"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@studiometa/vue-mapbox-gl-tests",
"version": "2.7.1",
"version": "2.7.2",
"type": "module",
"scripts": {
"test": "vitest"
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-mapbox-gl/composables/useControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function useControl(ControlConstructor, { propsConfig, props, emit, event
});

onUnmounted(() => {
if (unref(control) && unref(map)) {
if (unref(control) && unref(map) && unref(map).hasControl(unref(control))) {
unref(map).removeControl(unref(control));
}
});
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-mapbox-gl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@studiometa/vue-mapbox-gl",
"version": "2.7.1",
"version": "2.7.2",
"description": "A small components library to use Mapbox GL in Vue 3.",
"homepage": "https://github.com/studiometa/vue-mapbox-gl#readme",
"bugs": {
Expand Down
Loading