Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for offline downloading of tilesets #3633

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kevinmanncito
Copy link

@kevinmanncito kevinmanncito commented Sep 20, 2024

Description

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

Checklist

  • I've read CONTRIBUTING.md
  • I updated the doc/other generated code with running yarn generate in the root folder
  • 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
  • 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 kevinmanncito changed the title WIP: feat: add support for offline downloading of tilesets feat: add support for offline downloading of tilesets Sep 20, 2024
@kevinmanncito kevinmanncito marked this pull request as draft September 20, 2024 17:15
@kevinmanncito
Copy link
Author

kevinmanncito commented Sep 20, 2024

@mfazekas the main blocker on this right now is getting v10 vs v11 working correctly. If you have any input on how that works or any input in general on this PR let me know

@mfazekas
Copy link
Contributor

mfazekas commented Oct 6, 2024

@kevinmanncito thanks much and sorry for the late answer, do you still have issue with getting both RN11 and 10 working? On which platform? I think it's fine if this is a v11 feature only, if that makes sense.

@kevinmanncito
Copy link
Author

@kevinmanncito thanks much and sorry for the late answer, do you still have issue with getting both RN11 and 10 working? On which platform? I think it's fine if this is a v11 feature only, if that makes sense.

Yeah I figured out how to handle v10 code vs v11 code on android. The issue I ran into wrapping this up is in v11 you can't do the style download and tilesets download in the same descriptor like you can in v10. Its gonna require a bit of a refactor in how things are setup doing two separate downloads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants