Map Field

This Extra Field Type is available in Profile Builder 2.0, Hobbyist or Pro.

You can use this extra field type to allow users to pin their location.
You can specify the field title, meta-name to be stored in the database, description, Google Maps Api Key, default latitude, default longitude, default zoom level and map height.
Also, you can set whether this field should be required or not.

Profile Builder - Map Field Back End

This is how it looks like in the front-end.

Profile Builder - Map Field Front End

How to create your Google Maps API Key

First you will need to login into your Google account and then access Google Developers Console. Here you will be able to Register your application for Google Maps JavaScript API.

Profile Builder - Map Field - Google Map API Key

We will select to Create a new project and click on Continue.

Profile Builder - Map Field - Google Map Enabled API Key

Now the API is enabled for our project. We have to create credentials so we will click on “Go to credentials”.

Profile Builder - Map Field - Google Map Add Credentials

We will select Google Maps JavaScript API that will be called from a Web browser (Javascript). We need to click on “What credentials do I need?” to continue.

Profile Builder - Map Field - Google Map Create an API Key

We can give our API Key a Name like Google Map API Key. Also, we can add multiple HTTP referrers so that we can limit map loading only for these URLs. If you wish to allow an entire domain to load the Google Maps you can add an asterix at the end of the URL.

http://www.yourdomain.com/*

If we don’t add a HTTP referrer, requests will be accepted from any referrer (domain). To continue we have to click on “Create API key”

Profile Builder - Map Field - Google Map Get Your Credentials

Our API Key is now Created. Copy and Paste it in Profile Builder -> Manage Fields -> Map Field -> Google Maps API Key. To finish the process and go to API Manager click on “Done”.

Profile Builder - Map Field - Google Map API Manager

Enable Google Maps JavaScript API

Profile Builder - Map Field - Google Map JavaScript API

To enable Google Maps JavaScript API we have to go to Google APIs -> API Manager -> Overview -> And click on Google Maps JavaScript API.

Profile Builder - Map Field - Google Map Enable JavaScript API