Automatic Labels in Leaflet

M. Gede
{"title":"Automatic Labels in Leaflet","authors":"M. Gede","doi":"10.5194/ica-adv-4-8-2023","DOIUrl":null,"url":null,"abstract":"Abstract. Automatic labelling is a lacking feature in the popular client-side web mapping library, Leaflet. Although there exist various workarounds and substitutes, most of these do not fulfil the basic cartographic rules, e.g. avoiding text overlaps.This paper discusses the various workarounds addressing this problem, and introduces the author’s solution, which extends Leaflet’s GeoJSON class with automatic labelling functionality. The new class displays labels for point, line or polygon features. Labels can be placed either on right or left side of points or automatically for better fitting. Markers for points are only displayed if their labels can be drawn without overlaps. Label text is specified either by property field name or a user-specified function. It is also possible to specify priority order of features (higher priority labels are drawn first) and to customize label styles.\n","PeriodicalId":324347,"journal":{"name":"Advances in Cartography and GIScience of the ICA","volume":"4 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2023-08-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Advances in Cartography and GIScience of the ICA","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.5194/ica-adv-4-8-2023","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Abstract. Automatic labelling is a lacking feature in the popular client-side web mapping library, Leaflet. Although there exist various workarounds and substitutes, most of these do not fulfil the basic cartographic rules, e.g. avoiding text overlaps.This paper discusses the various workarounds addressing this problem, and introduces the author’s solution, which extends Leaflet’s GeoJSON class with automatic labelling functionality. The new class displays labels for point, line or polygon features. Labels can be placed either on right or left side of points or automatically for better fitting. Markers for points are only displayed if their labels can be drawn without overlaps. Label text is specified either by property field name or a user-specified function. It is also possible to specify priority order of features (higher priority labels are drawn first) and to customize label styles.
单张自动标签
摘要自动标签是流行的客户端web映射库中缺乏的功能。虽然存在各种变通方法和替代方法,但其中大多数都不符合基本的制图规则,例如避免文本重叠。本文讨论了解决此问题的各种解决方案,并介绍了作者的解决方案,该解决方案扩展了具有自动标签功能的传单GeoJSON类。新类显示点、线或多边形特征的标签。标签可以放置在点的右侧或左侧,也可以自动放置,以便更好地拟合。点的标记只有在它们的标签没有重叠的情况下才会显示。标签文本由属性字段名或用户指定的函数指定。还可以指定特性的优先顺序(优先绘制更高优先级的标签)并自定义标签样式。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书