Fórum

How to implement Google Map in spring MVC portlet

rajiv jackz, modificado 12 Anos atrás.

How to implement Google Map in spring MVC portlet

Junior Member Postagens: 92 Data de Entrada: 19/05/11 Postagens Recentes
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
thumbnail
Mika Koivisto, modificado 12 Anos atrás.

RE: How to implement Google Map in spring MVC portlet

Liferay Legend Postagens: 1519 Data de Entrada: 07/08/06 Postagens Recentes
You should refer to Google Maps API.
rajiv jackz, modificado 12 Anos atrás.

RE: How to implement Google Map in spring MVC portlet

Junior Member Postagens: 92 Data de Entrada: 19/05/11 Postagens Recentes
thank u ..
Carlos Fdo. Afanador M., modificado 11 Anos atrás.

RE: How to implement Google Map in spring MVC portlet

New Member Postagens: 14 Data de Entrada: 26/06/09 Postagens Recentes
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:


<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=my_key&amp;sensor=false"></script>
<script type="text/javascript">

AUI().ready('event', 'node', function(A){
	var mapOptions = {
			center: new google.maps.LatLng(-34.397, 150.644),
		    zoom: 8,
		    mapTypeId: google.maps.MapTypeId.SATELLITE
	};
	var map = new google.maps.Map(A.one("#<portlet:namespace />map"), mapOptions);
});
	
</script>
<aui:form name="fm">
	<aui:fieldset>
		<aui:layout>
			<div class="maps-content" id="<portlet:namespace />map"></div>
		</aui:layout>
	</aui:fieldset>
</aui:form>


Thanks in advance!!
thumbnail
Mika Koivisto, modificado 11 Anos atrás.

RE: How to implement Google Map in spring MVC portlet

Liferay Legend Postagens: 1519 Data de Entrada: 07/08/06 Postagens Recentes
A.one() returns a Node object so you might need to call .getDOM() on it like this:
var map = new google.maps.Map(A.one("#<portlet:namespace />map").getDOM(), mapOptions);
Carlos Fdo. Afanador M., modificado 11 Anos atrás.

RE: How to implement Google Map in spring MVC portlet

New Member Postagens: 14 Data de Entrada: 26/06/09 Postagens Recentes
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!
thumbnail
Mika Koivisto, modificado 11 Anos atrás.

RE: How to implement Google Map in spring MVC portlet

Liferay Legend Postagens: 1519 Data de Entrada: 07/08/06 Postagens Recentes
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., modificado 11 Anos atrás.

RE: How to implement Google Map in spring MVC portlet

New Member Postagens: 14 Data de Entrada: 26/06/09 Postagens Recentes
Hi Mika....

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