PHPackages                             locomotivemtl/charcoal-geolocation - 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. locomotivemtl/charcoal-geolocation

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

locomotivemtl/charcoal-geolocation
==================================

Charcoal geolocation tools

0157MustacheCI failing

Since Aug 27Pushed 4y ago13 watchersCompare

[ Source](https://github.com/locomotivemtl/charcoal-geolocation)[ Packagist](https://packagist.org/packages/locomotivemtl/charcoal-geolocation)[ RSS](/packages/locomotivemtl-charcoal-geolocation/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

Charcoal Geolocation
====================

[](#charcoal-geolocation)

[![License](https://camo.githubusercontent.com/73624d7c45edc8c70d0a11240d3cb41d2afdef6328bb578e943c9837bc13b819/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c6f636f6d6f746976656d746c2f63686172636f616c2d67656f6c6f636174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/locomotivemtl/charcoal-geolocation)[![Latest Stable Version](https://camo.githubusercontent.com/546b16d29862bf24a10cb4eb2e8a26bfb3ab12f01ce96d4017751287619449b8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6f636f6d6f746976656d746c2f63686172636f616c2d67656f6c6f636174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/locomotivemtl/charcoal-geolocation)[![Code Quality](https://camo.githubusercontent.com/c94cf79eea04016c6fb19804df14487bccb7973ea50a5087193e4148693f1472/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c6f636f6d6f746976656d746c2f63686172636f616c2d67656f6c6f636174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/locomotivemtl/charcoal-geolocation/)[![Coverage Status](https://camo.githubusercontent.com/c33bb2a510c976645133b06480a009123c306fdfe063609022c82c5d60fe63dd/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6c6f636f6d6f746976656d746c2f63686172636f616c2d67656f6c6f636174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/locomotivemtl/charcoal-geolocation)[![Build Status](https://camo.githubusercontent.com/0ee4762b503ae98ad87a8046a7b1c7d85277a698e1fd996f62dea1a88a6be74c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c6f636f6d6f746976656d746c2f63686172636f616c2d67656f6c6f636174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/locomotivemtl/charcoal-geolocation)

A [Charcoal](https://packagist.org/packages/locomotivemtl/charcoal-app) service provider my cool feature.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
    - [Dependencies](#dependencies)
- [Configuration](#configuration)
- [Usage](#usage)
- [Development](#development)
    - [API Documentation](#api-documentation)
    - [Development Dependencies](#development-dependencies)
    - [Coding Style](#coding-style)
- [Credits](#credits)
- [License](#license)

Installation
------------

[](#installation)

The preferred (and only supported) method is with Composer:

```
$ composer require locomotivemtl/charcoal-geolocation
```

### Dependencies

[](#dependencies)

- [charcoal-core](https://github.com/locomotivemtl/charcoal-core)
- [charcoal-admin](https://github.com/locomotivemtl/charcoal-admin)

#### Required

[](#required)

- [**PHP 5.6+**](https://php.net): *PHP 7* is recommended.

Configuration
-------------

[](#configuration)

Add the *views* and the *metadata* paths to the config file.

```
"metadata": {
       "paths": [
           "...",
           "vendor/locomotivemtl/charcoal-geolocation/metadata/"
       ]
   },
   "view": {
       "paths": [
           "...",
           "vendor/locomotivemtl/charcoal-geolocation/views/"
       ]
   }
```

Usage
-----

[](#usage)

The module is basically a collection of properties, inputs and widgets. All you have to do is use them.

- GeolocationCollection widget implementation example for an object's dashboard :

```
"map": {
    "type": "charcoal/geolocation/widget/geolocation-collection",
    "geometry_property": "geometry",
    "infobox_template": "project/widget/example-infobox",
    "priority": 10
}
```

To use the properties provided by this Module, you have to refer to them with their full PHP path from the object metadata : `Charcoal\\Geolocation\\Property\\MapStructureProperty``Charcoal\\Geolocation\\Property\\PointProperty``Charcoal\\Geolocation\\Property\\PolylineProperty``Charcoal\\Geolocation\\Property\\PolygonProperty`

Widgets
-------

[](#widgets)

The following base widgets are available to build the various *admin* templates:

- `GeolocationCollection`
    - Widget That can show a collection of object that has a property that implements *GeolocationInterface*
    - Specify the property ident to use
    - Specify a template to show the

Property Inputs
---------------

[](#property-inputs)

The following property inputs are available to build forms in the *admin* module:

- `MapStructure`

    - A specialized widget to add and edit `geolocation data` on a map.
        - Supported geolocation types:
            - Point
            - Polyline
            - Polygon
    - Cannot be *multiple*
    - Requires google-map.
    - Requires [gmap](http://beneroch.com/gmap).
    - Extends StructureProperty from [charcoal-property](https://packagist.org/packages/locomotivemtl/charcoal-property).
    - Implements **GeolocationInterface**.
- `AbstractGeolocation`

    - Base property for:
        - `Point`
        - `Polyline`
        - `Polygon`
    - Extends AbstractProperty from [charcoal-property](https://packagist.org/packages/locomotivemtl/charcoal-property).
    - Implements **GeolocationInterface**.
- `Point`

    - A specialized widget to add and edit `Point` geolocation data on a map.
    - Requires google-map.
    - Requires [gmap](http://beneroch.com/gmap).
- `Polyline`

    - A specialized widget to add and edit `Polyline` geolocation data on a map.
    - Requires google-map.
    - Requires [gmap](http://beneroch.com/gmap).
- `Polygon`

    - A specialized widget to add and edit `Polygon` geolocation data on a map.
    - Requires google-map.
    - Requires [gmap](http://beneroch.com/gmap).

Development
-----------

[](#development)

To install the development environment:

```
$ composer install
```

To run the scripts (phplint, phpcs, and phpunit):

```
$ composer test
```

### API Documentation

[](#api-documentation)

- The auto-generated `phpDocumentor` API documentation is available at:

- The auto-generated `apigen` API documentation is available at:
    [https://codedoc.pub/locomotivemtl/charcoal-geolocation/master/](https://codedoc.pub/locomotivemtl/charcoal-geolocation/master/index.html)

### Development Dependencies

[](#development-dependencies)

- \[php-coveralls/php-coveralls\]\[phpcov\]
- \[phpunit/phpunit\]\[phpunit\]
- \[squizlabs/php\_codesniffer\]\[phpcs\]
- \[seld/jsonlint\]\[jsonlint\]

### Coding Style

[](#coding-style)

The charcoal-geolocation module follows the Charcoal coding-style:

- [*PSR-1*](https://www.php-fig.org/psr/psr-1/)
- [*PSR-2*](https://www.php-fig.org/psr/psr-2/)
- [*PSR-4*](https://www.php-fig.org/psr/psr-4/), autoloading is therefore provided by *Composer*.
- [*phpDocumentor*](http://phpdoc.org/) comments.
- [phpcs.xml.dist](phpcs.xml.dist) and [.editorconfig](.editorconfig) for coding standards.

> Coding style validation / enforcement can be performed with `composer phpcs`. An auto-fixer is also available with `composer phpcbf`.

Credits
-------

[](#credits)

- [Locomotive](https://locomotive.ca/)
- Joel Alphonso

License
-------

[](#license)

Charcoal is licensed under the MIT license. See [LICENSE](LICENSE) for details.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 82.4% 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.

### Community

Maintainers

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

---

Top Contributors

[![JoelAlphonso](https://avatars.githubusercontent.com/u/10762266?v=4)](https://github.com/JoelAlphonso "JoelAlphonso (28 commits)")[![mducharme](https://avatars.githubusercontent.com/u/12157?v=4)](https://github.com/mducharme "mducharme (4 commits)")[![veve40](https://avatars.githubusercontent.com/u/7537381?v=4)](https://github.com/veve40 "veve40 (2 commits)")

### Embed Badge

![Health badge](/badges/locomotivemtl-charcoal-geolocation/health.svg)

```
[![Health](https://phpackages.com/badges/locomotivemtl-charcoal-geolocation/health.svg)](https://phpackages.com/packages/locomotivemtl-charcoal-geolocation)
```

###  Alternatives

[umanskyi31/opengraph

Created a new component for Yii2. The Open Graph component for your website

119.7k](/packages/umanskyi31-opengraph)

PHPackages © 2026

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