PHPackages                             zarocknz/silverstripe-geodata-uploadfield - 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. [Image &amp; Media](/categories/media)
4. /
5. zarocknz/silverstripe-geodata-uploadfield

ActiveSilverstripe-module[Image &amp; Media](/categories/media)

zarocknz/silverstripe-geodata-uploadfield
=========================================

Geolocation file upload field (for photos etc)

0.1.0(10y ago)0112BSDJavaScriptPHP &gt;=5.3.0

Since Mar 7Pushed 10y ago2 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (4)Used By (0)

[SilverStripe Geodata Uploadfield](https://github.com/zarocknz/silverstripe-geodata-uploadfield)
================================================================================================

[](#silverstripe-geodata-uploadfield)

[![Build Status](https://camo.githubusercontent.com/2b7a8e48ae73ed5e9735d5e2c4e565815427eb8ee11e883acedf5719458c644f/68747470733a2f2f6170692e7472617669732d63692e6f72672f7a61726f636b6e7a2f73696c7665727374726970652d67656f646174612d75706c6f61646669656c642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/zarocknz/silverstripe-geodata-uploadfield)[![Latest Stable Version](https://camo.githubusercontent.com/791a44c72bc5e6240c1e41c8ce293f33d0095dd22b6dd2a34960fc553617c5cb/68747470733a2f2f706f7365722e707567782e6f72672f7a61726f636b6e7a2f73696c7665727374726970652d67656f646174612d75706c6f61646669656c642f76657273696f6e2e737667)](https://github.com/zarocknz/silverstripe-geodata-uploadfield/releases)[![Latest Unstable Version](https://camo.githubusercontent.com/6d8074add5fbdcf82056c82ba5a836c1a834bc81c7e8669185776a6e68f811c4/68747470733a2f2f706f7365722e707567782e6f72672f7a61726f636b6e7a2f73696c7665727374726970652d67656f646174612d75706c6f61646669656c642f762f756e737461626c652e737667)](https://packagist.org/packages/zarocknz/silverstripe-geodata-uploadfield)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/fce1c92ed68a6c26e8021d47468281e64520611b729408fcd236b6fa9565b002/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7a61726f636b6e7a2f73696c7665727374726970652d67656f646174612d75706c6f61646669656c642e737667)](https://scrutinizer-ci.com/g/zarocknz/silverstripe-geodata-uploadfield?branch=master)[![Total Downloads](https://camo.githubusercontent.com/ba1757faecdde788a5a749c0c103e18a429a20753e304df1da96b3acdb83d7bf/68747470733a2f2f706f7365722e707567782e6f72672f7a61726f636b6e7a2f73696c7665727374726970652d67656f646174612d75706c6f61646669656c642f646f776e6c6f6164732e737667)](https://packagist.org/packages/zarocknz/silverstripe-geodata-uploadfield)[![License](https://camo.githubusercontent.com/54fe41b32b9de430732b6fe5a003a00e063d489c0cc7bfde9d9e5a75dcc476e3/68747470733a2f2f706f7365722e707567782e6f72672f7a61726f636b6e7a2f73696c7665727374726970652d67656f646174612d75706c6f61646669656c642f6c6963656e73652e737667)](https://github.com/zarocknz/silverstripe-geodata-uploadfield/blob/master/license.md)

File upload field for forms with a Google Map to allow the user to set the location of the uploaded media, for example photos.

Latitude, Longitude, and Zoom fields are saved in to the same DataObject as the Image the upload field is for when the form is submitted.

If the file has geolocation tags in it once the file is chosen the marker on the map will move to that location automatically (the user can adjust manually if desired).

Note this only works on front-end forms at this time.

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

[](#requirements)

```
* Silverstripe 3.1.x+
* JQuery-1.7.1+

```

Usage example
-------------

[](#usage-example)

Add the following fields to the DataObject your form submissions are saved in to...

```
'Latitude'  => 'Varchar(255)',
'Longitude' => 'Varchar(255)',
'Zoom'      => 'Int',
```

Also ensure your data object has an Image (or other object which allows file upload)...

```
private static $has_one = array(
    'Image' => 'Image',
);
```

Then create your form using the GeodataUploadField instead of a normal Silverstripe upload field...

```
public function getFrontEndFields($params = null)
{
   $fields = parent::getFrontEndFields($params);

   // Create GeoData Upload field.
   $upload = GeoDataUploadField::create('Image', 'Image');

   // Set options to prevent selection of existing or access to the filesystem as per Silverstripe docs.
   $upload->setCanAttachExisting(false);
   $upload->setCanPreviewFolder(false);

   $fields->replaceField('Image', $upload);

   return $fields;
}
```

Constructor options
-------------------

[](#constructor-options)

There are a few other things you can pass to the constructor besides the field name and title. For the third parameter you can pass an array of options which will override the default options for the map in \_config/geodata-uploadfield.yml.

If you have named the Latitude, Longitude, or Zoom fields differently in your DataObject you need to pass the names of them in to the constructor as the last 3 parameters otherwise nothing will be saved on form submission.

The following example shows creating a GeoDataUploadField passing some options and the differently named lat and lng fields...

```
$upload = GeoDataUploadField::create(
   'Image',                // Name.
   'Select an Image',      // Title
   array(                  // Options.
      'map' => array(
         'zoom' => 10
      )
   ),
   'theLatField',          // Latitude field name.
   'theLngField',          // Longitude field name.
   'theZomField'           // Zoom field name.
);
```

Remember, as long as you have named the fields on the dataobject Latitude, Longitude, and Zoom you don't need to pass their names in to the constructor.

Credits
-------

[](#credits)

This module is heavily based on the BetterBrief/silverstripe-googlemapfield by Will Morgan and others which has a BSD license.

This module also includes the Javascript EXIF Reader - jQuery plugin 0.1.3 by Jacob Seidelin which has a MPL License.

All I have really done is bought these two together and modified them to work in the way I needed for a project.

I would like to thank the creators and contributors of those repositories / libraries.

Maintainer
----------

[](#maintainer)

zarocknz -

TODO
----

[](#todo)

```
* Try to get this working CMS side.

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

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

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3715d ago

### Community

Maintainers

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

---

Top Contributors

[![zarocknz](https://avatars.githubusercontent.com/u/7462446?v=4)](https://github.com/zarocknz "zarocknz (13 commits)")[![spekulatius](https://avatars.githubusercontent.com/u/8433587?v=4)](https://github.com/spekulatius "spekulatius (6 commits)")

---

Tags

googleimagegeolocationsilverstripemapmapsphotofileuploadgooglemapfield

### Embed Badge

![Health badge](/badges/zarocknz-silverstripe-geodata-uploadfield/health.svg)

```
[![Health](https://phpackages.com/badges/zarocknz-silverstripe-geodata-uploadfield/health.svg)](https://phpackages.com/packages/zarocknz-silverstripe-geodata-uploadfield)
```

###  Alternatives

[heyday/silverstripe-responsive-images

Configure and send a series of image size options to the client without loading any resources until a media query can be executed.

5387.7k6](/packages/heyday-silverstripe-responsive-images)[unclecheese/silverstripe-image-optionset

Provides a list of selectable items that use images as the primary label instead of text.

139.1k2](/packages/unclecheese-silverstripe-image-optionset)[chrometoaster/silverstripe-image-quality

Adds Quality function to images

1013.0k1](/packages/chrometoaster-silverstripe-image-quality)[dnadesign/silverstripe-lazyloaded-image

Implements the LQIP (Low Quality Image Placeholder) pattern powered by lazysizes

1011.4k4](/packages/dnadesign-silverstripe-lazyloaded-image)

PHPackages © 2026

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