ola_maps library

Flutter plugin for Ola Maps (Android, iOS, Web) plus Places HTTP helpers.

Classes

Address
Geocoded place returned by Places / Geocode APIs.
AddressComponent
One structured part of an Address (city, postal code, …).
AddressValidationComponent
One component from address validation.
AddressValidationResult
Result of an address-validation call.
AutoCompleteResults
One Places Autocomplete suggestion.
ElevationResult
Elevation at a coordinate.
Geofence
Stored geofence from the Places Geofence API.
GeofenceListResult
Paged list of Geofence records.
GeofenceRequest
Payload for create/update geofence calls.
GeofenceStatus
Point-in-fence check result.
Geometry
Coordinate plus optional viewport for a place.
Location
Latitude / longitude used by Places and Routing HTTP APIs.
MapStyleInfo
Published vector style from the Tiles API.
MatchedSubstring
Character range that matched an autocomplete query.
NearByPlaceDetails
Nearby Search row from Places.
NearestRoadResult
Nearest road for a single query point.
OlaCameraPosition
Camera target plus zoom / bearing / tilt.
OlaLatLng
Geographic coordinate used by the Ola Maps SDK.
OlaLineType
Line styles accepted by polylines and bezier curves.
OlaMapController
Overlay and camera API for a single OlaMapView instance.
Olamaps
HTTP helpers for Ola Maps REST APIs (Places, Geocode, Roads, Geofencing, Elevation, Tiles, Street View, Routing).
OlaMapsAutocomplete
Search-as-you-type Places Autocomplete dropdown.
OlaMapsElevation
Point elevation lookups.
OlaMapsGeofence
Geofence CRUD and point-in-fence checks.
OlaMapsLanguage
ISO 639-1 language codes supported by Ola Maps Places, Routing, Geocoding, and Maps APIs. Defaults to en when omitted.
OlaMapsRoads
Roads APIs: snap-to-road, nearest roads, and speed limits.
OlaMapsStreetView
Street View coverage, image ids, and metadata.
OlaMapsTiles
Static maps, style URLs, and 3D tileset helpers.
OlaMapView
Native (Android / iOS) or web map surface backed by the Ola Maps SDKs.
OlaRoutingService
Directions, distance matrix, and fleet helpers for Ola Maps Routing.
OpeningHours
Published hours for a PlaceDetails result.
Period
One open/close window inside OpeningHours.
PlaceDetails
Full place record from Place Details.
PlacePhoto
Photo metadata from Places.
PlusCode
Open Location Code (Plus Code) for a place.
Review
User review attached to PlaceDetails.
SnappedPoint
One GPS sample snapped onto the road network.
SnapToRoadResult
Response from snap-to-road.
SpeedLimitEntry
Posted speed limit for one snapped point.
SpeedLimitsResult
Response from the speed-limits API.
StaticMapMarker
Marker overlay for a static map image.
StreetViewImageId
Nearest Street View panorama id.
StreetViewMetadata
Metadata for a Street View panorama.
StructuredFormatting
Primary and secondary labels for a prediction.
Term
One token in a prediction description.
TextSearchPrediction
One row from Places text search.
Time
Weekday plus HHmm clock time.
Viewport
Southwest / northeast pair describing a map bounds.

Enums

Status
Outcome flag used by Places and Geocode JSON envelopes.

Constants

kOlaMapsBackendProxyPath → const String
Path marker used by apps that hide the Ola API key behind their own backend.
kOlaMapsDefaultThreeDTileset → const String
3D tileset used by the Ola Maps Web SDK.
kOlaMapsDefaultTileUrl → const String
Default vector style used by Ola Maps (OlaMapService / Web SDK).
kOlaMapsWebSdkUrl → const String
CDN URL for olamaps-web-sdk (UMD). The Flutter web plugin also loads this automatically if the host page did not include the script tag.

Functions

canCreateOlaMapView({required String apiKey, required String tileUrl}) → bool
The map can start with a real dashboard key or a backend tile proxy.
flattenPredictions(dynamic predictions) → List
Flattens nested autocomplete prediction arrays.
formatOlaMapError(Object error) → String
Turns native / HTTP failures into a short message for OlaMapView.onMapError.
isOlaMapsApiKeyConfigured(String apiKey) → bool
Returns false for empty or placeholder dashboard keys.
olaMapsBackendProxyBase(String? tileUrl) → String?
{origin}/ola-maps/proxy derived from a tile URL, or null if unused.
parseStatus(String status) → Status
Maps an Ola Maps status string to Status. Unknown values become Status.ok.
stringList(dynamic value) → List<String>
Coerces a JSON list or comma-separated string into List<String>.
usesOlaMapsBackendProxy(String? tileUrl) → bool
True when tileUrl is served through an app backend that hides the API key. Matches Android OlaMapsHttpProxy.usesBackendProxy.

Exceptions / Errors

ApiException
Base error thrown by Ola Maps HTTP helpers.
BadRequestException
HTTP 400 from an Ola Maps endpoint.
NotFoundException
HTTP 404 from an Ola Maps endpoint.
ServerException
HTTP 500 from an Ola Maps endpoint.
UnauthorizedException
HTTP 401 from an Ola Maps endpoint.
UnprocessableException
HTTP 422 from an Ola Maps endpoint.