@beyonk/svelte-mapbox 8.2.0 → 9.0.3

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 (43) hide show
  1. package/asset-loader.d.ts +1 -0
  2. package/{src/lib/asset-loader.js → asset-loader.js} +0 -0
  3. package/components.d.ts +13 -0
  4. package/{src/lib/components.js → components.js} +0 -0
  5. package/event-bindings.d.ts +1 -0
  6. package/{src/lib/event-bindings.js → event-bindings.js} +0 -0
  7. package/{src/lib/geocoder → geocoder}/Geocoder.svelte +0 -0
  8. package/geocoder/Geocoder.svelte.d.ts +53 -0
  9. package/geocoder/geocoder-action.d.ts +3 -0
  10. package/{src/lib/geocoder → geocoder}/geocoder-action.js +0 -0
  11. package/{src/lib/map → map}/Map.svelte +1 -1
  12. package/map/Map.svelte.d.ts +89 -0
  13. package/{src/lib/map → map}/Marker.svelte +0 -0
  14. package/map/Marker.svelte.d.ts +50 -0
  15. package/{src/lib/map → map}/controls/GeolocateControl.svelte +0 -0
  16. package/map/controls/GeolocateControl.svelte.d.ts +40 -0
  17. package/{src/lib/map → map}/controls/NavigationControl.svelte +0 -0
  18. package/map/controls/NavigationControl.svelte.d.ts +25 -0
  19. package/{src/lib/map → map}/controls/ScaleControl.svelte +0 -0
  20. package/map/controls/ScaleControl.svelte.d.ts +25 -0
  21. package/map/map-action.d.ts +3 -0
  22. package/{src/lib/map → map}/map-action.js +0 -0
  23. package/mapbox.d.ts +1 -0
  24. package/{src/lib/mapbox.js → mapbox.js} +0 -0
  25. package/package.json +28 -14
  26. package/queue.d.ts +8 -0
  27. package/{src/lib/queue.js → queue.js} +0 -0
  28. package/.env +0 -1
  29. package/.eslintignore +0 -2
  30. package/.eslintrc.json +0 -7
  31. package/.github/workflows/publish.yml +0 -35
  32. package/jsconfig.json +0 -10
  33. package/src/app.html +0 -17
  34. package/src/global.d.ts +0 -1
  35. package/src/lib/conf.js +0 -5
  36. package/src/routes/_Earthquakes.svelte +0 -128
  37. package/src/routes/_MiniScroller.svelte +0 -1
  38. package/src/routes/index.svelte +0 -211
  39. package/static/favicon.png +0 -0
  40. package/static/normalize.css +0 -76
  41. package/static/prettify.css +0 -70
  42. package/static/style.css +0 -534
  43. package/svelte.config.js +0 -8
@@ -0,0 +1 @@
1
+ export function load(assets: any, cb: any): void;
File without changes
@@ -0,0 +1,13 @@
1
+ import Map from "./map/Map.svelte";
2
+ import Marker from "./map/Marker.svelte";
3
+ import Geocoder from "./geocoder/Geocoder.svelte";
4
+ import { contextKey } from "./mapbox.js";
5
+ export namespace controls {
6
+ export { GeolocateControl };
7
+ export { NavigationControl };
8
+ export { ScaleControl };
9
+ }
10
+ import GeolocateControl from "./map/controls/GeolocateControl.svelte";
11
+ import NavigationControl from "./map/controls/NavigationControl.svelte";
12
+ import ScaleControl from "./map/controls/ScaleControl.svelte";
13
+ export { Map, Marker, Geocoder, contextKey };
File without changes
@@ -0,0 +1 @@
1
+ export function bindEvents(el: any, handlers: any, mapbox: any, node: any): () => void;
File without changes
File without changes
@@ -0,0 +1,53 @@
1
+ /** @typedef {typeof __propDef.props} GeocoderProps */
2
+ /** @typedef {typeof __propDef.events} GeocoderEvents */
3
+ /** @typedef {typeof __propDef.slots} GeocoderSlots */
4
+ export default class Geocoder extends SvelteComponentTyped<{
5
+ accessToken: any;
6
+ geocoder: any;
7
+ value?: any;
8
+ version?: string;
9
+ customStylesheetUrl?: boolean;
10
+ options?: {};
11
+ types?: string[];
12
+ placeholder?: string;
13
+ }, {
14
+ results: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
15
+ result: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
16
+ loading: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
17
+ error: ErrorEvent;
18
+ clear: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
19
+ load: Event;
20
+ ready: CustomEvent<any>;
21
+ } & {
22
+ [evt: string]: CustomEvent<any>;
23
+ }, {}> {
24
+ }
25
+ export type GeocoderProps = typeof __propDef.props;
26
+ export type GeocoderEvents = typeof __propDef.events;
27
+ export type GeocoderSlots = typeof __propDef.slots;
28
+ import { SvelteComponentTyped } from "svelte";
29
+ declare const __propDef: {
30
+ props: {
31
+ accessToken: any;
32
+ geocoder: any;
33
+ value?: any;
34
+ version?: string;
35
+ customStylesheetUrl?: boolean;
36
+ options?: {};
37
+ types?: string[];
38
+ placeholder?: string;
39
+ };
40
+ events: {
41
+ results: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
42
+ result: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
43
+ loading: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
44
+ error: ErrorEvent;
45
+ clear: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
46
+ load: Event;
47
+ ready: CustomEvent<any>;
48
+ } & {
49
+ [evt: string]: CustomEvent<any>;
50
+ };
51
+ slots: {};
52
+ };
53
+ export {};
@@ -0,0 +1,3 @@
1
+ export default function action(node: any, options?: {}): {
2
+ destroy(): void;
3
+ };
@@ -29,7 +29,7 @@
29
29
  import { EventQueue } from '../queue.js'
30
30
 
31
31
  export let map = null
32
- export let version = 'v2.3.1'
32
+ export let version = 'v2.12.0'
33
33
  export let center = [ 0, 0 ]
34
34
  export let zoom = 9
35
35
  export let zoomRate = 1
@@ -0,0 +1,89 @@
1
+ /** @typedef {typeof __propDef.props} MapProps */
2
+ /** @typedef {typeof __propDef.events} MapEvents */
3
+ /** @typedef {typeof __propDef.slots} MapSlots */
4
+ export default class Map extends SvelteComponentTyped<{
5
+ accessToken: any;
6
+ map?: any;
7
+ style?: string;
8
+ version?: string;
9
+ customStylesheetUrl?: boolean;
10
+ zoom?: number;
11
+ getMap?: () => any;
12
+ getMapbox?: () => any;
13
+ center?: number[];
14
+ zoomRate?: number;
15
+ wheelZoomRate?: number;
16
+ fitBounds?: (bbox: any, data?: {}) => void;
17
+ flyTo?: (destination: any, data?: {}) => void;
18
+ resize?: () => void;
19
+ setCenter?: (coords: any, data?: {}) => void;
20
+ setZoom?: (value: any, data?: {}) => void;
21
+ addControl?: (control: any, position?: string) => void;
22
+ options?: {};
23
+ }, {
24
+ recentre: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
25
+ dragend: DragEvent;
26
+ click: MouseEvent;
27
+ zoomstart: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
28
+ zoom: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
29
+ zoomend: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
30
+ drag: DragEvent;
31
+ keydown: KeyboardEvent;
32
+ ready: CustomEvent<any>;
33
+ } & {
34
+ [evt: string]: CustomEvent<any>;
35
+ }, {
36
+ default: {};
37
+ }> {
38
+ get fitBounds(): (bbox: any, data?: {}) => void;
39
+ get flyTo(): (destination: any, data?: {}) => void;
40
+ get resize(): () => void;
41
+ get setCenter(): (coords: any, data?: {}) => void;
42
+ get setZoom(): (value: any, data?: {}) => void;
43
+ get addControl(): (control: any, position?: string) => void;
44
+ get getMap(): () => any;
45
+ get getMapbox(): () => any;
46
+ }
47
+ export type MapProps = typeof __propDef.props;
48
+ export type MapEvents = typeof __propDef.events;
49
+ export type MapSlots = typeof __propDef.slots;
50
+ import { SvelteComponentTyped } from "svelte";
51
+ declare const __propDef: {
52
+ props: {
53
+ accessToken: any;
54
+ map?: any;
55
+ style?: string;
56
+ version?: string;
57
+ customStylesheetUrl?: boolean;
58
+ zoom?: number;
59
+ getMap?: () => any;
60
+ getMapbox?: () => any;
61
+ center?: number[];
62
+ zoomRate?: number;
63
+ wheelZoomRate?: number;
64
+ fitBounds?: (bbox: any, data?: {}) => void;
65
+ flyTo?: (destination: any, data?: {}) => void;
66
+ resize?: () => void;
67
+ setCenter?: (coords: any, data?: {}) => void;
68
+ setZoom?: (value: any, data?: {}) => void;
69
+ addControl?: (control: any, position?: string) => void;
70
+ options?: {};
71
+ };
72
+ events: {
73
+ recentre: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
74
+ dragend: DragEvent;
75
+ click: MouseEvent;
76
+ zoomstart: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
77
+ zoom: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
78
+ zoomend: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
79
+ drag: DragEvent;
80
+ keydown: KeyboardEvent;
81
+ ready: CustomEvent<any>;
82
+ } & {
83
+ [evt: string]: CustomEvent<any>;
84
+ };
85
+ slots: {
86
+ default: {};
87
+ };
88
+ };
89
+ export {};
File without changes
@@ -0,0 +1,50 @@
1
+ /** @typedef {typeof __propDef.props} MarkerProps */
2
+ /** @typedef {typeof __propDef.events} MarkerEvents */
3
+ /** @typedef {typeof __propDef.slots} MarkerSlots */
4
+ export default class Marker extends SvelteComponentTyped<{
5
+ lat: any;
6
+ lng: any;
7
+ label?: string;
8
+ popupClassName?: string;
9
+ markerOffset?: number[];
10
+ popupOffset?: number;
11
+ color?: number;
12
+ popup?: boolean;
13
+ popupOptions?: {};
14
+ markerOptions?: {};
15
+ getMarker?: () => any;
16
+ }, {
17
+ [evt: string]: CustomEvent<any>;
18
+ }, {
19
+ default: {};
20
+ popup: {};
21
+ }> {
22
+ get getMarker(): () => any;
23
+ }
24
+ export type MarkerProps = typeof __propDef.props;
25
+ export type MarkerEvents = typeof __propDef.events;
26
+ export type MarkerSlots = typeof __propDef.slots;
27
+ import { SvelteComponentTyped } from "svelte";
28
+ declare const __propDef: {
29
+ props: {
30
+ lat: any;
31
+ lng: any;
32
+ label?: string;
33
+ popupClassName?: string;
34
+ markerOffset?: number[];
35
+ popupOffset?: number;
36
+ color?: number;
37
+ popup?: boolean;
38
+ popupOptions?: {};
39
+ markerOptions?: {};
40
+ getMarker?: () => any;
41
+ };
42
+ events: {
43
+ [evt: string]: CustomEvent<any>;
44
+ };
45
+ slots: {
46
+ default: {};
47
+ popup: {};
48
+ };
49
+ };
50
+ export {};
@@ -0,0 +1,40 @@
1
+ /** @typedef {typeof __propDef.props} GeolocateControlProps */
2
+ /** @typedef {typeof __propDef.events} GeolocateControlEvents */
3
+ /** @typedef {typeof __propDef.slots} GeolocateControlSlots */
4
+ export default class GeolocateControl extends SvelteComponentTyped<{
5
+ options?: {};
6
+ position?: string;
7
+ trigger?: () => void;
8
+ }, {
9
+ error: ErrorEvent;
10
+ geolocate: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
11
+ outofmaxbounds: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
12
+ trackuserlocationend: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
13
+ trackuserlocationstart: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
14
+ } & {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}> {
17
+ get trigger(): () => void;
18
+ }
19
+ export type GeolocateControlProps = typeof __propDef.props;
20
+ export type GeolocateControlEvents = typeof __propDef.events;
21
+ export type GeolocateControlSlots = typeof __propDef.slots;
22
+ import { SvelteComponentTyped } from "svelte";
23
+ declare const __propDef: {
24
+ props: {
25
+ options?: {};
26
+ position?: string;
27
+ trigger?: () => void;
28
+ };
29
+ events: {
30
+ error: ErrorEvent;
31
+ geolocate: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
32
+ outofmaxbounds: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
33
+ trackuserlocationend: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
34
+ trackuserlocationstart: Event | ProgressEvent<EventTarget> | DragEvent | MouseEvent | UIEvent | ClipboardEvent | AnimationEvent | InputEvent | FocusEvent | CompositionEvent | ErrorEvent | FormDataEvent | PointerEvent | KeyboardEvent | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
35
+ } & {
36
+ [evt: string]: CustomEvent<any>;
37
+ };
38
+ slots: {};
39
+ };
40
+ export {};
@@ -0,0 +1,25 @@
1
+ /** @typedef {typeof __propDef.props} NavigationControlProps */
2
+ /** @typedef {typeof __propDef.events} NavigationControlEvents */
3
+ /** @typedef {typeof __propDef.slots} NavigationControlSlots */
4
+ export default class NavigationControl extends SvelteComponentTyped<{
5
+ options?: {};
6
+ position?: string;
7
+ }, {
8
+ [evt: string]: CustomEvent<any>;
9
+ }, {}> {
10
+ }
11
+ export type NavigationControlProps = typeof __propDef.props;
12
+ export type NavigationControlEvents = typeof __propDef.events;
13
+ export type NavigationControlSlots = typeof __propDef.slots;
14
+ import { SvelteComponentTyped } from "svelte";
15
+ declare const __propDef: {
16
+ props: {
17
+ options?: {};
18
+ position?: string;
19
+ };
20
+ events: {
21
+ [evt: string]: CustomEvent<any>;
22
+ };
23
+ slots: {};
24
+ };
25
+ export {};
@@ -0,0 +1,25 @@
1
+ /** @typedef {typeof __propDef.props} ScaleControlProps */
2
+ /** @typedef {typeof __propDef.events} ScaleControlEvents */
3
+ /** @typedef {typeof __propDef.slots} ScaleControlSlots */
4
+ export default class ScaleControl extends SvelteComponentTyped<{
5
+ options?: {};
6
+ position?: string;
7
+ }, {
8
+ [evt: string]: CustomEvent<any>;
9
+ }, {}> {
10
+ }
11
+ export type ScaleControlProps = typeof __propDef.props;
12
+ export type ScaleControlEvents = typeof __propDef.events;
13
+ export type ScaleControlSlots = typeof __propDef.slots;
14
+ import { SvelteComponentTyped } from "svelte";
15
+ declare const __propDef: {
16
+ props: {
17
+ options?: {};
18
+ position?: string;
19
+ };
20
+ events: {
21
+ [evt: string]: CustomEvent<any>;
22
+ };
23
+ slots: {};
24
+ };
25
+ export {};
@@ -0,0 +1,3 @@
1
+ export default function action(node: any, options?: {}): {
2
+ destroy(): void;
3
+ };
File without changes
package/mapbox.d.ts ADDED
@@ -0,0 +1 @@
1
+ export const contextKey: {};
File without changes
package/package.json CHANGED
@@ -1,26 +1,40 @@
1
1
  {
2
2
  "name": "@beyonk/svelte-mapbox",
3
- "version": "8.2.0",
3
+ "version": "9.0.3",
4
4
  "main": "src/lib/components.js",
5
5
  "svelte": "src/lib/components.js",
6
- "scripts": {
7
- "dev": "svelte-kit dev --port 3030",
8
- "build": "svelte-kit build",
9
- "package": "svelte-kit package",
10
- "preview": "svelte-kit preview",
11
- "lint": "eslint ."
12
- },
13
6
  "devDependencies": {
14
7
  "@beyonk/eslint-config": "^6.0.0",
15
- "@sveltejs/kit": "next",
8
+ "@sveltejs/kit": "^1.2.9",
9
+ "@sveltejs/package": "^1.0.2",
16
10
  "eslint": "^7.31.0",
17
11
  "eslint-plugin-svelte3": "^3.2.0",
18
- "svelte": "^3.34.0",
19
- "svelte2tsx": "^0.4.2",
20
- "typescript": "^4.3.5"
12
+ "svelte": "^3.55.1",
13
+ "svelte2tsx": "^0.6.0",
14
+ "typescript": "^4.9.4",
15
+ "vite": "^4.0.4"
16
+ },
17
+ "peerDependencies": {
18
+ "svelte": "^3.0.0"
21
19
  },
22
20
  "type": "module",
23
21
  "volta": {
24
- "node": "16.5.0"
22
+ "node": "18.13.0"
23
+ },
24
+ "exports": {
25
+ "./package.json": "./package.json",
26
+ "./asset-loader": "./asset-loader.js",
27
+ "./components": "./components.js",
28
+ "./event-bindings": "./event-bindings.js",
29
+ "./geocoder/Geocoder.svelte": "./geocoder/Geocoder.svelte",
30
+ "./geocoder/geocoder-action": "./geocoder/geocoder-action.js",
31
+ "./map/Map.svelte": "./map/Map.svelte",
32
+ "./map/Marker.svelte": "./map/Marker.svelte",
33
+ "./map/controls/GeolocateControl.svelte": "./map/controls/GeolocateControl.svelte",
34
+ "./map/controls/NavigationControl.svelte": "./map/controls/NavigationControl.svelte",
35
+ "./map/controls/ScaleControl.svelte": "./map/controls/ScaleControl.svelte",
36
+ "./map/map-action": "./map/map-action.js",
37
+ "./mapbox": "./mapbox.js",
38
+ "./queue": "./queue.js"
25
39
  }
26
- }
40
+ }
package/queue.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export class EventQueue {
2
+ queue: import("svelte/store").Writable<any[]>;
3
+ unsubscribe: import("svelte/store").Unsubscriber;
4
+ started: boolean;
5
+ send(command: any, params?: any[]): void;
6
+ start(map: any): void;
7
+ stop(): void;
8
+ }
File without changes
package/.env DELETED
@@ -1 +0,0 @@
1
- VITE_MAPBOX_TOKEN=<insert mapbox token here>
package/.eslintignore DELETED
@@ -1,2 +0,0 @@
1
- package
2
- .svelte-kit
package/.eslintrc.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "@beyonk/eslint-config/svelte",
3
- "parserOptions": {
4
- "sourceType": "module",
5
- "ecmaVersion": 2020
6
- }
7
- }
@@ -1,35 +0,0 @@
1
- name: publish
2
-
3
- on:
4
- push:
5
- branches:
6
- - '*'
7
- tags:
8
- - 'v*'
9
-
10
- jobs:
11
- build:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v1
15
- - uses: actions/setup-node@v1
16
- with:
17
- node-version: 16
18
- - run: npm ci
19
- - run: npm run lint
20
-
21
- publish-npm:
22
- if: startsWith(github.ref, 'refs/tags/v')
23
- needs: build
24
- runs-on: ubuntu-latest
25
- steps:
26
- - uses: actions/checkout@v1
27
- - uses: actions/setup-node@v1
28
- with:
29
- node-version: 16
30
- registry-url: https://registry.npmjs.org/
31
- - run: npm ci
32
- - run: npm run package
33
- - run: npm publish
34
- env:
35
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
package/jsconfig.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "baseUrl": ".",
4
- "paths": {
5
- "$lib": ["src/lib"],
6
- "$lib/*": ["src/lib/*"]
7
- }
8
- },
9
- "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
10
- }
package/src/app.html DELETED
@@ -1,17 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <link rel="icon" href="/favicon.png" />
6
- <title>Svelte Mapbox Maps | Developer Documentation</title>
7
- <meta name="viewport" content="width=device-width, initial-scale=1" />
8
- <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
9
- <link href="/normalize.css" rel="stylesheet" type="text/css" />
10
- <link href="/prettify.css" rel="stylesheet" type="text/css" />
11
- <link href="/style.css" rel="stylesheet" type="text/css" />
12
- %svelte.head%
13
- </head>
14
- <body>
15
- <div id="svelte">%svelte.body%</div>
16
- </body>
17
- </html>
package/src/global.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="@sveltejs/kit" />
package/src/lib/conf.js DELETED
@@ -1,5 +0,0 @@
1
- const mapboxToken = import.meta.env.VITE_MAPBOX_TOKEN
2
-
3
- export {
4
- mapboxToken
5
- }
@@ -1,128 +0,0 @@
1
- <script>
2
- import { getContext } from 'svelte'
3
- import { contextKey } from '$lib/components.js'
4
- import MiniScroller from './_MiniScroller.svelte'
5
-
6
- const { getMap, getMapbox } = getContext(contextKey)
7
- const map = getMap()
8
- const mapbox = getMapbox()
9
-
10
- // Add a new source from our GeoJSON data and set the
11
- // 'cluster' option to true. GL-JS will add the point_count property to your source data.
12
- map.addSource('earthquakes', {
13
- type: 'geojson',
14
- // Point to GeoJSON data. This example visualizes all M1.0+ earthquakes
15
- // from 12/22/15 to 1/21/16 as logged by USGS' Earthquake hazards program.
16
- data: 'https://docs.mapbox.com/mapbox-gl-js/assets/earthquakes.geojson',
17
- cluster: true,
18
- clusterMaxZoom: 14, // Max zoom to cluster points on
19
- clusterRadius: 50 // Radius of each cluster when clustering points (defaults to 50)
20
- })
21
-
22
- map.addLayer({
23
- id: 'clusters',
24
- type: 'circle',
25
- source: 'earthquakes',
26
- filter: [ 'has', 'point_count' ],
27
- paint: {
28
- // Use step expressions (https://docs.mapbox.com/mapbox-gl-js/style-spec/#expressions-step)
29
- // with three steps to implement three types of circles:
30
- // * Blue, 20px circles when point count is less than 100
31
- // * Yellow, 30px circles when point count is between 100 and 750
32
- // * Pink, 40px circles when point count is greater than or equal to 750
33
- 'circle-color': [
34
- 'step',
35
- [ 'get', 'point_count' ],
36
- '#51bbd6',
37
- 100,
38
- '#f1f075',
39
- 750,
40
- '#f28cb1'
41
- ],
42
- 'circle-radius': [
43
- 'step',
44
- [ 'get', 'point_count' ],
45
- 20,
46
- 100,
47
- 30,
48
- 750,
49
- 40
50
- ]
51
- }
52
- })
53
-
54
- map.addLayer({
55
- id: 'cluster-count',
56
- type: 'symbol',
57
- source: 'earthquakes',
58
- filter: [ 'has', 'point_count' ],
59
- layout: {
60
- 'text-field': '{point_count_abbreviated}',
61
- 'text-font': [ 'DIN Offc Pro Medium', 'Arial Unicode MS Bold' ],
62
- 'text-size': 12
63
- }
64
- })
65
-
66
- map.addLayer({
67
- id: 'unclustered-point',
68
- type: 'circle',
69
- source: 'earthquakes',
70
- filter: [ '!', [ 'has', 'point_count' ] ],
71
- paint: {
72
- 'circle-color': '#11b4da',
73
- 'circle-radius': 4,
74
- 'circle-stroke-width': 1,
75
- 'circle-stroke-color': '#fff'
76
- }
77
- })
78
-
79
- map.on('click', 'clusters', function (e) {
80
- const features = map.queryRenderedFeatures(e.point, {
81
- layers: [ 'clusters' ]
82
- })
83
- const clusterId = features[0].properties.cluster_id
84
- map.getSource('earthquakes').getClusterExpansionZoom(clusterId, function (err, zoom) {
85
- if (err) { return }
86
-
87
- map.easeTo({
88
- center: features[0].geometry.coordinates,
89
- zoom: zoom
90
- })
91
- })
92
- })
93
-
94
- map.on('mouseenter', 'clusters', function () {
95
- map.getCanvas().style.cursor = 'pointer'
96
- })
97
- map.on('mouseleave', 'clusters', function () {
98
- map.getCanvas().style.cursor = ''
99
- })
100
-
101
- map.on('click', 'unclustered-point', function (e) {
102
- const coordinates = e.features[0].geometry.coordinates.slice()
103
-
104
- // Ensure that if the map is zoomed out such that multiple
105
- // copies of the feature are visible, the popup appears
106
- // over the copy being pointed to.
107
- while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {
108
- coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360
109
- }
110
-
111
- map.setCenter(coordinates)
112
-
113
- new mapbox.Popup({})
114
- .setLngLat(coordinates)
115
- .setHTML('<div id="mini-scroller"></div>')
116
- .addTo(map)
117
-
118
- new MiniScroller({ target: document.getElementById('mini-scroller'), props: {} }) // eslint-disable-line no-new
119
- })
120
-
121
- map.on('mouseenter', 'unclustered-point', function () {
122
- map.getCanvas().style.cursor = 'pointer'
123
- })
124
-
125
- map.on('mouseleave', 'unclustered-point', function () {
126
- map.getCanvas().style.cursor = ''
127
- })
128
- </script>
@@ -1 +0,0 @@
1
- <h2>hello</h2>