All Projects → yakitoritabetai → Leaflet.labeltextcollision

yakitoritabetai / Leaflet.labeltextcollision

Licence: mit
Leaflet.LabelTextCollision is a LeafletJS plug-in to display labels on vector data while avoiding label collisions.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Leaflet.labeltextcollision

Leaflet.markercluster
Marker Clustering plugin for Leaflet
Stars: ✭ 3,305 (+4984.62%)
Mutual labels:  mapping, map, leaflet
Iclient Javascript
Modern GIS Web Client for JavaScript, based on Leaflet\OpenLayers\MapboxGL-JS\Classic(iClient8C), enhanced with ECharts\D3\MapV etc. Contributed by SuperMap & community.
Stars: ✭ 593 (+812.31%)
Mutual labels:  mapping, map, leaflet
coronavirus-map-dashboard
🦠 Coronavirus (COVID-19) Map Dashboard using coronavirus-tracker-api
Stars: ✭ 41 (-36.92%)
Mutual labels:  map, mapping, leaflet
mapr
Map species occurrence data
Stars: ✭ 34 (-47.69%)
Mutual labels:  map, mapping, leaflet
Offlinemap
基于MySQL + Node.js + Leaflet的离线地图展示,支持百度、谷歌、高德、腾讯地图
Stars: ✭ 343 (+427.69%)
Mutual labels:  map, leaflet
Leaflet-active-area
A Leaflet plugin to center the map not in the center of the map but inside a DIV. Useful for responsive design.
Stars: ✭ 99 (+52.31%)
Mutual labels:  map, leaflet
React Leaflet
React components for Leaflet maps
Stars: ✭ 3,939 (+5960%)
Mutual labels:  map, leaflet
Leaflet.easybutton
leaflet control buttons with icons and callbacks
Stars: ✭ 408 (+527.69%)
Mutual labels:  map, leaflet
Mapsui
Mapsui is a .NET Map component for WPF, Xamarin.Forms, Xamarin.Android, Xamarin.iOS and UWP
Stars: ✭ 447 (+587.69%)
Mutual labels:  mapping, map
Wicket
A modest library for moving between Well-Known Text (WKT) and various framework geometries
Stars: ✭ 484 (+644.62%)
Mutual labels:  mapping, leaflet
Joctomap
Java/Android wrapper for Octomap: an octree-based mapping library
Stars: ✭ 11 (-83.08%)
Mutual labels:  mapping, map
django-leaflet-admin-list
The Django Leaflet Admin List package provides an admin list view featured by the map and bounding box filter for the geo-based data of the GeoDjango.
Stars: ✭ 28 (-56.92%)
Mutual labels:  map, leaflet
kirby-locator
A simple map & geolocation field, built on top of open-source services and Mapbox. Kirby 3 only.
Stars: ✭ 83 (+27.69%)
Mutual labels:  map, leaflet
turkeyvisited
Mark the cities you have visited in Turkey and share the map!
Stars: ✭ 82 (+26.15%)
Mutual labels:  map, mapping
Mapserver
Source code of the MapServer project. Please submit pull requests to the 'main' branch.
Stars: ✭ 693 (+966.15%)
Mutual labels:  mapping, map
Svg World Map
🗺 A JavaScript library to easily integrate one or more SVG world maps with all nations (countries) and second-level political subdivisions (countries, provinces, states).
Stars: ✭ 38 (-41.54%)
Mutual labels:  mapping, map
leaflet heatmap
简单的可视化湖州通话数据 假设数据量很大,没法用浏览器直接绘制热力图,把绘制热力图这一步骤放到线下计算分析。使用Apache Spark并行计算数据之后,再使用Apache Spark绘制热力图,然后用leafletjs加载OpenStreetMap图层和热力图图层,以达到良好的交互效果。现在使用Apache Spark实现绘制,可能是Apache Spark不擅长这方面的计算或者是我没有设计好算法,并行计算的速度比不上单机计算。Apache Spark绘制热力图和计算代码在这 https://github.com/yuanzhaokang/ParallelizeHeatmap.git .
Stars: ✭ 13 (-80%)
Mutual labels:  map, leaflet
Lenz
Console based MAP 🗺 : with lots of features 🤩
Stars: ✭ 51 (-21.54%)
Mutual labels:  mapping, map
leaflet.TravelNotes
A complete mapping application. With this, you prepare a complete travel, adding itineraries and personnal notes to the map. When you travel is complete, you can save it to a file, export the itineraries to a gpx files, print the itineraries and a roadbook with the notes and itineraries description.
Stars: ✭ 31 (-52.31%)
Mutual labels:  map, mapping
o.map
Open Street Map app - KaiOS
Stars: ✭ 51 (-21.54%)
Mutual labels:  map, leaflet

Leaflet.LabelTextCollision

Leaflet.LabelTextCollision is a LeafletJS plug-in to display labels on vector data while avoiding label collisions.

Supports Leaflet 1.0.0+ branches.

To avoid label overlapping, this plugin hides some labels. Labels defined first will have preference over labels defined last, so arrange your labels from the most important to the least important.

L.LabelTextCollision implements a L.Renderer based on L.Canvas, as to not create an excess of DOM elements which might slow down rendering in the browser.

demo

Check out the demo

Usage examples

  • Create a new instance of L.LabelTextCollision specifying the collision flag option.
  • Use the map's renderer option to force rendering of vector data with that instance
var labelTextCollision = new L.LabelTextCollision({
  collisionFlg : true
});

var map = new L.Map('map', {
  layers : [ osm ],
  center : new L.LatLng(35.695786, 139.749213),
  zoom : 10,
  renderer : labelTextCollision
});
  • Instances of L.Path (L.Polylines, L.Polygons, L.Circles, L.CircleMarkers) have a new text option. Use it to specify the label contents.
  • The label will only be displayed if it doesn't collide with an existing label
L.polyline(
  [ [ 35.695786, 139.749213 ],
          [ 35.696786, 139.748213 ],
          [ 35.695786, 139.747213 ] ], {
      weight : 12,
      color : '#fe57a1',
      text : 'Leaflet.LabelTextCollision!!!!!!!!'
  }).addTo(map);

Future plans

  • Add options to control styling of the labels (including font face)
  • Fine tuning of overlap depending on zoom level
  • Refactoring...

License

Copyright (c) 2016 Kenta Hakoishi Released under the MIT license

However, "copyright notice" should be indicated on the place where the user is visible.

ただし、「著作権表示」はユーザが見える箇所に表記して下さい。 ※画面のフッター等に著作権表示とMITライセンスであることを明記して下さい。 ソース内ではクレジットと見なしません。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].