dotup_dart_geolocation_here_maps 0.1.1 dotup_dart_geolocation_here_maps: ^0.1.1 copied to clipboard
HERE Maps api wrapper
example/dotup_dart_geolocation_here_maps_example.dart
import 'dart:io';
import 'package:dotup_dart_geolocation_core/dotup_dart_geolocation_core.dart';
import 'package:dotup_dart_geolocation_here_maps/dotup_dart_geolocation_here_maps.dart';
import 'package:yaml/yaml.dart';
import 'package:path/path.dart' as p;
void main() async {
var dir = Directory.current;
final path = p.join(Directory.current.path, 'example', 'secrets', '.dev.env.yaml');
final file = File(path);
final yaml = loadYaml(file.readAsStringSync());
final apiKey = yaml['config']['here']['API_KEY'];
final api = HereMapsGeoLocationService(apiKey: apiKey);
final address = Address(street: 'Industriering', houseNumberOrName: '7', postalCode: '63868', city: 'Großwallstadt');
final location = await api.getGeoCoordinatesFromAddress(address);
final singleLineAddress = address.asSingleLineString();
final result = await api.geoCode(searchtext: singleLineAddress);
final searchedLocation = result.geoCode!.getGeoCoordinates();
final y = await api.reverseGeoCode(geoCoordinates: location);
final sorted = await api.getAddressFromGeoCoordinates(searchedLocation!);
final sortedList = await api.getAddressListFromGeoCoordinates(searchedLocation);
print(location);
}