fathihfaiz/laravel-maps-suite
Composer 安装命令:
composer require fathihfaiz/laravel-maps-suite
包简介
Laravel Blade components for Leaflet, Google Maps, and Mapbox integration.
README 文档
README
A Laravel Blade component library for embedding Leaflet, Google Maps, and Mapbox maps via Blade components, designed for simplicity and power.
📦 Installation
composer require fathihfaiz/laravel-maps-suite
Publish Configuration and Views
php artisan vendor:publish --tag=maps-config php artisan vendor:publish --tag=maps-views
⚙️ Configuration
Edit your .env file:
MAP_DRIVER=leaflet # or google / mapbox
GOOGLE_MAPS_API_KEY=your_google_key
MAPBOX_ACCESS_TOKEN=your_mapbox_token
You can edit default map behavior via config/mapsuite.php.
🌍 Supported Drivers
| Driver | Props/Features | Notes |
|---|---|---|
| Leaflet | clustering, popupOptions, polylines, polygons |
Open-source, offline-friendly |
mapType, fitToBounds, centerToBoundsCenter |
API key required | |
| Mapbox | style, accessToken |
Requires Mapbox token |
🧰 Blade Component Usage
🧭 Generic auto-resolving map
<x-maps.generic :markers="[[ 'lat' => 51.5, 'lng' => -0.09, 'info' => 'London!' ]]" />
🍃 Leaflet Example
<x-maps-leaflet :markers="[ ['lat'=>51.5, 'lng'=>-0.09, 'info'=>'A', 'icon'=>'/icon.png', 'open'=>true] ]" :zoom-level="12" :enable-clustering="true" :polylines="[[[51.5, -0.09], [51.51, -0.1]]]" :popup-options="['maxWidth' => 300]" :popup-content="'Standalone popup here'" :popup-lat-lng="[51.49, -0.08]" />
🛰 Google Maps Example
<x-maps-google :center-point="[37.7749, -122.4194]" :zoom-level="10" :map-type="'roadmap'" :markers="[ ['lat'=>37.77,'lng'=>-122.42, 'info'=>'San Francisco'] ]" :fit-to-bounds="true" :center-to-bounds-center="true" />
🗺 Mapbox Example
<x-maps-mapbox :center-point="[40.71, -74.0]" :zoom-level="13" :style="'mapbox/streets-v11'" :markers="[ ['lat'=>40.71, 'lng'=>-74.0, 'info'=>'Hello NYC'] ]" />
📍 Marker Schema
Each marker is an array with:
| Prop | Type | Description |
|---|---|---|
lat, lng |
float | Coordinates |
info |
string | Popup HTML/text |
open |
bool | Call .openPopup() |
label |
string | Tooltip/marker title |
icon |
string | URL to icon image |
iconSizeX |
int | Icon width |
iconSizeY |
int | Icon height |
draggable |
bool | Allow marker dragging |
🧪 Testing
To run a preview:
php artisan serve
Then test Blade calls from a view or Tinker.
Test cases should include:
- Basic render
- Popups
- Polyline and polygon display
- Dynamic clustering
🤝 Contributing
Pull requests welcome! To contribute:
- Fork this repo
- Create a new branch for your feature
- Follow current structure and naming
- Submit PR with description
📜 License
MIT © 2024 Fathih Faiz
fathihfaiz/laravel-maps-suite 适用场景与选型建议
fathihfaiz/laravel-maps-suite 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 80 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 04 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 fathihfaiz/laravel-maps-suite 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fathihfaiz/laravel-maps-suite 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 80
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-10