Home > Mobile >  Information about amap_base_flutter integration version of an error
Information about amap_base_flutter integration version of an error

Time:10-03

Is mainly about... \ flutter \. Pub - cache \ hosted \ pub flutter - IO. Cn \ amap_base - 0.3.5 \ android \ SRC \ main \ kotlin \ me \ yohom \ amapbase \ m \ apMapHandler kt error
Need to modify its source code:
The object OpenOfflineManager: MapMethodHandler {

Override fun with (map: AMap) : MapMethodHandler {
Return this
}
Override fun onMethodCall (methodCall: methodCall, methodResult: MethodChannel. Result) {
}
/* override fun onMethodCall (p0: MethodCall? P1: MethodChannel. The Result?) {
AMapBasePlugin. The registrar. The activity (). StartActivity (
Intent (AMapBasePlugin. The registrar. The activity (),
OfflineMapActivity: : class. Java)
)
} */
}
And... Flutter \. Pub - cache \ hosted \ pub flutter - IO. Cn \ amap_base - 0.3.5 \ android \ SRC \ main \ kotlin \ me \ yohom \ amapbase \ search \ SearchHandlers kt
Also need to modify the source code:
The object DistanceSearchHandler: SearchMethodHandler {
Override fun onMethodCall (call: MethodCall, result: MethodChannel. Result) {
/* val search=DistanceSearch (AMapBasePlugin. The registrar. The context ())
Search. SetDistanceSearchListener {
DistanceResult, I - & gt; Search. SetDistanceSearchListener (null)
If (I==1000) {
Val list=distanceResult. DistanceResults. Map {
It. Short. ToInt ()
}
result? . Success (list)
} else {
result? The error (" measuring failure code==& gt; $I ", null, null)
}
}

Val origins=call. Argument> (" origin ")!!!!!
Val target=call. Argument (" target ")!!!!!
Val type=call. Argument (" type ")!!!!!

Search. CalculateRouteDistanceAsyn (DistanceSearch. DistanceQuery (). The apply {
This. Origins=origins. The map {
It. ToLatlng (.) toLatLonPoint ()
}. ToMutableList ()
This. Destination=target. ToLatlng () toLatLonPoint ()
Enclosing type=type
}) */
}

Fun Map ToLatlng () : LatLng {
Val lat=this [" latitude "] as Double
Val LNG=this [" longitude "] as Double
Return LatLng (lat and LNG)
}
}
  • Related