{"id":13733364,"url":"https://github.com/humaidem/filament-map-picker","last_synced_at":"2025-10-10T03:40:25.823Z","repository":{"id":40450119,"uuid":"444426809","full_name":"humaidem/filament-map-picker","owner":"humaidem","description":"Filament Map Field","archived":false,"fork":false,"pushed_at":"2023-11-20T19:41:19.000Z","size":531,"stargazers_count":58,"open_issues_count":5,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-17T18:07:21.108Z","etag":null,"topics":["filament","laravel","map","osm","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/humaidem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-04T13:20:47.000Z","updated_at":"2025-08-13T15:17:13.000Z","dependencies_parsed_at":"2023-11-20T20:46:39.845Z","dependency_job_id":null,"html_url":"https://github.com/humaidem/filament-map-picker","commit_stats":{"total_commits":8,"total_committers":3,"mean_commits":"2.6666666666666665","dds":0.375,"last_synced_commit":"3dc2bcc91cf0f1b92bc5302a07787bc2a18e8ddb"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/humaidem/filament-map-picker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humaidem%2Ffilament-map-picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humaidem%2Ffilament-map-picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humaidem%2Ffilament-map-picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humaidem%2Ffilament-map-picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/humaidem","download_url":"https://codeload.github.com/humaidem/filament-map-picker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humaidem%2Ffilament-map-picker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002614,"owners_count":26083425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filament","laravel","map","osm","php"],"created_at":"2024-08-03T03:00:41.935Z","updated_at":"2025-10-10T03:40:25.790Z","avatar_url":"https://github.com/humaidem.png","language":"PHP","funding_links":[],"categories":["Fields"],"sub_categories":[],"readme":"# Filament Map Picker\n\nA Filament field to enable you select location in map and return geo coordinates.\n\n### Status Note\n\nThis package still in beta and not full tested. please use at your own risk.\n\n# Supported Maps\n\n1. Open Street Map (OSM)\n\nMore will be added to package once proven it's needed.\n\n# Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require humaidem/filament-map-picker\n```\n\n# Basic usage\n\nResource file\n\n```php\n\u003c?php\nnamespace App\\Filament\\Resources;\nuse Filament\\Resources\\Resource;\nuse Filament\\Resources\\Forms\\Form;\nuse Humaidem\\FilamentMapPicker\\Fields\\OSMMap;\n...\nclass FilamentResource extends Resource\n{\n    ...\n    public static function form(Form $form)\n    {\n        return $form-\u003eschema([\n            OSMMap::make('location')\n                -\u003elabel('Location')\n                -\u003eshowMarker()\n                -\u003edraggable()\n                -\u003eextraControl([\n                    'zoomDelta'           =\u003e 1,\n                    'zoomSnap'            =\u003e 0.25,\n                    'wheelPxPerZoomLevel' =\u003e 60\n                ])\n                // tiles url (refer to https://www.spatialbias.com/2018/02/qgis-3.0-xyz-tile-layers/)\n                -\u003etilesUrl('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}')\n           ]);\n    }\n    ...\n}\n```\n\n### Manipulating data\n\nWe will be using grimzy/laravel-mysql-spatial:^4.0 as example, you can use any other package as you please.\n\n#### After State Hydrated\n\nonce data loaded from database you will need to convert it to correct format as livewire don't accept class base format.\n\n```php\n...\nOSMMap::make('location')\n    -\u003eafterStateHydrated(function ($state, callable $set) {\n            if ($state instanceof Point) {\n                /** @var Point $state */\n                $set('location', ['lat' =\u003e $state-\u003egetLat(), 'lng' =\u003e $state-\u003egetLng()]);\n            }\n        });\n...\n```\n\n#### mutate Dehydrated State\n\nconvert array to Point class before storing data.\n\n```php\n...\nOSMMap::make('location')\n   -\u003emutateDehydratedStateUsing(function ($state) {\n                if (!($state instanceof Point))\n                    return new Point($state['lat'], $state['lng']);\n\n                return $state;\n            });\n...\n```\n\n#### After State Updated\n\nMake sure to convert data into array after each time updated.\n\n```php\n...\nOSMMap::make('location')\n    -\u003eafterStateUpdated(function ($state, callable $set) use ($name) {\n            if ($state instanceof Point) {\n                /** @var Point $state */\n                $set($name, ['lat' =\u003e $state-\u003egetLat(), 'lng' =\u003e $state-\u003egetLng()]);\n            }\n        });\n...\n```\n\n## Options\n\nOption | Type   | Default                                       | Description\n------------|--------|-----------------------------------------------| -------------\n`draggable(bool)` | bool   | false                                         | Allow user to move map around.\n`zoom(int)` | int    | 19                                            | Default zoom when map loaded.\n`maxZoom(int)` | int    | 20                                            | Max zoom allowed.\n`showMarker(bool)` | bool   | false                                         | Show Marker in the middle of the map\n`tilesUrl(string)` | string | http://tile.openstreetmap.org/{z}/{x}/{y}.png | Tiles service/provider url.\n`showZoomControl(bool)` | bool   | false                                         | Show or hide Zoom control of the map.\n`extraControl(array)` | array  | []                                         | Add extra map controls (please refer to leaflet)\n`extraTileControl(array)` | array  | []                                         | Add extra tileLayer controls (please refer to leaflet tileLayer())\n\n# License\n\n[MIT](LICENSE) © Humaid Al Mansoori\n\n# Thanks for use\n\nHopefully, this package is useful to you.\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumaidem%2Ffilament-map-picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhumaidem%2Ffilament-map-picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumaidem%2Ffilament-map-picker/lists"}