Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Fix mapbox event binding #232

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format

## [Unreleased]

### Fixed

- Fix Mapbox event binding ([#231](https://github.com/studiometa/vue-mapbox-gl/issues/231), [#232](https://github.com/studiometa/vue-mapbox-gl/pull/232), [882baca](https://github.com/studiometa/vue-mapbox-gl/commit/882baca))

## [v2.7.0-alpha.0](https://github.com/studiometa/vue-mapbox-gl/compare/2.6.0...2.7.0-alpha.0) (2025-01-02)

### Added
Expand Down
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export default defineConfig(
...globals.browser,
},
},
rules: {
'vue/valid-define-emits': 'off',
},
},
{
ignores: ['**/.nuxt/**', '**/.output/**'],
Expand Down
7 changes: 1 addition & 6 deletions packages/vue-mapbox-gl/components/MapboxCluster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,7 @@
import MapboxSource from './MapboxSource.vue';

const props = defineProps(propsConfig);
const emit = defineEmits([
'mb-cluster-click',
'mb-feature-click',
'mb-feature-mouseenter',
'mb-feature-mouseleave',
]);
const emit = defineEmits();

const { map } = useMap();
const id = ref(`mb-cluster-${index}`);
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-mapbox-gl/components/MapboxGeocoder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
import { useControl } from '../composables/index.js';

const props = defineProps(propsConfig);
const emit = defineEmits(events.map((event) => `mb-${event}`));
const emit = defineEmits();

const root = ref();
const options = computed(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
import { useControl } from '../composables/index.js';

const props = defineProps(propsConfig);
const emit = defineEmits(events.map((event) => `mb-${event}`));
const emit = defineEmits();

const { control } = useControl(GeolocateControl, { propsConfig, events, props, emit });

Expand Down
2 changes: 1 addition & 1 deletion packages/vue-mapbox-gl/components/MapboxImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import { useMap } from '../composables/index.js';

const props = defineProps(propsConfig);
const emit = defineEmits(['mb-add']);
const emit = defineEmits();

const { map } = useMap();
const isReady = ref(false);
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-mapbox-gl/components/MapboxImages.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
required: true,
},
});
const emit = defineEmits(['mb-add', 'mb-ready']);
const emit = defineEmits();

const isReady = ref(false);
const addedImages = new Map();
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-mapbox-gl/components/MapboxLayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
import { useEventsBinding, useMap } from '../composables/index.js';

const props = defineProps(propsConfig);
const emit = defineEmits(events.map((event) => `mb-${event}`));
const emit = defineEmits();

const { map } = useMap();
const options = computed(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-mapbox-gl/components/MapboxMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
import { useEventsBinding, usePropsBinding } from '../composables/index.js';

const props = defineProps(propsConfig);
const emit = defineEmits(events.map((event) => `mb-${event}`));
const emit = defineEmits();

const map = shallowRef<Map>(null);
provide('mapbox-map', map);
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-mapbox-gl/components/MapboxMarker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
import MapboxPopup from './MapboxPopup.vue';

const props = defineProps(propsConfig);
const emit = defineEmits(events.map((event) => `mb-${event}`));
const emit = defineEmits();
const slots = useSlots();

const marker = shallowRef();
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-mapbox-gl/components/MapboxPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
import { useMap, usePropsBinding, useEventsBinding } from '../composables/index.js';

const props = defineProps(propsConfig);
const emit = defineEmits(['mb-open', 'mb-close']);
const emit = defineEmits();

const popup = shallowRef();
const root = ref();
Expand Down