kxka/leafletjs
Composer 安装命令:
composer require kxka/leafletjs
包简介
Interactive Leaflet map with marker clustering. Displays a leaflet map using a preprocessed CSV file with location data to prevent long query times for large data sets.
README 文档
README
Displays a leaflet map using a preprocessed file (.csv or .geojson) with all location data to prevent long query times for large data sets
Usage
Install with
composer require kxka/leafletjs
- Go to Structure > Block layout
- Click "Place block"
- Search for "LeafletJS"
Configuration
- Title
- Map Height
- Location Data File:
.csv,.json, or.geojson - Override autofit zoom and center to set default zoom and center
File Formats
CSV Format
Title,Coordinates,Link,Thumbnail "Title1","67.913381, -48.204069",https://islandora.dev/node/10,https://islandora.dev/system/files/file1.jpg "Title2","72.425063, 91.628126",https://islandora.dev/node/9,https://islandora.dev/system/files/file2.jpg
GeoJSON Format
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [18.692492, -51.061725] },
"properties": {
"name": "",
"description": "",
"title": "Contemporary Materials",
"search_api_url": "https://islandora.dev/node/2",
"islandora_object_thumbnail": "https://islandora.dev/system/files/styles/large/private/2025-12/facebook-1-logo-png-transparent.png?itok=rVxWQ-Rw"
}
},
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [120.583837, -67.782708] },
"properties": {
"name": "",
"description": "",
"title": "Research Manuscripts",
"search_api_url": "https://islandora.dev/node/4",
"islandora_object_thumbnail": "https://islandora.dev/system/files/styles/large/private/2025-12/facebook-1-logo-png-transparent.png?itok=rVxWQ-Rw"
}
}
]
}
Note: Files are converted to .js format after upload. GeoJSON coordinates use [longitude, latitude] order.
Folder Structure
drupal_leafletjs/
├── css/
│ ├── style.css # Custom map styles
│ └── L.Control.ResetView.min.css # Reset button styles
├── images/
│ └── redo-solid.svg # Reset button icon
├── js/
│ ├── leafletjs.js # Map initialization script
│ ├── markercluster-src.js # Marker clustering library
│ └── L.Control.ResetView.min.js # Reset view control
├── libraries/
│ ├── MarkerCluster.css # Cluster styling
│ └── MarkerCluster.Default.css # Default cluster theme
├── src/
│ └── Plugin/
│ └── Block/
│ └── LeafletjsBlock.php # Main block plugin
├── templates/
│ └── leafletjs.html.twig # Map container template
├── leafletjs.info.yml # Module definition
├── leafletjs.libraries.yml # Library definitions
├── leafletjs.module # Module hooks
└── README.md
Credits
This module uses the following open-source libraries:
kxka/leafletjs 适用场景与选型建议
kxka/leafletjs 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「geolocation」 「map」 「drupal」 「leaflet」 「markers」 「clustering」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kxka/leafletjs 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kxka/leafletjs 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kxka/leafletjs 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Maps in minutes. Powered by the Google Maps API.
Yii2 map input widget. Allows you to select geographcal coordinates via a human-friendly inteface.
Provides an add-on purchasable entity.
The official PHP library for apiip.net that allowing customers to automate IP address validation and geolocation lookup in websites, applications and back-office system. Visit our API docs at https://apiip.net/documentation
Drupal integration module for the Kalastatic prototyping and styleguide tool
Provides a base set of configuration and module dependencies for starting new Drupal projects.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 30
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2025-12-16