2019-09-07 04:17:48 +07:00
2018-11-29 17:38:20 +00:00
2018-11-29 17:38:20 +00:00
2018-11-29 17:38:20 +00:00
2018-11-29 17:38:20 +00:00
2018-11-29 17:38:20 +00:00
2019-09-07 04:17:48 +07:00
2018-11-29 17:38:20 +00:00
2018-11-29 17:38:20 +00:00
2018-12-07 15:11:53 +13:00
2018-11-29 17:38:20 +00:00
2018-11-29 17:38:20 +00:00

SilverStripe Mapbox Field

Adds a Mapbox map to the CMS with a draggable marker to allow content authors to add a location to a DataObject or Page.

Installation

composer require bigfork/silverstripe-mapboxfield:*

Configuration

---
Name: 'app-mapbox'
After: 'silverstripe-mapboxfield'
---
Bigfork\SilverStripeMapboxField\MapboxField:
  access_token: '<your mapbox key>'

Usage

class MyDataObject extends DataObject
{
    private static $db = [
        'Latitude' => 'Decimal(10, 8)',
        'Longitude' => 'Decimal(11, 8)'
    ];

    public function getCMSFields()
    {
        // ...

        $fields->addFieldToTab(
            'Root.Map',
            MapboxField::create('LocationMap', 'Choose a location', 'Latitude', 'Longitude')
        );

        // ...
    }
}
Description
Mapbox CMS field, Geocoding and Frontend UI for SilverStripe 4
Readme 1.7 MiB
Languages
PHP 52.3%
JavaScript 33.6%
Scheme 11.9%
SCSS 2.2%