Open matthieupinte opened 6 years ago
Hi,
react: ^16.3.0-alpha.1 react-native: 0.53.3 @mapbox/react-native-mapbox-gl: ^6.1.0 @turf/helpers: ^6.1.1
I juste found by testing that my app crash when I don't set an id prop in SymbolLayer.
id
SymbolLayer
Example:
import React from 'react' import MapboxGL from '@mapbox/react-native-mapbox-gl' import { point } from '@turf/helpers'
const styles = MapboxGL.StyleSheet.create({ marker: { iconImage: 'marker', iconAllowOverlap: true, iconSize: 1, }, })
export default ({ id, coordinates }) => coordinates ? ( <MapboxGL.ShapeSource id="xxx" shape={point([coordinates.longitude, coordinates.latitude])} images={{ assets: ['marker'] }}
</MapboxGL.ShapeSource> ) : null
I'm reporting it, because in your documentation, it says that id is not required
Best regards,
Thanks, id is a required field for a layer, we'll update the prop types for it and regenerate the documentation.
Hi,
I juste found by testing that my app crash when I don't set an
id
prop inSymbolLayer
.Example:
const styles = MapboxGL.StyleSheet.create({ marker: { iconImage: 'marker', iconAllowOverlap: true, iconSize: 1, }, })
export default ({ id, coordinates }) => coordinates ? ( <MapboxGL.ShapeSource id="xxx" shape={point([coordinates.longitude, coordinates.latitude])} images={{ assets: ['marker'] }}
const styles = MapboxGL.StyleSheet.create({ marker: { iconImage: 'marker', iconAllowOverlap: true, iconSize: 1, }, })
export default ({ id, coordinates }) => coordinates ? ( <MapboxGL.ShapeSource id="xxx" shape={point([coordinates.longitude, coordinates.latitude])} images={{ assets: ['marker'] }}
I'm reporting it, because in your documentation, it says that
id
is not requiredBest regards,