We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mapbox
default
0.75.2
Android
@rnmapbox/maps
10.1.31
import {Camera, MapView, snapshotManager, StyleURL} from '@rnmapbox/maps'; import {useState} from 'react'; import {StyleSheet, Text, TouchableOpacity, View} from 'react-native'; const AppMap = () => { const bounds = [ [73.7600360295555, 27.562587612793436], [77.33589097013527, 23.986732672213662], ]; const [map, setMap] = useState<MapView | null>(null); const onPress = async () => { if (!map) { return; } const snapshot = await snapshotManager.takeSnap({ bounds, width: 1024, height: 1024, }); }; return ( <View style={styles.page}> <View style={styles.container}> <MapView styleURL={StyleURL.SatelliteStreet} ref={c => setMap(c)} style={styles.map}></MapView> <TouchableOpacity style={styles.button} onPress={onPress}> <Text style={styles.buttonText}>Take Snap</Text> </TouchableOpacity> </View> </View> ); }; const styles = StyleSheet.create({ page: { flex: 1, justifyContent: 'center', alignItems: 'center', }, container: { height: '100%', width: '100%', }, map: { flex: 1, }, button: { position: 'absolute', bottom: 20, left: '50%', transform: [{translateX: -50}], backgroundColor: '#007AFF', paddingVertical: 10, paddingHorizontal: 20, borderRadius: 5, justifyContent: 'center', alignItems: 'center', }, buttonText: { color: '#FFF', fontSize: 16, fontWeight: 'bold', }, }); export default AppMap;
Can take screenshot with input bounds
No response
The text was updated successfully, but these errors were encountered:
Please fix the errors in your code example - More info.:
error: 'React' must be in scope when using JSX (react/react-in-jsx-scope) at example.tsx:25:5: 23 | 24 | return ( > 25 | <View style={styles.page}> | ^ 26 | <View style={styles.container}> 27 | <MapView 28 | styleURL={StyleURL.SatelliteStreet} error: 'React' must be in scope when using JSX (react/react-in-jsx-scope) at example.tsx:26:7: 24 | return ( 25 | <View style={styles.page}> > 26 | <View style={styles.container}> | ^ 27 | <MapView 28 | styleURL={StyleURL.SatelliteStreet} 29 | ref={c => setMap(c)} error: 'React' must be in scope when using JSX (react/react-in-jsx-scope) at example.tsx:27:9: 25 | <View style={styles.page}> 26 | <View style={styles.container}> > 27 | <MapView | ^ 28 | styleURL={StyleURL.SatelliteStreet} 29 | ref={c => setMap(c)} 30 | style={styles.map}></MapView> error: 'React' must be in scope when using JSX (react/react-in-jsx-scope) at example.tsx:31:9: 29 | ref={c => setMap(c)} 30 | style={styles.map}></MapView> > 31 | <TouchableOpacity style={styles.button} onPress={onPress}> | ^ 32 | <Text style={styles.buttonText}>Take Snap</Text> 33 | </TouchableOpacity> 34 | </View> error: 'React' must be in scope when using JSX (react/react-in-jsx-scope) at example.tsx:32:11: 30 | style={styles.map}></MapView> 31 | <TouchableOpacity style={styles.button} onPress={onPress}> > 32 | <Text style={styles.buttonText}>Take Snap</Text> | ^ 33 | </TouchableOpacity> 34 | </View> 35 | </View> 5 errors found.```
Sorry, something went wrong.
No branches or pull requests
Mapbox Implementation
Mapbox
Mapbox Version
default
React Native Version
0.75.2
Platform
Android
@rnmapbox/maps
version10.1.31
Standalone component to reproduce
Observed behavior and steps to reproduce
Expected behavior
Can take screenshot with input bounds
Notes / preliminary analysis
No response
Additional links and references
No response
The text was updated successfully, but these errors were encountered: