@nimbyte/svelte-toolbox
v0.3.0
Published
Svelte components and helpers published as modular subpaths.
Readme
@nimbyte/svelte-toolbox
Svelte components and helpers published as modular subpaths.
Install
npm install @nimbyte/svelte-toolboxIf you use the maplibre module, also install:
npm install maplibre-glmaplibre-gl is an optional peer dependency of this package. It is required only when importing from @nimbyte/svelte-toolbox/maplibre.
Usage
Map component
<script lang="ts">
import { Map } from '@nimbyte/svelte-toolbox/maplibre';
const center = { lng: -46.6333, lat: -23.5505 };
const mapStyle = 'https://demotiles.maplibre.org/style.json';
</script>
<Map {center} {mapStyle} showMarker={true} style="width: 100%; height: 360px;" />Attachment helper
<script lang="ts">
import { createMapAttachment } from '@nimbyte/svelte-toolbox/maplibre';
const mapAttachment = createMapAttachment({
center: { lng: -46.6333, lat: -23.5505 },
style: 'https://demotiles.maplibre.org/style.json',
showMarker: true
});
</script>
<div {@attach mapAttachment} style="width: 100%; height: 360px;"></div>API
From @nimbyte/svelte-toolbox/maplibre:
MapcreateMapAttachmentMapAttachmentOptions(type)
Local development
npm run dev
npm run check
npm run test