gurucomkz/geopicker

Geolocation Picker field for SilverStripe

Installs: 28

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

v0.2.1 2021-12-20 09:52 UTC

This package is auto-updated.

Last update: 2024-03-20 15:38:40 UTC


README

Provides a GeoLocation (for coordinates) field editable with a map.

Uses Google Places API to display the map.

Enable Places API & Maps JavaScript API

Maps JavaScript API is used to display the map.

Places API is used to let you find things there by typing an address.

Check out the following links to get it working

Then put the key into your .env file:

PLACES_API_KEY="the-key"

Usage

class Foo extends DataObject {
    private static $db = [
        'Location' => 'GeoLocation',
    ];
}
# OR
class Foo extends DataObject {
    private static $db = [
        'Location' => DBGeoLocation::class,
    ];
}

You can then refer to it as

$obj->Location->Latitude;
$obj->Location->Longitude;