</pre><pre>

Your UIAnnotationView is
always drawn at the same scale, the map's zoom level doesn't matter. That's why centerOffset isn't
bound with the zoom level.

annView.centerOffset is
what you need. If you see that your pin is not at the good location (for example, the bottom center move a little when you change the zoom level), it's because you didn't set the right centerOffset.

By the way, if you want to set the point of the coordinate at the bottom center of the image, the x coordinate of your centerOffset should be 0.0f, as annotationView center the image by default. So try :

annView.centerOffset = CGPointMake(0, -imageHeight / 2);

或是

Setting the centerOffset often moves the image arround when user rotates or zooms the map, as anchor point is still set to the center of the image instead of its lower center.

You can set the anchor point of the annotation to the bottom center of you custom image as follows:

yourAnnotation.layer.anchorPoint = CGPointMake(0.5f, 1.0f);

This way when user zooms or rotates the map your custom annotation will never move from its coordinates on the map.

http://stackoverflow.com/questions/8165262/mkannotation-image-offset-with-custom-pin-image

MKAnnotation image offset with custom pin image的更多相关文章

  1. Android系统匿名共享内存Ashmem(Anonymous Shared Memory)驱动程序源代码分析

    文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6664554 在上一文章Android系统匿名共 ...

  2. ORM数据库框架 greenDAO SQLite MD

    Markdown版本笔记 我的GitHub首页 我的博客 我的微信 我的邮箱 MyAndroidBlogs baiqiantao baiqiantao bqt20094 baiqiantao@sina ...

  3. M451 PWM对照数据手册分析

    PWM_T Struct Reference Control Register » Pulse Width Modulation Controller(PWM)   typedef struct { ...

  4. 说说M451例程之PWM的寄存器讲解

    M451提供了两路PWM发生器.每路PWM支持6通道PWM输出或输入捕捉.有一个12位的预分频器把时钟源分频后输入给16位的计数器,另外还有一个16位的比较器.PWM计数器支持向上,向下,上下计数方式 ...

  5. Bing必应地图中国API-画线与添加多边形

    Bing必应地图中国API-画线与添加多边形 2011-05-24 14:31:20|  分类: Bing&Google|字号 订阅     在必应地图上画线的功能应用也很广泛:显示从出发地到 ...

  6. JTAG 引脚自动识别 JTAG Finder, JTAG Pinout Tool, JTAG Pin Finder, JTAG pinout detector, JTAGULATOR, Easy-JTAG, JTAG Enumeration

    JTAG Finder Figuring out the JTAG Pinouts on a Device is usually the most time-consuming and frustra ...

  7. (转) Unreal Engine 4 Custom Shaders Tutorial

    说明: 1.这里的Custom Shaders 为且仅为 Custom Node的使用和USF的包含.并非全局Shader和Material Shader. 2.原文来源:https://www.ra ...

  8. [UE4] Adding a custom shading model

    转自:https://blog.felixkate.net/2016/05/22/adding-a-custom-shading-model-1/ This was written in Februa ...

  9. 一个美术需求引发的Custom Inspector

    需求 Editor模式下,在运行或者非运行状态下,能够按照指定的变化率来自动改变material中属性数值. 需求分析 如何在Editor模式下获得一个游戏对象及其组件,尤其是在非运行状态下?我们知道 ...

随机推荐

  1. instanceof关键字 与 getClass()

    在equals()中使用getClass进行类型判断 我们在覆写equals()方法时,一般都是推荐使用getClass来进行类型判断,不是使用instanceof.我们都清楚instanceof的作 ...

  2. ActiveMQ入门系列一:认识并安装ActiveMQ(Windows下)

    一.什么是ActiveMQ 度娘给出的定义: Apache ActiveMQ是Apache软件基金会所研发的开放源代码消息中间件:由于ActiveMQ是一个纯Java程序,因此只需要操作系统支持Jav ...

  3. MUI 结合layui实现分页

    mui自带有分页,在ui上我还是认为layui的友好点. 第三方插件: template-web.js-----------------前端数据绑定 layui.js.layui.css------- ...

  4. 禁止Steam VR随着虚幻4自动启动

    1.禁止启动UE4的时候启动修改这个文件Program Files\Epic Games\XXXX\Engine\Plugins\Runtime\Steam\SteamVR\SteamVR.uplug ...

  5. 什么是TCP/IP协议和举例

    一张图+说明,彻底理解TCP/IP协议是个什么玩意儿! 相关图片:https://www.cnblogs.com/andy9468/p/10096606.html 说明:1.应用层常见协议或命令:HT ...

  6. 【Struts2】拦截器

    一.概述 二.在Struts2中使用拦截器 2.1 步骤 2.2 分析拦截器原理 2.3 关于interceptor与Filter区别: 三.案例 一.概述 介绍拦截器: struts2拦截器使用的是 ...

  7. 【Struts2】简介及入门

    一.概述 二.Struts2 快速入门程序 2.1 开发流程比较 2.2 引入依赖 2.2 创建jsp页面 2.3 在web.xml中配置前端控制器 2.4 创建struts.xml配置文件 2.4 ...

  8. CentOS7 解决不能切换中英文输入法的问题

    1. 运行 im-chooser(如果没有要先安装) $ im-chooser 2. 在打开的窗口选择 iBus,然后 Logout 再 Login, 输入法即可切换.

  9. okhttp缓存策略源码分析:put&get方法

    对于OkHttp的缓存策略其实就是在下一次请求的时候能节省更加的时间,从而可以更快的展示出数据,那在Okhttp如何使用缓存呢?其实很简单,如下: 配置一个Cache既可,其中接收两个参数:一个是缓存 ...

  10. 学习elasticsearch(一)linux环境搭建(2)——启动elasticsearch

    在启动访问es的过程中遇到了各种的奇葩问题. 1.网上各种版本的启动方式让人眼花缭乱不知如何启动.简单粗暴——到es的bin目录下直接 执行 ./elasticsearch //显示启动,ctrl+c ...