PHPackages                             firesphere/googlemapsfield - 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. firesphere/googlemapsfield

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

firesphere/googlemapsfield
==========================

Google places api field for SilverStripe

1.1.0(2y ago)13115[3 issues](https://github.com/Firesphere/silverstripe-googlemapsfield/issues)BSD-3-ClausePHP

Since Dec 13Pushed 2y agoCompare

[ Source](https://github.com/Firesphere/silverstripe-googlemapsfield)[ Packagist](https://packagist.org/packages/firesphere/googlemapsfield)[ RSS](/packages/firesphere-googlemapsfield/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

[![CircleCI](https://camo.githubusercontent.com/3f4ba3765ac17a9a582c4341ee6eeea39382c52ffa7009e400e4456c144df396/68747470733a2f2f696d672e736869656c64732e696f2f636972636c6563692f70726f6a6563742f6769746875622f466972657370686572652f73696c7665727374726970652d676f6f676c656d6170736669656c642e737667)](https://circleci.com/gh/Firesphere/silverstripe-googlemapsfield)[![codecov](https://camo.githubusercontent.com/01347b8d09d6c95f556e295a6233bea5a71dd11e3c861a7aafe772694a9492c3/68747470733a2f2f636f6465636f762e696f2f67682f466972657370686572652f73696c7665727374726970652d676f6f676c656d6170736669656c642f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/Firesphere/silverstripe-googlemapsfield)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/63dc03bd317d74f7015cdef00af529ee96f6123f5d239e4cedda2e8985155780/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f466972657370686572652f73696c7665727374726970652d676f6f676c656d6170736669656c642f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Firesphere/silverstripe-googlemapsfield/?branch=master)

Google Places field
===================

[](#google-places-field)

Play with Google Places in your forms in SilverStripe

Installation
============

[](#installation)

`composer require firesphere/googlemapsfield`

Usage
=====

[](#usage)

Add the form field to your form and enter your keys in the SiteConfig.

All the information from Google Places is automatically populated in hidden fields. You will have to map these to your own DataObject storage on saving the form.

The fields given from places are:

- GoogleMapsLatField
- GoogleMapsLngField
- subpremise
- street\_number
- route
- sublocality\_level\_1
- locality
- administrative\_area\_level\_1
- country
- postal\_code

If you want to change the fields, add custom hidden fields or remove some fields, you can do so via the `getExtraFields` and `setExtraFields` methods.

You can only use this field *once* per form, due to restrictions of the ID's of fields.

Custom options
--------------

[](#custom-options)

[https://developers.google.com/maps/documentation/javascript/places-autocomplete#add\_autocomplete](https://developers.google.com/maps/documentation/javascript/places-autocomplete#add_autocomplete)

Any options you want to add, can be set on the field as an array:

```
$field = GoogleMapsField::create('MyField');
$field->setCustomOptions(['componentRestrictions' => ['country' => 'nz']]);
```

Actual license
==============

[](#actual-license)

This module is published under BSD 3-clause license, although these are not in the actual classes, the license does apply:

Copyright (c) 2012-NOW(), Simon "Firesphere" Erkelens

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

```
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

```

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Did you read this entire readme? You rock!
==========================================

[](#did-you-read-this-entire-readme-you-rock)

Pictured below is a cow, just for you.

```

               /( ,,,,, )\
              _\,;;;;;;;,/_
           .-"; ;;;;;;;;; ;"-.
           '.__/`_ / \ _`\__.'
              | (')| |(') |
              | .--' '--. |
              |/ o     o \|
              |           |
             / \ _..=.._ / \
            /:. '._____.'   \
           ;::'    / \      .;
           |     _|_ _|_   ::|
         .-|     '==o=='    '|-.
        /  |  . /       \    |  \
        |  | ::|         |   | .|
        |  (  ')         (.  )::|
        |: |   |;  U U  ;|:: | `|
        |' |   | \ U U / |'  |  |
        ##V|   |_/`"""`\_|   |V##
           ##V##         ##V##

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~560 days

Total

2

Last Release

1053d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8497c885d84e4bf94b8e6136292aa602124a50bbbb4a14ab00e1423f232e7663?d=identicon)[Firesphere](/maintainers/Firesphere)

---

Top Contributors

[![Firesphere](https://avatars.githubusercontent.com/u/680570?v=4)](https://github.com/Firesphere "Firesphere (4 commits)")[![robbieaverill](https://avatars.githubusercontent.com/u/5170590?v=4)](https://github.com/robbieaverill "robbieaverill (2 commits)")[![ishannz](https://avatars.githubusercontent.com/u/20032948?v=4)](https://github.com/ishannz "ishannz (1 commits)")[![mark-a-j-adriano](https://avatars.githubusercontent.com/u/11882563?v=4)](https://github.com/mark-a-j-adriano "mark-a-j-adriano (1 commits)")[![scott-nz](https://avatars.githubusercontent.com/u/38484948?v=4)](https://github.com/scott-nz "scott-nz (1 commits)")

---

Tags

hacktoberfestgooglesilverstripemapsplacesGoogleMapsField

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/firesphere-googlemapsfield/health.svg)

```
[![Health](https://phpackages.com/badges/firesphere-googlemapsfield/health.svg)](https://phpackages.com/packages/firesphere-googlemapsfield)
```

###  Alternatives

[cornford/googlmapper

An easy way to integrate Google Maps with Laravel.

457447.9k4](/packages/cornford-googlmapper)

PHPackages © 2026

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