How to use the @react-native-mapbox-gl/maps.offlineManager function in @react-native-mapbox-gl/maps

To help you get started, we’ve selected a few @react-native-mapbox-gl/maps examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github developmentseed / observe / app / services / offline-tiles.js View on Github external
export function createPack (options) {
  const { name, bounds } = options

  const progressListener = (offlineRegion, status) => {
    // TODO: call redux actions to update ui as needed
    console.log(offlineRegion, status)
  }

  const errorListener = (offlineRegion, err) => {
    // TODO: call redux actions to update ui as needed
    console.log(offlineRegion, err)
  }

  return MapboxGL.offlineManager.createPack({
    name,
    styleURL,
    bounds,
    // TODO: we'll want to test out different min/max zooms
    minZoom: 10,
    maxZoom: 20
  }, progressListener, errorListener)
}