nitaliano / react-native-mapbox-gl

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

Using local style JSON rather than a URL #1468

Closed jliebrand closed 5 years ago

jliebrand commented 5 years ago

How can I pass a local JSON style object to MapView rather than pointing it to a hosted style?

(and in addition to that, can the JSON also contain a pointer to a local sprite png?)

kristfal commented 5 years ago

You can use a file URL to point towards a style.json locally on your devuce or serve an empty style.json (just containing sources) from the server side and repopulate it fully by runtime styling.