<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "https://jats.nlm.nih.gov/nlm-dtd/publishing/3.0/journalpublishing3.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article" dtd-version="3.0" xml:lang="en">
<front>
<journal-meta>
<journal-id journal-id-type="publisher">ICA-Proc</journal-id>
<journal-title-group>
<journal-title>Proceedings of the ICA</journal-title>
<abbrev-journal-title abbrev-type="publisher">ICA-Proc</abbrev-journal-title>
<abbrev-journal-title abbrev-type="nlm-ta">Proc. Int. Cartogr. Assoc.</abbrev-journal-title>
</journal-title-group>
<issn pub-type="epub">2570-2092</issn>
<publisher><publisher-name>Copernicus Publications</publisher-name>
<publisher-loc>Göttingen, Germany</publisher-loc>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.5194/ica-proc-7-2-2025</article-id>
<title-group>
<article-title>Auto-generalized labels on multi-layer Leaflet maps</article-title>
</title-group>
<contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Gede</surname>
<given-names>Mátyás</given-names>
<ext-link>https://orcid.org/0000-0002-8639-2812</ext-link>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
</contrib>
</contrib-group><aff id="aff1">
<label>1</label>
<addr-line>Institute of Cartography and Geoinformatics, ELTE Eötvös Loránd University, Budapest, Hungary</addr-line>
</aff>
<pub-date pub-type="epub">
<day>21</day>
<month>10</month>
<year>2025</year>
</pub-date>
<volume>7</volume>
<elocation-id>2</elocation-id>
<permissions>
<copyright-statement>Copyright: &#x000a9; 2025 Mátyás Gede</copyright-statement>
<copyright-year>2025</copyright-year>
<license license-type="open-access">
<license-p>This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this licence, visit <ext-link ext-link-type="uri"  xlink:href="https://creativecommons.org/licenses/by/4.0/">https://creativecommons.org/licenses/by/4.0/</ext-link></license-p>
</license>
</permissions>
<self-uri xlink:href="https://ica-proc.copernicus.org/articles/7/2/2025/ica-proc-7-2-2025.html">This article is available from https://ica-proc.copernicus.org/articles/7/2/2025/ica-proc-7-2-2025.html</self-uri>
<self-uri xlink:href="https://ica-proc.copernicus.org/articles/7/2/2025/ica-proc-7-2-2025.pdf">The full text article is available as a PDF file from https://ica-proc.copernicus.org/articles/7/2/2025/ica-proc-7-2-2025.pdf</self-uri>
<abstract>
<p>Leaflet is one of the most popular client-side web mapping libraries. It is lightweight, easy-to-use, especially for ones without strong programming background. The library, however, lacks a very important feature: map labels.&lt;/p&gt;
&lt;p&gt;The author developed a plugin for Leaflet that makes it easy to show map labels for any vector layer. Labels are automatically generalized to avoid overlapping texts. Point symbols or markers can be linked to their labels i.e. if the label cannot be displayed, its marker is also removed. Labels are drawn in priority order. Priorities, as well as label texts and styles can be highly customized with respect to feature/layer properties.&lt;/p&gt;
&lt;p&gt;Labels are displayed as HTML &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; elements, allowing developers to create complex labels with various borders or backgrounds as well, by CSS styling rules.&lt;/p&gt;
&lt;p&gt;The plugin extends the Map class, while label properties can be set for each layer separately. Collision conflicts are checked between layers as well. Dynamic addition/removal of map objects is also supported. Performance of the plugin was tested with 3700 map objects (mixed data of points, polygons, and lines). Updating map labels after zoom/pan required only fragments of seconds.&lt;/p&gt;
&lt;p&gt;The source code, user guide and examples are available at &lt;code&gt;https://github.com/samanbey/leaflet-mapwithlabels&lt;/code&gt;</p>
</abstract>
<counts><page-count count="5"/></counts>
</article-meta>
</front>
<body/>
<back>
</back>
</article>