maps icon indicating copy to clipboard operation
maps copied to clipboard

feat: add support for offline downloading of tilesets

Open kevinmanncito opened this issue 5 months ago • 3 comments

Description

Added tileset offline download. Offline map packs can now include tilesets.

Checklist

  • [x] I've read CONTRIBUTING.md
  • [ ] I updated the doc/other generated code with running yarn generate in the root folder
  • [x] I have tested the new feature on /example app.
    • [ ] In V11 mode/ios - TODO: Appears to be working on v10 only
    • [ ] In New Architecture mode/ios
    • [ ] In V11 mode/android - TODO: Appears to be working on v10 only
    • [ ] In New Architecture mode/android
  • [x] I added/updated a sample - if a new feature was implemented (/example)

Screenshot OR Video

Component to reproduce the issue you're fixing

Tilesets argument can now be passed into the offline download create pack call like this:

const options = {
  name: packName,
  styleURL: STYLE_URL,
  tilesets: [
    'mapbox://mapbox.mapbox-streets-v8',
    'mapbox://mapbox.mapbox-terrain-dem-v1',
    'mapbox://mapbox.country-boundaries-v1',
  ], // Any tilesets that should be included in the offline download
  bounds: [
    [bounds[0], bounds[1]],
    [bounds[2], bounds[3]],
  ] as [[number, number], [number, number]],
  minZoom: 10,
  maxZoom: 20,
  metadata: {
    whatIsThat: 'foo',
  },
};
offlineManager.createPack(options, (region, status) =>
  console.log('=> progress callback region:', 'status: ', status),
);

kevinmanncito avatar Sep 20 '24 17:09 kevinmanncito