npm.io
3.0.0-beta.15 • Published 2h ago

@mappedin/mvf-fetch

Licence
UNLICENSED
Version
3.0.0-beta.15
Deps
2
Size
278 kB
Vulns
0
Weekly
0

MVF Fetch

Isomorphic utilities for efficiently reading published MVF v2/v3 zip archives from the cloud via HTTP Range requests.

This package focuses on extracting and optionally validating individual zip entries. It does not render maps or convert between MVF versions.

Usage

import { createMvfFetcher } from '@mappedin/mvf-fetch';
import { autoMvfValidator } from '@mappedin/mvf-fetch/validators';

const fetcher = createMvfFetcher({
  url: async () => ({
    url: signedZipUrl,
    cacheKey: `${venueId}:${updatedAt}`,
  }),
  validate: autoMvfValidator(),
});

const version = await fetcher.getVersion();
const { files } = await fetcher.getEntries(['manifest.geojson', 'floors.geojson']);