« Back to Portlets

Google Maps Portlet

Introduction #

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

Miscelaneous Notes#

The Google Maps portlet has parallel rendering turn off by default b/c there conflicts between Google's API and Liferay's JavaScript.

0 Attachments
35171 Views
Average (0 Votes)
The average rating is 0.0 stars out of 5.
Comments
Threaded Replies Author Date
I'm using Liferay Portal Standard Edition 5.2.2... FELIPE IEDER April 3, 2009 7:32 AM
Sorry, my fault. I was talking about the Map... FELIPE IEDER April 3, 2009 8:09 AM
Is there a way to set the default view of... Franklin Antony March 16, 2010 5:30 AM
This is using the old Google API. Things have... Vishal Bhanderi December 25, 2010 4:13 AM
hi friends, can any body send me the google api... satya jangala February 25, 2013 11:00 PM

I'm using Liferay Portal Standard Edition 5.2.2 (Augustine / Build 5202 / February 20, 2009) and I cannot find the configuration options mentioned in this document. I tried by adding google.maps.license=myKey to portal-ext.properties but it didn't work either.

Any idea how to do it?
Thanks!
felipe
Posted on 4/3/09 7:32 AM.
Sorry, my fault. I was talking about the Map portlet - the one that shows where are all members of a given community.
Posted on 4/3/09 8:09 AM in reply to FELIPE IEDER.
Is there a way to set the default view of Google Maps to Statelite Mode? Only way I can think of is to call a custom JavaScript and set the view to whatever I want. But I wish something like that was already there.
Posted on 3/16/10 5:30 AM.
This is using the old Google API. Things have changed a lot since then. Is it possible to message me how I can commit to the svn? I want to create a new Google Maps portlet for Liferay.
Posted on 12/25/10 4:13 AM.
hi friends, can any body send me the google api code , i mean war or source code rar .....

please help me


Yours Satya
Posted on 2/25/13 11:00 PM in reply to Vishal Bhanderi.