自定义大头针

//
// MyAnnotation.h
// AllCloud
//
// Created by 韩旭 on 2017/8/30.
// Copyright © 2017年 韩旭. All rights reserved.
//

import <Foundation/Foundation.h>

import "AllCloudHeadFile.h"

@interface MyAnnotation : NSObject<MAAnnotation>
@property (nonatomic,assign) CLLocationCoordinate2D coordinate;

@property (nonatomic,copy) NSString name;
@property (nonatomic,copy) NSString title;
/
属性 - 图 -- 显示 /
@property (nonatomic, copy) NSString image;
/
属性 - type /
@property (nonatomic, copy) NSString type;
/
属性 - dic */
@property (nonatomic, copy) NSDictionary *detailDic;

@property (nonatomic , copy) NSString *distance;
@property (nonatomic , copy) NSString *shop_briberymoney_code;
@property (nonatomic , copy) NSString *shop_introduction;
@property (nonatomic , copy) NSString *shop_user_id;
@property (nonatomic , copy) NSString *shop_map_type;
@property (nonatomic , copy) NSString *shop_map_lat;
@property (nonatomic , copy) NSString *shop_map_lng;
@property (nonatomic , copy) NSString *shop_head_url;
@property (nonatomic , copy) NSString *shop_name;

  • (instancetype)initWithAnnotationModelWithDict:(NSDictionary *)dict;
    @end

//
// MyAnnotation.m
// AllCloud
//
// Created by 韩旭 on 2017/8/30.
// Copyright © 2017年 韩旭. All rights reserved.
//

import "MyAnnotation.h"

@implementation MyAnnotation

  • (instancetype)initWithAnnotationModelWithDict:(NSDictionary *)dict {
    self = [super init];
    if (self) {
    // self.coordinate = CLLocationCoordinate2DMake([dict[@"coordinate"][@"lat"] doubleValue], [dict[@"coordinate"][@"lon"] doubleValue]);
    self.coordinate = CLLocationCoordinate2DMake([dict[@"shop_map_lat"] doubleValue], [dict[@"shop_map_lng"] doubleValue]);
    NSLog(@"%f", self.coordinate.latitude);

      self.image = dict[@"image"];
      self.type = dict[@"type"];
      self.detailDic = dict[@"detailDic"];
      self.distance = dict[@"distance"];
      self.shop_briberymoney_code = dict[@"shop_briberymoney_code"];
      self.shop_introduction = dict[@"shop_introduction"];
      self.shop_user_id = dict[@"shop_user_id"];
      self.shop_map_type = dict[@"shop_map_type"];
      self.shop_map_lat = dict[@"shop_map_lat"];
      self.shop_map_lng = dict[@"shop_map_lng"];
      self.shop_head_url = dict[@"shop_head_url"];
      self.shop_name = dict[@"shop_name"];
    

    }
    return self;
    }
    @end

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容