salemaljebaly/filament-map-picker
Composer 安装命令:
composer require salemaljebaly/filament-map-picker
包简介
A Leaflet / OpenStreetMap map picker field for Filament v5.
README 文档
README
A simple, polished Filament v5 map picker field built on Leaflet + OpenStreetMap (free services only).
Screenshots
Light Mode — Search & Suggestions
Dark Mode — Controls & Theme Matching
Goals (v1)
- Fast to install, no API keys required
- Great UX: search, collapsible search, my-location, reset, fullscreen, zoom buttons
- Dark / light theme compatible
- RTL-friendly search input (
dir="auto") - SPA-safe (cleans up on Filament/Livewire navigation)
Non-goals (v1)
- Paid providers (Google / Mapbox)
- Drawing tools (polygons, GeoJSON, etc.)
Requirements
- PHP
^8.2 - Laravel
^11or^12 - Filament
^5
Installation
composer require salemaljebaly/filament-map-picker
Publish config (optional):
php artisan vendor:publish --tag=filament-map-picker-config
Basic Usage (Form)
This component writes to your latitude/longitude fields. Keep the map field itself non-dehydrated.
use Filament\Forms; use SalemAljebaly\FilamentMapPicker\MapPicker; Forms\Components\Hidden::make('latitude')->rules(['nullable', 'numeric']), Forms\Components\Hidden::make('longitude')->rules(['nullable', 'numeric']), MapPicker::make('location') ->label('Location') ->latlngFields('latitude', 'longitude') ->searchable() ->collapsibleSearch() ->draggable() ->height(320),
Usage (Infolist / View)
use SalemAljebaly\FilamentMapPicker\MapView; MapView::make('location') ->label('Location') ->latlngFields('latitude', 'longitude') ->height(240),
Configuration
Defaults live in config/filament-map-picker.php.
Common options:
default_location.lat,default_location.lngdefault_zoomheightmarker.color,marker.draggableauto_dark_modetile_provider(osm,cartodb_light,cartodb_dark)controls.my_location,controls.fullscreen,controls.resetcontrol_position(topleft,topright,bottomleft,bottomright)search.enabled,search.collapsible,search.throttle_ms,search.min_length,search.limitsearch.nominatim.email(env:NOMINATIM_EMAIL)
Customizing Icons
Icons are Blade views under:
resources/views/icons/*.blade.php
To override icons in your app, create matching files here:
resources/views/vendor/filament-map-picker/icons/*.blade.php
For consistent theming, make sure your SVGs use stroke="currentColor" / fill="currentColor" instead of hard-coded colors.
Geolocation Notes
The browser geolocation API requires HTTPS (except localhost). If it fails, it’s usually due to:
- Permission denied in the browser
- Non-HTTPS site
- Location services disabled (OS / browser)
Nominatim (Search) Notes
Nominatim has usage policies and rate limits. Browser requests can’t reliably set a custom User-Agent header.
If you expect heavy usage, proxy geocoding through your backend. For light usage, configure:
NOMINATIM_EMAIL="you@example.com"
salemaljebaly/filament-map-picker 适用场景与选型建议
salemaljebaly/filament-map-picker 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 1.24k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2026 年 02 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「map」 「laravel」 「leaflet」 「picker」 「OpenStreetMap」 「filament」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 salemaljebaly/filament-map-picker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 salemaljebaly/filament-map-picker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 salemaljebaly/filament-map-picker 相关的其它包
同方向 / 同关键字的高下载量 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.
An image tile generator. PHP 7.4+
Leaflet-wrapper for Yii2.x
A craft cms 3 field plugin to draw Leaflet Maps.
The enumeration type for PHP
统计信息
- 总下载量: 1.24k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-06

