API Documentation
Complete API reference documentation.
⚠️ Permission and Privacy Compliance Warning
Before using map and location features, ensure:
- ✅ Required permissions are configured in native project
- ✅ Request user authorization at runtime
- ✅ Comply with privacy laws and regulations
- ✅ On a fresh install, complete privacy consent before
initSDK- ✅ After consent is granted once, privacy state is persisted and auto-restored natively
Table of Contents
Core Features
- MapView Props & Methods
- Components & Hooks
- Location API
- Geometry Utils
- Overlay Components
- Type Definitions
Extended Features
- Search API - POI search, nearby search, along-route search, input tips
- Navigation API - Route planning and navigation
- Offline Maps API - City map download and management
- Web API - AMap Web Service API (pure JavaScript)
Quick Navigation
Map Component
tsx
import { MapView } from 'expo-gaode-map';
<MapView
style={{ flex: 1 }}
initialCameraPosition={{
target: { latitude: 39.9, longitude: 116.4 },
zoom: 10,
}}
myLocationEnabled={true}
/>Location Features
tsx
import { ExpoGaodeMapModule } from 'expo-gaode-map';
// Complete privacy compliance first
if (!ExpoGaodeMapModule.getPrivacyStatus().isReady) {
ExpoGaodeMapModule.setPrivacyConfig({
hasShow: true,
hasContainsPrivacy: true,
hasAgree: true,
});
}
// If native keys are configured via Config Plugin or manually, and you only use
// map/location features, you can skip initSDK.
// Only needed for Web API features:
ExpoGaodeMapModule.initSDK({ webKey: 'your-web-api-key' });
// Get current location
const location = await ExpoGaodeMapModule.getCurrentLocation();Overlays
tsx
import { Circle, Marker, Polyline, Polygon } from 'expo-gaode-map';
<MapView>
<Marker position={{ latitude: 39.9, longitude: 116.4 }} />
<Circle center={{ latitude: 39.9, longitude: 116.4 }} radius={1000} />
</MapView>Search Features
tsx
import { searchPOI, searchNearby, getInputTips } from 'expo-gaode-map-search';
// Keyword search
const result = await searchPOI({
keyword: 'Starbucks',
city: 'Beijing',
});
// Nearby search
const nearby = await searchNearby({
center: { latitude: 39.9, longitude: 116.4 },
keyword: 'restaurant',
radius: 2000,
});
// Input tips
const tips = await getInputTips({
keyword: 'Star',
city: 'Beijing',
});Related Documentation
- Examples - Detailed code examples
- Search Examples - Search feature examples
- Initialization Guide - SDK initialization and permission management
- Getting Started - Quick start guide