MCPcopy Create free account
hub / github.com/react-native-maps/react-native-maps / MapBoundaries

Function MapBoundaries

example/src/examples/MapBoundaries.tsx:14–50  ·  view source on GitHub ↗
(props: any)

Source from the content-addressed store, hash-verified

12const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO;
13
14const MapBoundaries = (props: any) => {
15 const [region] = useState({
16 latitude: LATITUDE,
17 longitude: LONGITUDE,
18 latitudeDelta: LATITUDE_DELTA,
19 longitudeDelta: LONGITUDE_DELTA,
20 });
21
22 const [mapBoundaries, setMapBoundaries] = useState<BoundingBox | null>(null);
23 const mapRef = useRef<MapView>(null);
24
25 const onRegionChangeComplete = () => {
26 if (mapRef.current) {
27 mapRef.current.getMapBoundaries().then(boundaries => {
28 setMapBoundaries(boundaries);
29 });
30 }
31 };
32
33 return (
34 <View style={styles.container}>
35 <MapView
36 ref={mapRef}
37 provider={props.provider}
38 style={styles.map}
39 initialRegion={region}
40 onMapReady={onRegionChangeComplete}
41 onRegionChangeComplete={onRegionChangeComplete}
42 />
43 <View style={styles.buttonContainer}>
44 <View style={styles.bubble}>
45 <Text>{JSON.stringify(mapBoundaries)}</Text>
46 </View>
47 </View>
48 </View>
49 );
50};
51
52const styles = StyleSheet.create({
53 container: {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…