- (void)clickLongPress:(UILongPressGestureRecognizer *)longPress {

CGPoint point = [longPress locationInView:mapView];

CLLocationCoordinate2D coord = [mapView convertPoint:point toCoordinateFromView:mapView];

CLLocation *location = [[CLLocation alloc] initWithLatitude:coord.latitude longitude:coord.longitude];

MKPointAnnotation *annocation = [[MKPointAnnotation alloc] init];

annocation.coordinate = coord;

annocation.title = @"我的锚点";

[mapView addAnnotation:annocation];

}

//代理方法   签协议

    MKMapViewDelegate

-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation{

static NSString *annoid = @"str";

MKAnnotationView *annoView = [mapView dequeueReusableAnnotationViewWithIdentifier:annoid];

if (!annoView) {

annoView = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:annoid];

}

annoView.image = [UIImage imageNamed:@"1"];

return annoView;

}

iosiOS 地图 自定义以及添加锚点的更多相关文章

  1. Android高德地图自定义Markers的例子

    下文为各位重点介绍关于Android高德地图自定义Markers的例子,希望这篇文章能够让各位理解到Android高德地图自定义Markers的方法. 之前的博客里说了地图的嵌入和定位,今天就说说在地 ...

  2. Swift之高德地图自定义标注弹出气泡样式

    在用到地图类的sdk,sdk自带的样式必定不能满足开发者的需求,于是开发者不得不进行自定义,由于官方同样是object-c 版语法,不得不将其转为swift语法,以满足项目需求. 新建两个类 Cust ...

  3. ueditor富文本编辑器使用百度地图自定义动态地图组件及兼容https及http协议

    ueditor富文本编辑器默认支持百度地图组件,但是如果导入动态地图后会加很多默认的地图组件在上面.如果需要自定义动态地图的组件则需要修改ueditor特定的html. ueditor百度地图组件所在 ...

  4. 百度地图自定义icon,定位偏移问题

    最近使用百度地图做一个调度系统,使用定义icon的marker,结果地图显示marker和实际位置偏移,最终参考文章: http://www.cnblogs.com/jz1108/archive/20 ...

  5. 【Android】百度地图自定义弹出窗口

    我们使用百度地图的时候,点击地图上的Marker,会弹出一个该地点详细信息的窗口,如下左图所示,有时候,我们希望自己定义这个弹出窗口的内容,或者,干脆用自己的数据来构造这样的弹出窗口,但是,在百度地图 ...

  6. 百度地图自定义Marker

    最近写了百度地图的Demo,所以总结下遇到的问题: 1.首先在百度地图中创建应用时用到 发布版SHA1是在Preferences下的Android下的Build中;2.在使用百度地图时,先要创建一个A ...

  7. iOS高德地图自定义annotation添加不同图片

    1.model类里面添加index #import <MAMapKit/MAMapKit.h> #import <AMapSearchKit/AMapCommonObj.h> ...

  8. echarts地图自定义任意区域

    这里可以直接在地图上框选区域,右侧会自动生成geojson

  9. 谷歌地图自定义popup框

    谷歌地图的infowindow 不提供官方的定制化 <!DOCTYPE html> <html> <head> <meta name="viewpo ...

随机推荐

  1. 2. hdfs

    一.Hdfs的shell 所有hadoop的fs的shell均用uri路径作为参数 uri格式:schema://authority/path.hdfs的schema是hdfs.其中,schema和a ...

  2. HelloHibernate详解

    1. Configuration管理读取配置文件 //读取src下hibernate.properties,不推荐使用 Configuration cfg = new Configuration(); ...

  3. smartgit document merge

    'Normal' Merge In case of a normal merge, a merge commit with at least two parent commits (i.e., the ...

  4. ADF_Starting系列4_使用ADF开发富Web应用程序之维护User Interface(Part1)

    2014-05-04 Created By BaoXinjian

  5. NeHe OpenGL教程 第四十二课:多重视口

    转自[翻译]NeHe OpenGL 教程 前言 声明,此 NeHe OpenGL教程系列文章由51博客yarin翻译(2010-08-19),本博客为转载并稍加整理与修改.对NeHe的OpenGL管线 ...

  6. python 解析json

    一.概念 序列化(Serialization):将对象的状态信息转换为可以存储或可以通过网络传输的过程,传输的格式可以是JSON.XML等.反序列化就是从存储区域(JSON,XML)读取反序列化对象的 ...

  7. 停止某个机房所有机器上包的脚本 pack_idc_stop.py

    一.初衷: 鉴于公司的进程包package都是冗余多点部署的,一般一个idc机房有多台机器部署同一个package.当机房网络出问题的时候,我们不得不查到本机房部署了哪些package,并在包发布系统 ...

  8. git config(转载)

    From:http://www.g2w.me/2013/10/cache-github-credential-for-https-repository/ http://openwares.net/li ...

  9. Task.Run Vs Task.Factory.StartNew z

    在.Net 4中,Task.Factory.StartNew是启动一个新Task的首选方法.它有很多重载方法,使它在具体使用当中可以非常灵活,通过设置可选参数,可以传递任意状态,取消任务继续执行,甚至 ...

  10. linux下安装nginx、pcre、zlib、openssl

    1.安装nginx之前需要安装PCRE库的安装  最新下载地址   ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ tar –zxvf p ...