rnmapbox / maps

A Mapbox react native module for creating custom maps
MIT License
2.16k stars 828 forks source link

[Bug]: Custom Styles on iOS #3434

Open jadephare opened 4 months ago

jadephare commented 4 months ago

Mapbox Implementation

Mapbox

Mapbox Version

11

React Native Version

0.71.8

Platform

iOS

@rnmapbox/maps version

10.1.19

Standalone component to reproduce

import React from 'react'
import { Camera, MapView } from '@rnmapbox/maps'

  const MapCameraProps = {
        // styleJSON: '',  {/**anything other than the default styleJSON, ie an exported style json file from mapbox... I think it needs to have some v11 styling to be black */}
}

export default function App() {
  return (
    <MapView {...MapCameraProps} style={{ flex: 1 }} 
>
      <Camera
        zoomLevel={8}
      />
    </MapView>
  )
}

Observed behavior and steps to reproduce

When I comment out the styleJSON around line 25 the default style loads. If I uncomment it, and fresh restart, the style loads completely black with no map. I know the style works because if I change the style file and save it, uncomment the line, the hot reloading will allow the map to load.

Expected behavior

Map loads with expected styleJSON

Notes / preliminary analysis

Seems like something about how the style is getting loaded isn't allowing the custom style to load on iOS. Android works fine.

The style I'm loading is v11 and I believe I have all the things set up based on this guide: here

Additional links and references

Are other people running into this issue?

jadephare commented 4 months ago

open