PHPackages                             nblum/silverstripe-geocodefield - 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. nblum/silverstripe-geocodefield

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

nblum/silverstripe-geocodefield
===============================

Silverstripe field for fetching geo data from google maps api for any addresses

2.2.0(6y ago)42.4k3MITPHP

Since Oct 14Pushed 6y agoCompare

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

READMEChangelogDependencies (1)Versions (11)Used By (0)

silverstripe-geocodefield
=========================

[](#silverstripe-geocodefield)

Fetches the geo position (lon,lat) from google maps api. Can be used as free address input field or referenced to other address fields in form

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

[](#requirements)

- Silverstripe 4.\* or Silverstripe 3.\*(use tag 0.3.0 for v3.x support)

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

[](#installation)

### Composer

[](#composer)

- `composer require "nblum/silverstripe-geocodefield"`

### Manual

[](#manual)

- Download/Clone module in SilverStripe root directory

Usage
-----

[](#usage)

Configuration:

You may need to provide an api key from google (Geolocation API)

```
Nblum\Geocodefield\Forms\GeoCodeField:
  google_api_key: 'your_google_maps_api_ke'
```

...or try to geocode with Nominatim from OpenStreetMap

```
Nblum\Geocodefield\Forms\GeoCodeField:
  custom_geocoder: 'osm'
```

Basic Example:

```
    class MyPage extends Page {

        private static $db = array(
            'Geodata' => \Nblum\Geocodefield\Forms\Json::class
        );

        public function getCMSFields() {
            $fields = parent::getCMSFields();

            //creates a GeoCodeField field
            $fields->addFieldToTab('Root.Main', new \Nblum\Geocodefield\Forms\GeoCodeField('Geodata'));

            return $fields;
        }
    }

```

Example with referenced address fields:

```
    class MyPage extends Page {

        private static $db = array(
            'Street' => 'Varchar',
            'City' => 'Varchar',
            'Geodata' => 'Json'
        );

        public function getCMSFields() {
            $fields = parent::getCMSFields();

            $fields->addFieldToTab('Root.Main', new TextField('Street'));
            $fields->addFieldToTab('Root.Main', new TextField('City'));

            //creates a GeoCodeField field
            $field = new \Nblum\Geocodefield\Forms\GeoCodeField('Geodata', 'Geo Position');
            $field->addAddressReference('Street');
            $field->addAddressReference('City');
            $field->setAddressNotEditable();
            $fields->addFieldToTab('Root.Main', $field);

            return $fields;
        }
    }

```

Write lon/lat values to separate db columns

```
    class MyPage extends Page {

        private static $db = array(
            'Lat' => 'Varchar',
            'Lon' => 'Varchar',
            'GeoData' => 'Json'
        );

        public function getCMSFields() {
            //...
        }

        protected function onBeforeWrite()
        {
            parent::onBeforeWrite();

            //get current values and update some custom fields
            $parts = json_decode($this->getField('GeoData'));
            $this->setField('Lat', $parts->lat);
            $this->setField('Lon', $parts->lon);
        }
    }
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 93.3% 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 ~84 days

Recently: every ~148 days

Total

8

Last Release

2389d ago

Major Versions

0.3.0 → 2.0.02018-03-14

### Community

Maintainers

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

---

Top Contributors

[![nblum](https://avatars.githubusercontent.com/u/7358767?v=4)](https://github.com/nblum "nblum (14 commits)")[![davejtoews](https://avatars.githubusercontent.com/u/9664035?v=4)](https://github.com/davejtoews "davejtoews (1 commits)")

---

Tags

geolocationsilverstripeinputgeocode

### Embed Badge

![Health badge](/badges/nblum-silverstripe-geocodefield/health.svg)

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

###  Alternatives

[anthonymartin/geo-location

Powerful GeoCoding library: Retrieve bounding box coordinates, distances between geopoints, point in polygon, get longitude and latitude from addresses and more with GeoLocation for PHP

196949.5k5](/packages/anthonymartin-geo-location)[dynamic/silverstripe-locator

SilverStripe Locator Module. Show locations on a map. Search by geoposition.

2113.2k1](/packages/dynamic-silverstripe-locator)[silverstripe/multi-domain

Allows multiple domains to access one CMS instance, mapping them to different sections of the hierarchy

141.6k](/packages/silverstripe-multi-domain)

PHPackages © 2026

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