nitaliano / react-native-mapbox-gl

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

Custom map can be displayed, but the custom layer doesn't appear #1501

Closed winseyli closed 5 years ago

winseyli commented 5 years ago

I have a custom map which adds a custom text symbol layer for house number. This layer can be displayed on web/Android/iOS but it disappears on React Native (i.e. the map looks as same as Mapbox.StyleURL.Street, but not blank)

On the custom map style, I downgrade the compatibility for React Native.

screenshot 2019-02-05 at 2 01 52 pm

This is the react native coding.

<MapboxGL.MapView
  style={{flex: 1}}
  styleURL={this.state.isSatelliteOn ? MapboxGL.StyleURL.Satellite : "mapbox://styles/username/123456abcdef123456abcdefm"}
  zoomLevel={this.state.zoomLevel}
  centerCoordinate={[this.state.lng, this.state.lat]} // Initial center coordinate on map [lng, lat]
  showUserLocation={true}>
</MapboxGL.MapView>

Did I miss anything?

P.S. housenumber is my custom layer

screenshot 2019-02-05 at 2 02 03 pm
winseyli commented 5 years ago

Not sure if it needs to take a while to process the map? I can see the layer after 2 hours. Thanks you. Case closed. But I think this would be a good reference for someone need to use custom style (yes you need to downgrade the compatibility) P.S. current react-native-mapbox-gl latest release is 6.1.1

udaysagartammina commented 3 years ago

<MapboxGL.MapView style={{flex: 1}} styleURL={"mapbox://styles/username/cfnkn3ql227ss17o1pw2dj5vf"} zoomLevel={16} centerCoordinate={[this.state.lng, this.state.lat]} showUserLocation={true}> </MapboxGL.MapView>

My custom url not loading "react-native": "0.61.5", "@react-native-mapbox-gl/maps": "^8.1.0",

Any one can help me.