Download the PHP package nzta/googlemap-leafletfield without Composer
On this page you can find all versions of the php package nzta/googlemap-leafletfield. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download nzta/googlemap-leafletfield
More information about nzta/googlemap-leafletfield
Files in nzta/googlemap-leafletfield
Download nzta/googlemap-leafletfield
More information about nzta/googlemap-leafletfield
Files in nzta/googlemap-leafletfield
Vendor nzta
Package googlemap-leafletfield
Short Description Provides a form field type allowing users to draw features on a map, the features are stored as geoJSON objects in a single database field
License BSD-3-Clause
Homepage https://github.com/nzta/googlemap-leafletfield
Package googlemap-leafletfield
Short Description Provides a form field type allowing users to draw features on a map, the features are stored as geoJSON objects in a single database field
License BSD-3-Clause
Homepage https://github.com/nzta/googlemap-leafletfield
Please rate this library. Is it a good library?
Informations about the package googlemap-leafletfield
SilverStripe LeafletField module
Provides a form field type allowing users to draw features on a map, the features are stored as geoJSON objects in a single database field.
Installation
$ composer require NZTA/googlemap-leafletfield
Basic Usage
Import the field
use NZTA\LeafletField\LeafletField;
Create a text database field to store the geojson value.
public static $db = [
'Geometry' => 'Text',
];
Create a LeafletField, passing through the object that you want to store the value against.
$field = new LeafletField('Geometry', 'Geometry', $this);
Field Options
Define default field options through config.
NZTA\LeafletField\LeafletField:
map_options:
center:
latitude: "-40.866119"
longitude: "174.143780"
zoom: 5
draw_options:
polyline:
shapeOptions:
color: '#269634'
polygon:
allowIntersection: false
drawError:
color: '#b00b00'
timeout: 1000
rectangle: false
circle: false
Define custom options for individual field instances (overrides defaults).
$field->setLimit(1); // Limit the amount of objects the field can contain.
$field->setMapOptions([
'center' => [
'latitude' => '-40.866119',
'longitude' => '174.143780'
],
'zoom' => 5
]);
$field->setDrawOptions([
'polyline' => [
'shapeOptions' => [
'color' => '#269634'
]
],
'polygon' => [
'allowIntersection' => false,
'drawError' => [
'color' => '#b00b00',
'timeout' => 1000
]
],
'rectangle' => false,
'circle' => false
]);
The draw options are set using the same structure as Leaflet.draw options.
Requirements
- SilverStripe 4.0
Project Links
All versions of googlemap-leafletfield with dependencies
PHP Build Version
Package Version
The package nzta/googlemap-leafletfield contains the following files
Loading the files please wait ....