
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@gebeta/tiles-react-native
Advanced tools
A React Native SDK for integrating Gebeta Maps into your applications
A React Native SDK for integrating Gebeta Maps into your applications.
yarn add @gebeta/tiles-react-native
yarn add @maplibre/maplibre-react-native
maplibre is a required dependency.
import React, { useRef } from 'react';
import { View, Alert } from 'react-native';
import { GebetaMap, GebetaMapRef } from '@gebeta/tiles-react-native';
const App = () => {
const mapRef = useRef<GebetaMapRef>(null);
const handleMapClick = (lngLat: [number, number], event: any) => {
Alert.alert(
'Map Clicked',
`Longitude: ${lngLat[0].toFixed(6)}\nLatitude: ${lngLat[1].toFixed(6)}`
);
};
const handleMapLoaded = () => {
// Add a marker after map loads
if (mapRef.current) {
mapRef.current.addImageMarker(
[38.7463, 9.0223], // Addis Ababa coordinates
'https://via.placeholder.com/32x32/007cbf/ffffff?text=M',
[32, 32],
(lngLat, marker, event) => {
Alert.alert('Marker Clicked', 'You clicked on Addis Ababa!');
}
);
}
};
return (
<View style={{ flex: 1 }}>
<GebetaMap
ref={mapRef}
apiKey="your-api-key-here"
center={[38.7463, 9.0223]} // Addis Ababa
zoom={12}
onMapClick={handleMapClick}
onMapLoaded={handleMapLoaded}
/>
</View>
);
};
export default App;
import React, { useRef } from 'react';
import { Alert, View, Button, StyleSheet } from 'react-native';
import GebetaMap, { GebetaMapRef } from '@gebeta/tiles-react-native';
const App = () => {
const mapRef = useRef<GebetaMapRef>(null);
const handleMapClick = (lngLat: [number, number]) => {
Alert.alert(
'Map Clicked',
`Longitude: ${lngLat[0].toFixed(6)}\nLatitude: ${lngLat[1].toFixed(6)}`
);
};
const handleFlyToBahirDar = () => {
if (mapRef.current) {
mapRef.current.flyTo({
center: [37.3895, 11.5946],
zoom: 14,
pitch: 45,
duration: 5000,
});
}
};
return (
<View style={styles.container}>
<GebetaMap
ref={mapRef}
apiKey="your-api-key-here"
center={[38.7463, 9.0223]}
zoom={12}
onMapClick={handleMapClick}
style={"https://tiles.gebeta.app/styles/standard/style.json"}
/>
<View style={styles.buttonContainer}>
<Button title="✈️ Fly to Bahir Dar" onPress={handleFlyToBahirDar} />
</View>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
},
buttonContainer: {
position: 'absolute',
top: 60,
left: 0,
right: 0,
alignItems: 'center',
},
});
export default App;
| Prop | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | Your Gebeta Maps API key |
center | [number, number] | Yes | Initial map center coordinates [longitude, latitude] |
zoom | number | Yes | Initial zoom level |
onMapClick | (lngLat: [number, number], event: any) => void | No | Callback when map is clicked |
onMapLoaded | () => void | No | Callback when map finishes loading |
blockInteractions | boolean | No | Disable map interactions |
style | any | No | Custom styles for the map container |
clusteringOptions | ClusteringOptions | No | Options for marker clustering |
addImageMarker(lngLat, imageUrl, size, onClick, zIndex, popupHtml) - Add an image markeraddMarker(options) - Add a basic markerclearMarkers() - Remove all markersgetMarkers() - Get all current markersstartFence() - Start drawing a fenceaddFencePoint(lngLat, customImage, onClick) - Add a point to the current fencecloseFence() - Close the current fenceclearFence() - Clear the current fenceclearAllFences() - Clear all fencesgetFences() - Get all fencesgetFencePoints() - Get current fence pointsisDrawingFence() - Check if currently drawing a fenceaddPath(path, options) - Add a path to the mapclearPaths() - Clear all pathsflyTo(options) – Animate the map camera to a specified location with optional zoom, bearing, pitch, and duration.addClusteredMarker(marker) - Add a marker for clusteringclearClusteredMarkers() - Clear all clustered markersupdateClustering() - Update clusteringsetClusteringEnabled(enabled) - Enable/disable clusteringsetClusterImage(imageUrl) - Set custom cluster imagegeocode(name) - Geocode an addressreverseGeocode(lat, lon) - Reverse geocode coordinatesgetDirections(origin, destination, options) - Get directions between two pointsconvertDirectionsToNavigationRoute(response) - Convert Gebeta directions response to NavigationRoutedisplayRoute(routeData, options) - Display a route on the mapclearRoute() - Clear the current routegetCurrentRoute() - Get the current routegetRouteSummary() - Get route summaryupdateRouteStyle(style) - Update route stylingstartNavigation(route, options) - Start navigation with a NavigationRouteupdateNavigationPosition([lng, lat]) - Update position (e.g., from GPS)stopNavigation() - Stop navigationgetNavigationState() - Get current navigation stateisNavigating() - Check if navigation is activeNavigation route shape
type NavigationRoute = {
coordinates: [number, number][]; // [lng, lat]
distance?: number; // meters
duration?: number; // seconds
instructions?: {
type: 'turn' | 'straight' | 'arrive' | 'depart';
direction?: 'left' | 'right' | 'slight-left' | 'slight-right' | 'sharp-left' | 'sharp-right';
distance: number; // meters
text: string;
coordinate: [number, number];
}[];
};
Using Gebeta Directions response The Gebeta API returns:
{
"msg": "Ok",
"timetaken": 5102.905,
"totalDistance": 15308.715,
"direction": [
[lng, lat],
...
]
}
Convert and start navigation:
const res = await mapRef.current?.getDirections(origin, destination);
const route = mapRef.current?.convertDirectionsToNavigationRoute(res);
if (route) {
mapRef.current?.startNavigation(route, {
onNavigationUpdate: (state) => mapRef.current?.updateNavigationPosition(/* GPS coords */),
});
}
GPS tracking
@react-native-community/geolocation) to call updateNavigationPosition([lng, lat]).ACCESS_FINE_LOCATION. On iOS, set NSLocationWhenInUseUsageDescription.To test the package, navigate to the example and run:
cd example/GebetaMapsFence
yarn install
yarn android # or yarn ios
To build the package:
yarn build
MIT
FAQs
A React Native SDK for integrating Gebeta Maps into your applications
We found that @gebeta/tiles-react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.