| 11 | const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; |
| 12 | |
| 13 | class CustomMarkers extends React.Component<any, any> { |
| 14 | constructor(props: any) { |
| 15 | super(props); |
| 16 | |
| 17 | this.state = { |
| 18 | region: { |
| 19 | latitude: LATITUDE, |
| 20 | longitude: LONGITUDE, |
| 21 | latitudeDelta: LATITUDE_DELTA, |
| 22 | longitudeDelta: LONGITUDE_DELTA, |
| 23 | }, |
| 24 | points: [ |
| 25 | {latitude: 37.78825, longitude: -122.4324, weight: 1}, |
| 26 | {latitude: 37.78925, longitude: -122.4334, weight: 0.8}, |
| 27 | {latitude: 37.78725, longitude: -122.4314, weight: 1.2}, |
| 28 | // etc. |
| 29 | ], |
| 30 | }; |
| 31 | } |
| 32 | |
| 33 | render() { |
| 34 | if (this.props.provider !== PROVIDER_GOOGLE) { |
| 35 | return ( |
| 36 | <View style={styles.error}> |
| 37 | <Text>Heatmap is not supported on Apple maps.</Text> |
| 38 | </View> |
| 39 | ); |
| 40 | } |
| 41 | return ( |
| 42 | <View style={styles.container}> |
| 43 | <MapView |
| 44 | provider={this.props.provider} |
| 45 | style={styles.map} |
| 46 | initialRegion={this.state.region}> |
| 47 | <Heatmap |
| 48 | points={this.state.points} |
| 49 | opacity={1} |
| 50 | radius={50} |
| 51 | gradient={{ |
| 52 | colors: ['#00f', '#0ff', '#0f0', '#ff0', '#f00'], |
| 53 | startPoints: [0.1, 0.3, 0.5, 0.7, 1], |
| 54 | colorMapSize: 256, |
| 55 | }} |
| 56 | /> |
| 57 | </MapView> |
| 58 | </View> |
| 59 | ); |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | const styles = StyleSheet.create({ |
| 64 | container: { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…