@geoql/v-maplibre 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-current Vinayak Kulkarni <inbox.vinayak@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,256 @@
1
+ # @geoql/v-maplibre
2
+
3
+ > Vue 3 components for MapLibre GL - Build beautiful, reactive map applications
4
+
5
+ [![npm version](https://badge.fury.io/js/%40geoql%2Fv-maplibre.svg)](https://www.npmjs.com/package/@geoql/v-maplibre)
6
+ [![JSR](https://jsr.io/badges/@geoql/v-maplibre)](https://jsr.io/@geoql/v-maplibre)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+
9
+ ## Features
10
+
11
+ - πŸ—ΊοΈ **Full MapLibre GL Support** - Complete wrapper around MapLibre GL JS
12
+ - πŸ”₯ **Vue 3 Composition API** - Built with modern Vue 3 patterns
13
+ - πŸ“¦ **TypeScript First** - Fully typed with excellent IDE support
14
+ - 🎨 **Reactive Components** - Reactive and composable map components
15
+ - πŸš€ **Nuxt 4 Ready** - Seamlessly works with Nuxt 4 and SSR
16
+ - 🎯 **PMTiles Built-in** - Native support for PMTiles protocol
17
+
18
+ ## Installation
19
+
20
+ ### From npm
21
+
22
+ ```bash
23
+ # pnpm
24
+ pnpm add @geoql/v-maplibre maplibre-gl
25
+
26
+ # npm
27
+ npm install @geoql/v-maplibre maplibre-gl
28
+
29
+ # yarn
30
+ yarn add @geoql/v-maplibre maplibre-gl
31
+ ```
32
+
33
+ ### From JSR
34
+
35
+ ```bash
36
+ # deno
37
+ deno add @geoql/v-maplibre
38
+
39
+ # npm (using JSR)
40
+ npx jsr add @geoql/v-maplibre
41
+
42
+ # yarn
43
+ yarn dlx jsr add @geoql/v-maplibre
44
+
45
+ # pnpm
46
+ pnpm dlx jsr add @geoql/v-maplibre
47
+ ```
48
+
49
+ ## Quick Start
50
+
51
+ ```vue
52
+ <script setup lang="ts">
53
+ import { VMap, VMarker } from '@geoql/v-maplibre';
54
+ import 'maplibre-gl/dist/maplibre-gl.css';
55
+
56
+ const mapOptions = {
57
+ style: 'https://demotiles.maplibre.org/style.json',
58
+ center: [-74.5, 40],
59
+ zoom: 9,
60
+ };
61
+ </script>
62
+
63
+ <template>
64
+ <VMap :options="mapOptions" style="height: 500px">
65
+ <VMarker :lng-lat="[-74.5, 40]"></VMarker>
66
+ </VMap>
67
+ </template>
68
+ ```
69
+
70
+ ## Components
71
+
72
+ ### Core Components
73
+
74
+ - **`VMap`** - Main map component
75
+ - **`VMarker`** - Interactive markers
76
+ - **`VPopup`** - Popups and tooltips
77
+
78
+ ### Layer Components
79
+
80
+ - **`VLayerMaplibreGeojson`** - GeoJSON layers
81
+ - **`VLayerMaplibreVector`** - Vector tile layers
82
+ - **`VLayerMaplibreRaster`** - Raster tile layers
83
+ - **`VLayerMaplibreImage`** - Image layers
84
+ - **`VLayerMaplibreVideo`** - Video layers
85
+ - **`VLayerMaplibreCanvas`** - Canvas layers
86
+ - **`VLayerMaplibreCluster`** - Clustered point layers
87
+ - **`VLayerMaplibrePmtile`** - PMTiles layers
88
+
89
+ ### Control Components
90
+
91
+ - **`VControlNavigation`** - Navigation controls (zoom, rotate)
92
+ - **`VControlScale`** - Scale indicator
93
+ - **`VControlGeolocate`** - Geolocation control
94
+ - **`VControlFullscreen`** - Fullscreen toggle
95
+ - **`VControlAttribution`** - Attribution control
96
+
97
+ ## Usage with Nuxt
98
+
99
+ For Nuxt applications, wrap the map component with `ClientOnly`:
100
+
101
+ ```vue
102
+ <script setup lang="ts">
103
+ import { VMap } from '@geoql/v-maplibre';
104
+
105
+ const mapOptions = {
106
+ style: 'https://demotiles.maplibre.org/style.json',
107
+ center: [-74.5, 40],
108
+ zoom: 9,
109
+ };
110
+ </script>
111
+
112
+ <template>
113
+ <ClientOnly>
114
+ <VMap :options="mapOptions" style="height: 500px"></VMap>
115
+ </ClientOnly>
116
+ </template>
117
+ ```
118
+
119
+ Create a Nuxt plugin to import styles globally:
120
+
121
+ ```typescript
122
+ // plugins/maplibre.client.ts
123
+ import 'maplibre-gl/dist/maplibre-gl.css';
124
+
125
+ export default defineNuxtPlugin(() => {
126
+ // Plugin loaded
127
+ });
128
+ ```
129
+
130
+ ## Examples
131
+
132
+ ### GeoJSON Layer
133
+
134
+ ```vue
135
+ <script setup lang="ts">
136
+ import { VMap, VLayerMaplibreGeojson } from '@geoql/v-maplibre';
137
+ import type { GeoJSONSourceSpecification } from 'maplibre-gl';
138
+
139
+ const geojsonSource: GeoJSONSourceSpecification = {
140
+ type: 'geojson',
141
+ data: {
142
+ type: 'FeatureCollection',
143
+ features: [
144
+ {
145
+ type: 'Feature',
146
+ geometry: {
147
+ type: 'Point',
148
+ coordinates: [-74.5, 40],
149
+ },
150
+ properties: { name: 'Example Point' },
151
+ },
152
+ ],
153
+ },
154
+ };
155
+
156
+ const layerOptions = {
157
+ id: 'points',
158
+ type: 'circle' as const,
159
+ paint: {
160
+ 'circle-radius': 8,
161
+ 'circle-color': '#007cbf',
162
+ },
163
+ };
164
+ </script>
165
+
166
+ <template>
167
+ <VMap :options="mapOptions" style="height: 500px">
168
+ <VLayerMaplibreGeojson
169
+ :source="geojsonSource"
170
+ :layer="layerOptions"
171
+ ></VLayerMaplibreGeojson>
172
+ </VMap>
173
+ </template>
174
+ ```
175
+
176
+ ### PMTiles Support
177
+
178
+ ```vue
179
+ <script setup lang="ts">
180
+ import { VMap, VLayerMaplibrePmtile } from '@geoql/v-maplibre';
181
+
182
+ const pmtilesUrl = 'https://example.com/tiles.pmtiles';
183
+
184
+ const layerOptions = {
185
+ id: 'pmtiles-layer',
186
+ type: 'fill' as const,
187
+ paint: {
188
+ 'fill-color': '#088',
189
+ 'fill-opacity': 0.5,
190
+ },
191
+ };
192
+ </script>
193
+
194
+ <template>
195
+ <VMap :options="mapOptions" support-pmtiles style="height: 500px">
196
+ <VLayerMaplibrePmtile
197
+ :url="pmtilesUrl"
198
+ :layer="layerOptions"
199
+ ></VLayerMaplibrePmtile>
200
+ </VMap>
201
+ </template>
202
+ ```
203
+
204
+ ## Documentation
205
+
206
+ Visit our [documentation site](#) for:
207
+
208
+ - Complete API reference
209
+ - Detailed component guides
210
+ - Interactive examples
211
+ - Migration guides
212
+
213
+ ## TypeScript Support
214
+
215
+ All components are fully typed. Import types from `maplibre-gl`:
216
+
217
+ ```typescript
218
+ import type { MapOptions, LngLatLike, GeoJSONSource } from 'maplibre-gl';
219
+ ```
220
+
221
+ ## Development
222
+
223
+ ```bash
224
+ # Install dependencies
225
+ pnpm install
226
+
227
+ # Build the library
228
+ pnpm build
229
+
230
+ # Run documentation
231
+ pnpm docs:dev
232
+
233
+ # Build documentation
234
+ pnpm docs:build
235
+ ```
236
+
237
+ ## License
238
+
239
+ MIT License - see [LICENSE](LICENSE) for details
240
+
241
+ ## Credits
242
+
243
+ Built with:
244
+
245
+ - [MapLibre GL JS](https://maplibre.org/)
246
+ - [Vue 3](https://vuejs.org/)
247
+ - [Vite](https://vitejs.dev/)
248
+ - [PMTiles](https://github.com/protomaps/PMTiles)
249
+
250
+ ## Contributing
251
+
252
+ Contributions are welcome! Please feel free to submit a Pull Request.
253
+
254
+ ---
255
+
256
+ Made with ❀️ by GeoQL