Package Data | |
---|---|
Maintainer Username: | davidpiesse |
Package Create Date: | 2018-08-27 |
Package Last Update: | 2022-06-04 |
Language: | Vue |
License: | MIT |
Last Refreshed: | 2024-11-18 03:01:14 |
Package Statistics | |
---|---|
Total Downloads: | 215,119 |
Monthly Downloads: | 362 |
Daily Downloads: | 13 |
Total Stars: | 114 |
Total Watchers: | 9 |
Total Forks: | 29 |
Total Open Issues: | 5 |
This map field currently ONLY shows in details view - BUT editing will be coming soon!
You can use this Map Field with three different sort of spatial data:
GeoJSON String property
Latitude and Longitude properties
Latitude and Longitude both in a single text field
Core Laravel Spatial Types
You can set the height of the map in px
The field is disabled in Index and Form views by default
This is very much a WIP - please submit issues to GitHub
To specify what sort of spatial data you are passing to this field you MUST set the spatialType() for example
->spatialType('Point')
These are the valid Spatial Types
Map::make('Some Point Field', 'point_field_name')
->spatialType('Point'),
Map::make('Some Polygon Field', 'polygon_field_name')
->spatialType('Polygon'),
Map::make('Some GeoJSON Field')
->spatialType('GeoJSON')
->geojson('geojson_field_name'),
Map::make('Some Point Location')
->spatialType('LatLon')
->latitude('latitude_field_name')
->longitude('longitude_field_name'),
Map::make('Some Point Location', 'coordinate_field_name')
->spatialType('LatLonField'),
Map::make('Some Point Field', 'point_field_name')
->spatialType('Point')
->height('300px'),
You need to install grimzy/laravel-mysql-spatial into your main application
composer require grimzy/laravel-mysql-spatial
Add the SpatialTrait to your Model
use SpatialTrait;
You then also need to set any spatial fields you have set in the Model
protected $spatialFields = [
'geo_point',
'geo_linestring',
...
];
Your Model is now ready to process spatial data to Nova