有没有办法在MKMapView的名称下绘制? [英] Is there a way to draw under names in MKMapView?

查看:97
本文介绍了有没有办法在MKMapView的名称下绘制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看过许多关于如何在MKMapView上绘制路线的细线,但在此上什么也没看到.

I've looked at the many fine threads on how to draw routes on an MKMapView and didn't see anything on this.

我希望能够在地图地形上但在道路名称和数字等下绘制信息(例如路线的交通流图像,可能是注释).

I want to be able to draw information (e.g. traffic flow imagery for routes, possibly annotations) over the map terrain but under road names and numbers etc.

由于地图/道路名称未在mapkit中显示为单独的图层,因此似乎无法执行此操作?

It seems likely that there's no way to do this since the map / road names aren't exposed as separate layers in the mapkit?

听起来确实可以在道路名称下绘制 route ,但这是因为我可以使用Apple的API,并且大概是Apple在订单名称> route> map data中放置信息.当我使用这种方法时,它们发送回给我的磁贴...

It does sound like I could draw a route under road names but that's because I can use Apple's API for that and presumably Apple is laying down the information in the order names > route > map data in the tiles that they send back to me when I use that approach...

即使只是听说这无法做到,也很高兴知道!

Even just hearing that this can't be done would be good to know!

而且,大概也不能用Google地图做到吗?

And, presumably it can't be done with google maps either?

提前谢谢!

ETA

推荐答案

我很确定无法更改绘制顺序.总是在地图图块的顶部绘制覆盖图.但是,您可以在叠加层中使用Alpha,以免混淆道路名称.也许还可以找到一种混合模式,使其看起来好像您的信息在名称之下,尽管经过短暂的尝试之后,我并未发现有那么大的作用.我认为叠加层会渲染到单独的位图(出于性能原因),然后在地图图块上绘制,这样可能会影响混合模式的工作方式. (我读过另一篇文章,因为这表明混合模式不适用于叠加层.)

I'm pretty sure it isn't possible to change the draw order. Overlays are always drawn on top of the map tiles. You can however use alpha in your overlay so as not to obscure the road names. It might also be possible to find a blend mode that makes it appear as though your information is below the name although after a short play with these I didn't find a mode that had that much effect. I think that the overlays are rendered to a separate bitmap (for performance reasons) and then drawn over the map tiles so that might affect how blend modes work. ( I've read another post since that suggests that blend modes don't work with overlays).

这篇关于有没有办法在MKMapView的名称下绘制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆