initialize method

void initialize(
  1. String apiKey, {
  2. Object? language,
})

Configures every REST client with apiKey and optional language.

Implementation

void initialize(
  String apiKey, {
  Object? language,
}) {
  this.language = OlaMapsLanguage.codeOf(language);
  final http = OlaMapsHttp(
    apiKey: apiKey,
    defaultLanguage: this.language,
  );
  geoencoder = OlamapsGeoencoder(apiKey: apiKey, httpClient: http);
  places = OlaMapsPlaces(apiKey: apiKey, httpClient: http);
  roads = OlaMapsRoads(apiKey: apiKey, http: http);
  geofence = OlaMapsGeofence(apiKey: apiKey, http: http);
  elevation = OlaMapsElevation(apiKey: apiKey, http: http);
  tiles = OlaMapsTiles(apiKey: apiKey, http: http);
  streetView = OlaMapsStreetView(apiKey: apiKey, http: http);
  routing = OlaRoutingService(apiKey: apiKey, httpClient: http);
}