Custom Laravel Nova 4 map detail field.
Original code from iMuMz/NovaFieldMap
- ✅ Support Leaflet
- ✅ Support Google Maps
- ✅ Marker clustering
- ✅ Map height
- ✅ Latitude and longitude coordinates
- ✅ GeoJSON
- ✅ Marker popup
- ✅ Custom marker icons
You can install the package via composer:
composer require gabrielesbaiz/nova-field-mapuse Gabrielesbaiz\NovaFieldMap;
NovaFieldMap::make()NovaFieldMap::make()
->height('400px') // default is 300px
By default the provider is OpenStreetMaps.
You must set your Google Maps API key (https://developers.google.com/maps/documentation/javascript/get-api-key).
NovaFieldMap::make()
->googleApiKey('')
->googleMapType('roadmap'), // roadmap, satellite or hybrid
NovaFieldMap::make('')
->type('LatLon')
->point($this->my_latitude,$this->my_longitude)
NovaFieldMap::make()
->type('GeoJson')
->geoJson('')
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"popup": "I am a Popup"
},
"geometry": {
"type": "Point",
"coordinates": [
23.8623046875,
-30.221101852485987
]
}
}
]
}
NovaFieldMap::make()
->popup('popup')
NovaFieldMap::make()
->markerIcon('/images/marker-icon.png')
You can pass additional parameters to set the icon size and anchor
->markerIcon('/images/marker-icon.png',[100,100],[50,50])
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.