Closed nani-samireddy closed 4 years ago
Yes, you cannot use Google Maps LatLng directly. You should convert Google Maps LatLng into Maps Toolkit LatLng, for ex.:
import 'package:maps_toolkit/maps_toolkit.dart' as mp;
import 'package:google_maps/google_maps.dart';
import 'package:test/test.dart';
void main() {
final pointFromGoogleMap = LatLng(90, 0);
final pointMp = mp.LatLng(pointFromGoogleMap.lat, pointFromGoogleMap.lng);
bool result = mp.PolygonUtil.containsLocation(pointMp, TOTAL_COVERAGE, false);
}
Yes I've solved it in the same way. Now I want to know that have you ever used Google s2 geometry .. If yes please reply 🥺🥺🥺
No. Never use S2 geometry
Do you know how to implement that...
I have a list: List
I'm developing an application in which i have check the user selected point is inside a polygon or not!!.. Then I created a polygon and took a point for the map selected by the user. now I would like to use map_toolkit to check whether the given point is inside a polygon or not. When I trying to pass the User selected LatLng as the parameter to the function PolygonUtil.containsLocation()...
bool rsult = maps_toolkit.PolygonUtil.containsLocation(point, TOTAL_COVERAGE, false);
point is a LatLng value that s taken from the google maps flutter. it is giving an error when I hover it as follows
LatLng point The argument type 'LatLng (where LatLng is defined in C:\Users\NANI\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\google_maps_flutter_platform_interface-1.0.4\lib\src\types\location.dart)' can't be assigned to the parameter type 'LatLng (where LatLng is defined in C:\Users\NANI\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\maps_toolkit-1.1.0+2\lib\src\latlng.dart)'.dartargument_type_not_assignable location.dart(10, 7): LatLng is defined in C:\Users\NANI\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\google_maps_flutter_platform_interface-1.0.4\lib\src\types\location.dart latlng.dart(1, 7): LatLng is defined in C:\Users\NANI\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\maps_toolkit-1.1.0+2\lib\src\latlng.dart