AMapCameraPosition.m 774 B

123456789101112131415161718192021
  1. #import "AMapCameraPosition.h"
  2. #import "AMapConvertUtil.h"
  3. @implementation AMapCameraPosition
  4. - (NSDictionary *)toDictionary {
  5. NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:4];
  6. [dict setObject:@(self.bearing) forKey:@"bearing"];
  7. [dict setObject:@(self.tilt) forKey:@"tilt"];
  8. [dict setObject:@(self.zoom) forKey:@"zoom"];
  9. if (CLLocationCoordinate2DIsValid(self.target)) {
  10. [dict setObject:[AMapConvertUtil jsonArrayFromCoordinate:self.target] forKey:@"target"];
  11. }
  12. return [dict copy];
  13. }
  14. - (NSString *)description {
  15. return [NSString stringWithFormat:@"CameraPosition(bearing:%.6f, target:%@, tilt:%.6f, zoom:%.6f)",self.bearing,[AMapConvertUtil stringFromCoordinate:self.target],self.tilt,self.zoom];
  16. }
  17. @end