AMapLocation.m 636 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // AMapLocation.m
  3. // amap_flutter_map
  4. //
  5. // Created by lly on 2020/11/12.
  6. //
  7. #import "AMapLocation.h"
  8. @implementation AMapLocation
  9. - (instancetype)init {
  10. self = [super init];
  11. if (self) {
  12. self.provider = @"iOS";
  13. }
  14. return self;
  15. }
  16. - (void)updateWithUserLocation:(CLLocation *)location {
  17. if (location == nil) {
  18. return;
  19. }
  20. self.latLng = location.coordinate;
  21. self.accuracy = location.horizontalAccuracy;
  22. self.altitude = location.altitude;
  23. self.bearing = location.course;
  24. self.speed = location.speed;
  25. self.time = [location.timestamp timeIntervalSince1970]*1000;
  26. }
  27. @end