-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a MapboxFullscreenControl component
- Loading branch information
1 parent
2d4e380
commit 1204ba1
Showing
4 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
packages/vue-mapbox-gl/components/MapboxFullscreenControl.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<template> | ||
<div /> | ||
</template> | ||
|
||
<script> | ||
import mapboxgl from 'mapbox-gl'; | ||
if (!mapboxgl) { | ||
throw new Error('mapboxgl is not installed.'); | ||
} | ||
/** | ||
* Component's props definition, we need to declare it outside the component | ||
* to be able to test the default values and the types. | ||
* @see https://docs.mapbox.com/mapbox-gl-js/api/markers/#fullscreencontrol | ||
* @type {object} | ||
*/ | ||
const propsConfig = { | ||
// eslint-disable-next-line vue/require-default-prop | ||
container: typeof HTMLElement !== 'undefined' ? HTMLElement : Object, | ||
position: { | ||
type: String, | ||
default: 'top-right', | ||
}, | ||
}; | ||
</script> | ||
|
||
<script setup> | ||
import { useControl } from '../composables/index.js'; | ||
const props = defineProps(propsConfig); | ||
const { control, map } = useControl(mapboxgl.FullscreenControl, { | ||
propsConfig, | ||
props, | ||
}); | ||
defineExpose({ control }); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters