receiveLocation static method

dynamic receiveLocation(
  1. double lat,
  2. double lng,
  3. double speed,
  4. double course,
  5. double altitude,
)

Implementation

static receiveLocation(double lat,double lng,double speed,double course,double altitude) {
    if(pocChangeNotifier.isOnline){
      Log.i(tag,"setLocation");

      bool hasLocationPrivilege=(pocChangeNotifier.privilege&Constant.Privilege_Location)>0;
      Log.i(tag,"setLocation:hasLocationPrivilege:$hasLocationPrivilege");
      if(!hasLocationPrivilege){
         return;
      }

      if(speed>0){
        speed=speed * 3.6;// 米每秒转为千米每小时
      }

      String location = "lat:$lat;lng:$lng;direction:$course;speed:$speed;elevation:$altitude;";
      SetLocation(location);

      pocChangeNotifier.setLocation(location);
    }
}