kb0 / maps_toolkit

Dart library for area, distance, heading measurements
Apache License 2.0
46 stars 17 forks source link

can't be assigned to the parameter type latlong2 package #17

Closed salehzarei closed 2 years ago

salehzarei commented 2 years ago

i have this problem when use SphericalUtil.computeArea :

The argument type 'List (where LatLng is defined in ...\flutter.pub-cache\hosted\pub.dartlang.org\latlong2-0.8.1\lib\latlong\LatLng.dart)' can't be assigned to the parameter type 'List (where LatLng is defined in ...\flutter.pub-cache\hosted\pub.dartlang.org\maps_toolkit-2.0.0\lib\src\latlng.dart)

Is there a solution to using both types of latlang ?

kb0 commented 2 years ago

You can try to import with alias, i.e.:

import 'package:maps_toolkit/maps_toolkit.dart' as mp;

void main() {
  final pointFromToolkit = mp.LatLng(90, 0);
  mp.SphericalUtil.computeAngleBetween(pointFromToolkit, pointFromToolkit);
}