UNPKG

@mapbox/react-native-mapbox-gl

Version:

A Mapbox GL react native module for creating custom maps

39 lines (31 loc) 810 B
import React from 'react'; import { requireNativeComponent } from 'react-native'; import { viewPropTypes } from '../utils'; import { LightLayerStyleProp } from '../utils/styleMap'; import AbstractLayer from './AbstractLayer'; export const NATIVE_MODULE_NAME = 'RCTMGLLight'; /** * Light represents the light source for extruded geometries */ class Light extends AbstractLayer { static propTypes = { ...viewPropTypes, /** * Customizable style attributes */ style: LightLayerStyleProp, }; render() { return ( <RCTMGLLight {...this.props} style={undefined} reactStyle={this.getStyle()} /> ); } } const RCTMGLLight = requireNativeComponent(NATIVE_MODULE_NAME, Light, { nativeOnly: { reactStyle: true }, }); export default Light;