@squirkle-ui/map 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/README.md +24 -5
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -1,23 +1,42 @@
1
1
  # @squirkle-ui/map
2
2
 
3
- Vector (MapLibre) and raster (Leaflet) squircle maps with custom markers and clustering for Squirkle UI.
3
+ MapLibre vector maps (or Leaflet raster) with squircle markers and clustering for [Squirkle UI](https://www.npmjs.com/package/squirkle-ui). Works with Vue 3 and Vue 2.7.
4
4
 
5
+ ## Install
5
6
  ```bash
6
7
  npm i @squirkle-ui/map @squirkle-ui/ui maplibre-gl
7
8
  ```
9
+ Or get every component and add-on with [`squirkle-ui`](https://www.npmjs.com/package/squirkle-ui) and import from `squirkle-ui/map`.
10
+
11
+ Peer dependencies: `vue`, `@squirkle-ui/ui`, and `maplibre-gl` (vector) or `leaflet` (raster). Set up `@squirkle-ui/ui` first (`app.use(createSquirkle())` and `@squirkle-ui/ui/styles.css`).
12
+
13
+ ## Usage
8
14
  ```ts
9
15
  import { SqMap } from '@squirkle-ui/map' // Vue 3
10
16
  // import { SqMap } from '@squirkle-ui/map/vue2' // Vue 2.7
11
17
  import '@squirkle-ui/map/styles.css'
12
18
  ```
13
- Peer dependencies: `vue`, `@squirkle-ui/ui`, and `maplibre-gl` (vector, default) or `leaflet` (`engine="raster"`).
19
+ ```vue
20
+ <template>
21
+ <SqMap :markers="markers" cluster fit-markers :height="420" />
22
+ </template>
23
+ <script setup lang="ts">
24
+ import { SqMap, type MapMarker } from '@squirkle-ui/map'
25
+ const markers: MapMarker[] = [
26
+ { lat: 11.5636, lng: 104.9282, title: 'Phnom Penh', shape: 'pin', icon: 'lucide:coffee' },
27
+ ]
28
+ </script>
29
+ ```
30
+ Key props: `engine` (`vector` default, or `raster`), `mapStyle` (`auto` follows light/dark; presets `positron`, `voyager`, `dark-matter`, `liberty`, `bright`, `openfreemap-dark`, `fiord`; or any style URL), `center`, `zoom`, `markers`, `markerDefaults`, `cluster`, `clusterColor`, `fitMarkers`, `tileUrl`, `height`. Marker shapes: `pin`, `dot`, `squircle`, `avatar`, or a `#marker` slot.
14
31
 
15
- MapLibre loads a worker file that bundlers don't copy on their own. In Vite apps, register it once:
32
+ ### Map setup
33
+ The map needs `maplibre-gl` (vector, default) or `leaflet` (`engine="raster"`). MapLibre loads a worker file that bundlers don't copy on their own; in Vite apps register it once:
16
34
  ```ts
17
35
  import { setMapWorkerUrl } from '@squirkle-ui/map'
18
36
  import workerUrl from 'maplibre-gl/dist/maplibre-gl-worker.mjs?url'
19
37
  setMapWorkerUrl(workerUrl)
20
38
  ```
21
- The Nuxt module does this automatically.
39
+ The Nuxt module does this for you.
22
40
 
23
- Part of [Squirkle UI](https://github.com/KheangLov/squirkle-ui) · MIT License
41
+ ## License
42
+ MIT © KheangLov · [Source and issues](https://github.com/KheangLov/squirkle-ui)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squirkle-ui/map",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Vector (MapLibre) and raster (Leaflet) squircle maps with custom markers and clustering for Squirkle UI",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -46,20 +46,20 @@
46
46
  }
47
47
  },
48
48
  "peerDependencies": {
49
- "vue": "^2.7.0 || ^3.3.0",
50
49
  "leaflet": "^1.9.0",
51
50
  "maplibre-gl": "^6.0.0",
52
- "@squirkle-ui/ui": "^0.1.0"
51
+ "vue": "^2.7.0 || ^3.3.0",
52
+ "@squirkle-ui/ui": "^0.1.1"
53
53
  },
54
54
  "dependencies": {
55
55
  "supercluster": "^9.1.0",
56
- "@squirkle-ui/core": "^0.1.0"
56
+ "@squirkle-ui/core": "^0.1.1"
57
57
  },
58
58
  "devDependencies": {
59
- "leaflet": "^1.9.4",
60
59
  "@types/leaflet": "^1.9.0",
60
+ "leaflet": "^1.9.4",
61
61
  "maplibre-gl": "^6.15.0",
62
- "@squirkle-ui/ui": "^0.1.0"
62
+ "@squirkle-ui/ui": "^0.1.1"
63
63
  },
64
64
  "peerDependenciesMeta": {
65
65
  "maplibre-gl": {