PHPackages                             benmanu/silverstripe-leafletfield - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. benmanu/silverstripe-leafletfield

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

benmanu/silverstripe-leafletfield
=================================

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

2.0.1(3y ago)53.3k9[2 PRs](https://github.com/benmanu/silverstripe-leafletfield/pulls)1JavaScript

Since Apr 24Pushed 2y agoCompare

[ Source](https://github.com/benmanu/silverstripe-leafletfield)[ Packagist](https://packagist.org/packages/benmanu/silverstripe-leafletfield)[ Docs](https://github.com/benmanu/silverstripe-leafletfield)[ RSS](/packages/benmanu-silverstripe-leafletfield/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (8)Used By (1)

SilverStripe LeafletField module
================================

[](#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
------------

[](#installation)

```
$ composer require benmanu/silverstripe-leafletfield

```

Basic Usage
-----------

[](#basic-usage)

Import the field

```
use BenManu\LeafletField\LeafletField;

```

Create a text database field to store the geojson value.

```
public static $db = array(
    'Geometry' => 'Text',
);

```

Create a LeafletField, passing through the object that you want to store the value against.

```
$field = new LeafletField('Geometry', 'Geometry', $this);

```

[Leaflet.draw demo](http://leaflet.github.io/Leaflet.draw/)

Field Options
-------------

[](#field-options)

Define default field options through config.

```
BenManu\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(array(
    'center' => array(
        'latitude' => '-40.866119',
        'longitude' => '174.143780'
    ),
    'zoom' => 5
));
$field->setDrawOptions(array(
    'polyline' => array(
        'shapeOptions' => array(
            'color' => '#269634'
        )
    ),
    'polygon' => array(
        'allowIntersection' => false,
        'drawError' => array(
            'color' => '#b00b00',
            'timeout' => 1000
        )
    ),
    'rectangle' => false,
    'circle' => false
));

```

The draw options are set using the same structure as [Leaflet.draw options](https://github.com/Leaflet/Leaflet.draw#drawoptions).

Maintainer Contacts
-------------------

[](#maintainer-contacts)

- Ben Manu

Requirements
------------

[](#requirements)

- SilverStripe 4.0

Project Links
-------------

[](#project-links)

- [GitHub Project Page](https://github.com/benmanu/silverstripe-leafletfield)
- [Issue Tracker](https://github.com/benmanu/silverstripe-leafletfield/issues)
- [Leaflet](http://leafletjs.com/)
- [Leaflet.draw](https://github.com/Leaflet/Leaflet.draw)
- [GeoJSON](http://geojson.org/geojson-spec.html)

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 91.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~461 days

Recently: every ~525 days

Total

7

Last Release

1269d ago

Major Versions

1.2.2 → 2.0.02018-02-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd2e09e14a1ce6be58b3d759414e939d20dc58662e511e1d561d16b7385141ee?d=identicon)[benmanu](/maintainers/benmanu)

---

Top Contributors

[![benmanu](https://avatars.githubusercontent.com/u/1373344?v=4)](https://github.com/benmanu "benmanu (11 commits)")[![scott1702](https://avatars.githubusercontent.com/u/10215604?v=4)](https://github.com/scott1702 "scott1702 (1 commits)")

---

Tags

silverstripemapleaflet

### Embed Badge

![Health badge](/badges/benmanu-silverstripe-leafletfield/health.svg)

```
[![Health](https://phpackages.com/badges/benmanu-silverstripe-leafletfield/health.svg)](https://phpackages.com/packages/benmanu-silverstripe-leafletfield)
```

###  Alternatives

[symfony/ux-leaflet-map

Symfony UX Map Leaflet Bridge

13146.6k1](/packages/symfony-ux-leaflet-map)[silverstripe/multiuser-editing-alert

A module that indicates when people are editing the same page in the CMS

1530.7k1](/packages/silverstripe-multiuser-editing-alert)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
