Automatic labels in Leaflet

GND
1247663299
VIAF
35152079190307112640
ORCID
0000-0002-8639-2812
Affiliation
Institute of Cartography and Geoinformatics, ELTE Eötvös Loránd University, Budapest, Hungary
Gede, Matyas

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.

Cite

Citation style:
Could not load citation form.

Access Statistic

Total:
Downloads:
Abtractviews:
Last 12 Month:
Downloads:
Abtractviews:

Rights

Use and reproduction: