<rich:gmap bug?
schlumsch Mar 9, 2009 10:18 AMHi,
i`m using <rich:gmap to show some locations within my portlet (portal mode). Up to now my portlet had only one jsf-page which was shown when the user entered the portlet. The Gmap worked fine.
What I`m doing now is calling the map-containing page from another jsf-page with the effect, that gmap is not shown. Ive only got a blank white screen with browser-output "reading maps.google.com" ... nothing happens. I already switched to the actual richfaces-libs. For testing, I also created a jsf-page that contains no other elements than the map... the porblem stays the same.
Does anyone got the same problem or could help me findung a solution?
Thanx a lot, here some parts of my code:
<a4j:commandLink action="#{e2e.planningResults.move2Hotel}" rendered="#{appointment.hotelSegment}">
<h:outputText value="#{appointment.modifiedType}"/>
<a4j:actionparam name="selectedSegmentIndex" value="#{appointment.positionInItinerary}"
assignTo="#{e2e.planningResults.selectedSegmentIndex}"/>
</a4j:commandLink>
<rich:gmap id="gm2" lat="#{e2e.hotel.MAP_LATTIDUDE_INITIAL}"
lng="#{e2e.hotel.MAP_LONGTIDUDE_INITIAL}"
zoom="#{e2e.hotel.MAP_ZOOM_INITIAL}" gmapVar="map2"
gmapKey="#{e2e.hotel.googleKey}"
style="#{e2e.hotel.MAP_STYLE}" oninit="initializePoints(); initializePointsAppointment()">
</rich:gmap>
jsvascripts:
function createPoints(data) {
for (var i = 0; data.length; i++) {
var point = new GLatLng(data.latitude, data.longitude);
map2.setZoom(11);
map2.addOverlay(createMarkerWithIdentifier(point, data.anzeigeid, data.name, data.sterne, data.entfernungsDifferenz));
}
}
function createMarkerWithIdentifier(point, id, name, sterne, entfernungsDifferenz) {
var nummer = id;
var ausgabestring = name +",<br>" + sterne + " Strene,<br>" + entfernungsDifferenz + " km zum Termin";
var idIcon = new GIcon(baseIcon);
idIcon.image = "http:/......./marker" + id + ".png";
markerOptions = { icon:idIcon };
var marker = new GMarker(point, markerOptions);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(ausgabestring);
});
return marker;
}
function createMarkerWithIdentifierAppointment(point, name, strasse) {
var aString = name +",<br>" + strasse;
var idIcon = new GIcon(baseIcon);
idIcon.image = "http://server11117.isdg.de/images/mapicons/markert.png";
markerOptions = { icon:idIcon };
var marker = new GMarker(point, markerOptions);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(aString);
});
return marker;
}
//]]>
</script>
<a4j:jsFunction name="initializePoints" data="#{e2e.hotel.hotels_s}"
oncomplete="createPoints(data)">
</a4j:jsFunction>