Edit on GitHub
Jump to docs navigation

Field Types / Geolocation field

Note: You are currently reading the documentation for Bolt 3.4. Looking for the documentation for Bolt 3.5 instead?

A set of fields for easy selection of a geographic location. You can use the given address, the latitude, longitude, and the reverse geocoded address. To see the values that are stored, use {{ dump(page.geolocation) }}.

Note: This field requires a `google_api_key` key to be set in the main config as well as activating the "Google Maps JavaScript API" for your project on the Google Cloud Platform Console

Basic Configuration:

        location:
            type: geolocation

Example usage in templates:

To insert a simple map from Google with a marker at the given location, use:

<img src="https://maps.googleapis.com/maps/api/staticmap?center={{ record.location.latitude }},{{ record.location.longitude }}&zoom=14&size=617x300&sensor=false&markers={{ record.location.latitude }},{{ record.location.longitude }}">

More info about these static maps, can be found in the Static Maps API V2 Developer Guide. Of course, you can use the geolocation with any mapping service you like, since latitude and longitude is a common geographic coordinate system used by many services.

Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on IRC.