- (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. MVC controller and View

    actionresult,jsonresult redirectresult partialview, viewdata, tempdata filter viewdata,只能在当前action中有 ...

  2. FlashBuilder(FB/eclipse) 打开多个无效

    FB也即Eclipse. 想要打开多个FB,只需要新建多个FB的快捷方式,然后在路径上面加上参数 -data "具体路径" 再打开即可. 如: "C:\Program F ...

  3. MFC的类层次结构图

  4. Number of Islands

    Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surro ...

  5. Jquery插件收藏

    1.带小图标的多级菜单导航 演示地址:http://js.itivy.com/memu/sample.html 下载地址:http://js.itivy.com/?p=100 效果图:  推荐一个自己 ...

  6. Linux内核学习之路

    每当学习到一定阶段自己觉得还行时,就会搜一些别人的文章. 这篇文章是原作者14年3月写的.转过来与自己共勉.学习累了就换着学也挺好 原文: 现在回首看看,接触Linux已经很长时间了. 在大三的时候开 ...

  7. C++学习13 类class和结构体struct的区别

    C++保留了C语言的 struct,并且加以扩充.在C语言中,struct 只能包含数据成员,不能包含成员函数.而在C++中,struct 类似于 class,既可以包含数据成员,又可以包含成员函数. ...

  8. Go Mobile 例子 basic 源码分析

    OpenGL ES(OpenGL for Embedded Systems)是 OpenGL 三维图形API的子集,针对手机.PDA和游戏主机等嵌入式设备而设计.该API由Khronos集团定义推广, ...

  9. [kuangbin带你飞]专题十 匹配问题

        A-L 二分匹配 M-O 二分图多重匹配 P-Q 二分图最大权匹配 R-S 一般图匹配带花树 模板请自己找     ID Origin Title   61 / 72 Problem A HD ...

  10. poj 1018 Communication System

    点击打开链接 Communication System Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 21007   Acc ...