JXMapData.m 835 B

12345678910111213141516171819202122232425262728293031
  1. //
  2. // JXMapData.m
  3. // CustomMKAnnotationView
  4. //
  5. // Created by JianYe on 14-2-8.
  6. // Copyright (c) 2014年 Jian-Ye. All rights reserved.
  7. //
  8. #import "JXMapData.h"
  9. @implementation JXMapData
  10. - (id)initWithDictionary:(NSDictionary *)dictionary
  11. {
  12. self = [super init];
  13. if (self) {
  14. self.latitude = [dictionary objectForKey:@"latitude"];
  15. self.longitude = [dictionary objectForKey:@"longitude"];
  16. self.title = [dictionary objectForKey:@"title"];
  17. self.subtitle = [dictionary objectForKey:@"subtitle"];
  18. // self.imageUrl = ;
  19. }
  20. return self;
  21. }
  22. -(CLLocationCoordinate2D)coordinate2D{
  23. double latitude = [self.latitude doubleValue];
  24. double longitude = [self.longitude doubleValue];
  25. CLLocationCoordinate2D coor = (CLLocationCoordinate2D){latitude,longitude};
  26. return coor;
  27. }
  28. @end