Google Maps Portlet
This article describes how to use the Google Maps Portlet.
When you load the Google Maps Portlet, you might get a message that reads "Please contact the administrator to configure a Google license."
Get and set up a Google License #
You can get a license key from Google from here: http://www.google.com/apis/maps/signup.html
Note that Google requires a domain name to activate the key. For development you can specify "http://localhost" and that will allow you to get a key that will work in a local environment.
Once you have the license you have to tell Liferay about it. The exact details depend on the version of Liferay you are using
Liferay 4.3 and previous #
Once you add the Google license key to the portal properties file, you should get a default map location.
In portal.properties, here's the location to add your Google license key:
## ## Google License Keys ## # # Enter a valid Google Maps license key for your domain. See # http://www.google.com/apis/maps for more information. # google.maps.license=
Liferay 4.4 and later #
Starting with Liferay 4.4 it's possible to have a different Google key per portlet instance. That allows community administrators to have their own maps keys and not depend on system administrators.
Once you have the key, click the configuration icon and enter the Google key in the text input box.
Configuration options #
The configuration form also has the following options:
- Map Address: The place where the map will be centered. Example: Madrid, Spain
- Map Input Enabled: Whether users will be shown a search input box to do their own searches for locations
- Directions Address: The default address to show in the input box to get directions on how to get to the address specified in "Map Address". Note that this option does not produce any visible result if you leave the next box unchecked.
- Directions Input Enabled: Whether users will be shown an input box to specify an start address from which to get directions on how to get to the address specified in "Map Address".
- Height: the height in pixels of the map