nitaliano / react-native-mapbox-gl

A Mapbox GL react native module for creating custom maps
Other
2.16k stars 697 forks source link

error in offlineManager.createPack(..) styleURL #1673

Open alextorn opened 4 years ago

alextorn commented 4 years ago

I've saved style.json on documentsDir then trying to path this file to styleURL in offlineManager.createPack to create an offline pack. What did I miss?

Code:

await MapboxGL.offlineManager.createPack({
  styleURL: `file://${dirs.DocumentDir}/offlineConfig.json`,
  ...config,
},
  progressListener,
  errorListener,
);

Error:

Error Domain=MGLErrorDomain Code=-1 "Response class is not NSHTTPURLResponse" UserInfo={NSLocalizedFailureReason=Response class is not NSHTTPURLResponse}

I saw comments from maintainers @nitaliano that we can use two types of styleURL:

  1. External resource (http://, https://)
  2. Interna resource - absolute path to file in the native file system.

What I did wrong?

systemlevel commented 4 years ago

This repo is no longer officially maintained. Join us over to https://github.com/react-native-mapbox-gl/maps for an actively maintained react-native mapbox library.