AMapConvertUtil.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // AMapConvertUtil.h
  3. // amap_flutter_map
  4. //
  5. // Created by lly on 2020/10/30.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import <CoreLocation/CoreLocation.h>
  9. #import <Flutter/Flutter.h>
  10. #import <MAMapKit/MAMapKit.h>
  11. NS_ASSUME_NONNULL_BEGIN
  12. @class MATouchPoi;
  13. @interface AMapConvertUtil : NSObject
  14. /// 经纬度坐标转字符串
  15. /// @param coordinate 经纬度坐标
  16. + (NSString *)stringFromCoordinate:(CLLocationCoordinate2D)coordinate;
  17. /// 颜色的色值解析(色值必须为json中的number类型)
  18. /// @param numberColor 色值
  19. + (UIColor*)colorFromNumber:(NSNumber*)numberColor;
  20. /// 将数组(内含数字)转换为point坐标,(默认数组第一个元素为x值,第二个为y值)
  21. /// @param data 数组
  22. + (CGPoint)pointFromArray:(NSArray*)data;
  23. /// 从数据中解析经纬度
  24. /// @param array 经纬度数组对(默认第一个当做维度,第二个当做经度)
  25. + (CLLocationCoordinate2D)coordinateFromArray:(NSArray *)array;
  26. /// 经纬度转json数组
  27. /// @param coord 经纬度
  28. + (NSArray *)jsonFromCoordinate:(CLLocationCoordinate2D )coord;
  29. /// 经纬度转json数组
  30. /// @param coordinate 经纬度
  31. + (NSArray<NSNumber *> *)jsonArrayFromCoordinate:(CLLocationCoordinate2D)coordinate;
  32. + (UIImage*)imageFromRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar iconData:(NSArray*)iconData;
  33. /// 检测图标相关的描述,是否修改过
  34. /// @param previousIcon 之前的图标
  35. /// @param currentIcon 当前新的图标
  36. /// @return 修改了,则返回yes,否则返回NO
  37. + (BOOL)checkIconDescriptionChangedFrom:(NSArray *)previousIcon to:(NSArray *)currentIcon;
  38. /// 经纬度坐标比较
  39. /// @param coord1 坐标1
  40. /// @param coord2 坐标2
  41. + (BOOL)isEqualWith:(CLLocationCoordinate2D)coord1 to:(CLLocationCoordinate2D)coord2;
  42. /// TouchPOI转字典
  43. /// @param poi 点击POI
  44. + (NSDictionary *)dictFromTouchPOI:(MATouchPoi *)poi;
  45. /// 解析得到mapRect结构
  46. /// @param array json数组[southwest,northeast],分别为西南、东北的坐标
  47. + (MAMapRect)mapRectFromArray:(NSArray *)array;
  48. @end
  49. NS_ASSUME_NONNULL_END