简体   繁体   English

在Mapbox iOS中的标记下添加文本

[英]Add text under markers in mapbox ios

I'm using Mapbox SDK in my iOS app (using Swift). 我在iOS应用程序中使用Mapbox SDK(使用Swift)。 I want a label to show under every marker like this: 我希望标签显示在这样的每个标记下:

在此处输入图片说明

I couldn't find anywhere in the docs or on stackoverflow how I can achieve that. 我在文档中或stackoverflow上都找不到如何实现该目标的方法。 I tried to make the text a part of the marker image, but the text does not resize itself that way and things are a mess when markers are close (or when you zoom out). 我试图使文本成为标记图像的一部分,但是文本不会以这种方式调整自身大小,并且当标记关闭(或缩小)时,事情变得一团糟。

Does anybody know how I can make that happen? 有人知道我该怎么做吗?

Right now, you'll want to do this at the GL style level using Mapbox Studio — not as dynamic annotations. 现在,您将要使用Mapbox Studio 在GL样式级别执行此操作, 不是将其用作动态注释。

Doing it in the style allows labels to be recalculated and customized based on the surrounding data and map state, whereas annotations currently aren't as customizable. 以这种样式进行操作可以根据周围的数据和地图状态重新计算和自定义标签,而注释当前不那么可自定义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM