Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
rajiv jackz
How to implement Google Map in spring MVC portlet
May 22, 2011 8:53 PM
Answer

rajiv jackz

Rank: Junior Member

Posts: 92

Join Date: May 18, 2011

Recent Posts

HI all,

How to implement Google Map in spring MVC portlet, I have list of addresses in database

Thanks in advance!
Help me out here
Mika Koivisto
RE: How to implement Google Map in spring MVC portlet
May 26, 2011 10:38 AM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1501

Join Date: August 7, 2006

Recent Posts

You should refer to Google Maps API.
rajiv jackz
RE: How to implement Google Map in spring MVC portlet
May 26, 2011 6:51 PM
Answer

rajiv jackz

Rank: Junior Member

Posts: 92

Join Date: May 18, 2011

Recent Posts

thank u ..
Carlos Fdo. Afanador M.
RE: How to implement Google Map in spring MVC portlet
September 24, 2012 3:01 PM
Answer

Carlos Fdo. Afanador M.

Rank: New Member

Posts: 14

Join Date: June 26, 2009

Recent Posts

Hi Mika...

I'm wondering if you can help me with this issue. I'm trying to build a portlet in LF 6.1 as a plugin liferay ide and the simplest way of use the google map api v3 didn't not work for me...i have a portlet using Liferay MVC.

In a simple jsp (and all the portlet is just this lines :S) i have:

 1
 2<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=my_key&sensor=false" ></script>
 3<script type="text/javascript">
 4
 5AUI().ready('event', 'node', function(A){
 6    var mapOptions = {
 7            center: new google.maps.LatLng(-34.397, 150.644),
 8            zoom: 8,
 9            mapTypeId: google.maps.MapTypeId.SATELLITE
10    };
11    var map = new google.maps.Map(A.one("#<portlet:namespace />map"), mapOptions);
12});
13   
14</script>
15<aui:form name="fm">
16    <aui:fieldset>
17        <aui:layout>
18            <div class="maps-content" id="<portlet:namespace />map"></div>
19        </aui:layout>
20    </aui:fieldset>
21</aui:form>


Thanks in advance!!
Mika Koivisto
RE: How to implement Google Map in spring MVC portlet
September 26, 2012 3:30 PM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1501

Join Date: August 7, 2006

Recent Posts

A.one() returns a Node object so you might need to call .getDOM() on it like this:
1var map = new google.maps.Map(A.one("#<portlet:namespace />map").getDOM(), mapOptions);
Carlos Fdo. Afanador M.
RE: How to implement Google Map in spring MVC portlet
September 26, 2012 7:02 PM
Answer

Carlos Fdo. Afanador M.

Rank: New Member

Posts: 14

Join Date: June 26, 2009

Recent Posts

Hi Mika....

I'm really grateful to you for your help, i think that is an advance, but something really strange is happening; then i will attach to you an image that show the portlet and as you can see the div have the entire information of the map, but for some reasson that information isn't displayed; i don´t have any UI experience so i don't know what may be going...

Once again, thanks a lot!
Attachment

Attachments: Untitled.png (545.7k)
Mika Koivisto
RE: How to implement Google Map in spring MVC portlet
October 2, 2012 12:15 PM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1501

Join Date: August 7, 2006

Recent Posts

The surrounding div the one you've highlighted might need width and height. I'm also more of a backend guy so I really don't know what's going in wrong.
Carlos Fdo. Afanador M.
RE: How to implement Google Map in spring MVC portlet
October 9, 2012 9:15 AM
Answer

Carlos Fdo. Afanador M.

Rank: New Member

Posts: 14

Join Date: June 26, 2009

Recent Posts

Hi Mika....

Thanks a lot for your unselfish help, i will post here if i have some progress related to this issue.