« 返回到 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 附件
73807 查看
平均 (0 票)
满分为 5,平均得分为 0.0。
评论
讨论主题回复 作者 日期
I'm using Liferay Portal Standard Edition 5.2.2... FELIPE IEDER 2009年4月3日 上午7:32
Sorry, my fault. I was talking about the Map... FELIPE IEDER 2009年4月3日 上午8:09
Is there a way to set the default view of... Franklin Antony 2010年3月16日 上午5:30
This is using the old Google API. Things have... Vishal Bhanderi 2010年12月25日 上午4:13
hi friends, can any body send me the google api... satya jangala 2013年2月25日 下午11:00

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
在 09-4-3 上午7:32 发帖。
Sorry, my fault. I was talking about the Map portlet - the one that shows where are all members of a given community.
在 09-4-3 上午8:09 发帖以回复 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.
在 10-3-16 上午5:30 发帖。
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.
在 10-12-25 上午4:13 发帖。
hi friends, can any body send me the google api code , i mean war or source code rar .....

please help me


Yours Satya
在 13-2-25 下午11:00 发帖以回复 Vishal Bhanderi