Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 887 Bytes

README.md

File metadata and controls

22 lines (17 loc) · 887 Bytes

Simple Silverstripe Latlong Field

Screenshot 2021-02-27 at 16 22 59

CMS editor can type street address, then click search. A (draggable) pointer will be shown on a map and the field's content will be replaced with the LatLong code. Originally abstracted from the mappable module (I think).

Requirements

SilverStripe 4.0 or higher SS3-4 upgrade: moved LatLongField::google_maps_api_key to environment var (see Config below)

Config

.env:
GMAPS_API_KEY="..."
GMAPS_BROWSER_KEY="..." (optional secondary 'public' key to use in the browser)

Provides global $GMapsApiKey template variable

<img src="//maps.googleapis.com/maps/api/staticmap?center=Leiden+NL&size=600x600&key=$GMapsApiKey" />