Skip to content

API Documentation

Complete API reference documentation.

⚠️ Permission and Privacy Compliance Warning

Before using map and location features, ensure:

  1. ✅ Required permissions are configured in native project
  2. ✅ Request user authorization at runtime
  3. ✅ Comply with privacy laws and regulations
  4. ✅ On a fresh install, complete privacy consent before initSDK
  5. ✅ After consent is granted once, privacy state is persisted and auto-restored natively

Table of Contents

Core Features

Extended Features

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',
});