Map & Location Services
The eGrocer Partner App includes location-based features for vendors and delivery partners to track orders, manage deliveries, and optimize delivery routes.
Google Maps Integration
To use Google Maps in the Partner App, you need to set up Google Maps API with proper API keys:
For Android
-
Visit the Google Cloud Console
-
Create a new project or select an existing one
-
Enable Google Maps API for Android
-
Create an API key with appropriate restrictions
-
Add the API key to your project:
- Open
android/app/src/main/AndroidManifest.xml
- Add the following inside the
<application>
tag:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="YOUR_API_KEY_HERE" /> - Open
For iOS
-
Visit the Google Cloud Console
-
Create a new project or select an existing one
-
Enable Google Maps API for iOS
-
Create an API key with appropriate restrictions
-
Add the API key to your project:
- Open
ios/Runner/AppDelegate.swift
or create it if it doesn't exist - Add the following code:
import UIKit
import Flutter
import GoogleMaps
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GMSServices.provideAPIKey("YOUR_API_KEY_HERE")
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
} - Open
Delivery Partner Location Tracking
The Partner App includes real-time location tracking for delivery partners:
-
Enable background location access:
-
For Android, update
android/app/src/main/AndroidManifest.xml
:<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /> -
For iOS, update
ios/Runner/Info.plist
:<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs access to location when open to track deliveries.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>This app needs access to location when in the background for delivery tracking.</string>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
-
-
The app will send periodic location updates to the server during active deliveries
Route Optimization
The Partner App includes delivery route optimization features:
-
Optimal route calculation based on multiple delivery locations
-
Traffic-aware routing using Google Maps Directions API
-
Estimated arrival times for each delivery point
Delivery Zone Management
Vendors can configure their delivery zones within the app:
-
Set delivery radius from store location
-
Define custom polygon delivery areas
-
Set different delivery fees based on zones
Store Location Management
Vendors can manage their store location details:
-
Set precise store location on map
-
Add store address details
-
Configure operating hours
For any issues with maps or location services, ensure all API keys are configured correctly and all required permissions are granted by the user.