This addon enhances Cockpit CMS by providing two new field types (googlemap and googlemapiframe) that can be used to handle easily google maps information.
Download and unpack addon to <cockpit-folder>/addons/GoogleMapsField
folder.
You need to have a google map api key and configure it in config.yaml:
google:
maps:
api_key: xxxxxxx_GMAPS_API_KEY_xxxxxxxxx
The field to be used by non admin users requires a permission defined at the group level, e.g.:
groups:
editor:
googlemapsfield:
access: true
Having a new field in your collection you only need to type something or drag the marker:
Its possible to provide extra details (e.g. marker title, infowindow text)
And the resulting json that can be used in the frontend:
The field works basically as a container/validator for a google embeded url (iframe), providing the possibility to preview the url:
And the resulting field json:
Copyright 2019 pauloamgomes under the MIT license.