Skip to content

LBS Scenario Recommendations

This guide shows how to combine expo-gaode-map (map rendering) and expo-gaode-map-web-api (data services) to implement common production scenarios.

Component Responsibilities

Before choosing a feature path, split responsibilities clearly:

  • expo-gaode-map (Core): UI rendering layer for map view, camera, overlays, gestures, and location display.
  • expo-gaode-map-web-api (Web API): data/service layer for geocoding, route planning, POI search, and input tips.

1. Location + Geocoding

FeatureCore + Web API FlowTypical Use Case
Precise location displayCore gets coordinates -> Core updates camera and blue dotRide-hailing and delivery app home screen
Reverse geocodingCore gets coordinates -> Web API resolves readable address -> UI shows addressCheck-in, pickup confirmation
GeocodingUser enters address -> Web API resolves coordinates -> Core jumps and marksDestination input and address picker
Drag-to-pickCore keeps center marker fixed -> user drags map -> Web API resolves center addressPickup fine-tuning

2. Search + POI Discovery

FeatureCore + Web API FlowTypical Use Case
Keyword searchUser enters keyword -> Web API returns POIs -> Core renders markersRestaurant/hotel search
Nearby searchCore gets current center -> Web API searches nearby category -> Core renders list and markersNearby facility lookup
Input tipsUser types -> Web API returns suggestion list -> click to jump on mapSearch UX optimization
Polygon area searchCore draws Polygon -> Web API searches POIs inside polygonBusiness district analysis

3. Routing + Navigation

FeatureCore + Web API FlowTypical Use Case
Driving route planningWeb API computes route -> Core renders PolylineTrip preview
Multi-strategy comparisonWeb API returns multiple routes -> Core renders color-coded polylinesUser route choice
Traffic visualizationWeb API returns traffic segments -> Core renders red/yellow/green sectionsCongestion awareness
Transit planningWeb API computes transit plan -> Core renders segmented pathPublic transport planning
Walking/cycling planningWeb API computes short-distance path -> Core renders key turnsLast-mile guidance

4. Advanced Visualization

FeatureCore + Web API FlowTypical Use Case
Massive point clusteringWeb API returns large data set -> Core Cluster renders aggregated markersBike sharing, real estate
HeatmapWeb API returns density data -> Core renders HeatMap layerVisitor flow and business analysis
Geofence and service areaWeb API returns boundary data -> Core renders PolygonDelivery area, restricted zones
Track playbackBackend stores coordinate sequence -> Core animates marker and route traceFitness and fleet tracking

5. Industry Scenarios

FeatureCore + Web API FlowTypical Use Case
Real estate and school district mapWeb API searches schools -> Core renders points and district polygonsProperty app
Logistics route optimizationWeb API performs multi-stop route calculation -> Core renders optimized sequenceCourier and delivery
Grid-based governanceWeb API returns administrative boundaries -> Core renders status-colored polygonsSmart city
Location attendanceCore gets location + Web API reverse geocode + in-polygon checkField workforce management

6. UX Enhancements

FeatureCore + Web API FlowTypical Use Case
Smooth marker movementWeb API returns updated coordinates -> Core animates marker/cameraReal-time vehicle tracking
Auto-fit viewportWeb API returns result set -> Core computes bounds -> map fits all pointsSearch results display
Custom calloutsTap marker -> Core callout displays live data from Web APIRestaurant queue info

7. Utility Tools

FeatureCore + Web API FlowTypical Use Case
Distance measurementCore records clicked points -> geometry/Web API computes length -> UI displays resultOutdoor planning
Area measurementCore records polygon points -> geometry computes area -> UI displays resultLand and renovation estimation

Best-Practice Example: Ride-Hailing Flow

tsx
// 1. Get current location
const location = await ExpoGaodeMapModule.getCurrentLocation();

// 2. Reverse geocode current location
const regeo = await api.geocode.regeocode({
  latitude: location.latitude,
  longitude: location.longitude
});
console.log('Current location:', regeo.regeocode.formatted_address);

// 3. Search destination
const pois = await api.poi.search('Beijing West Railway Station', { city: 'Beijing' });
const destination = pois.pois[0];

// 4. Plan driving route
const route = await api.route.driving(
  `${location.longitude},${location.latitude}`,
  `${destination.location}`
);