Bug reports Found a bug? Post it here please.
Version 7.x > Bug reports > Basic Google Maps InfoWindow View modes: 
User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 12/31/2012 11:26:10 AM
   
Basic Google Maps InfoWindow
When placing multiple points on a single BasicGoogleMap webpart, when you click each of the points to bring up the info window, it does not close the previous one (default action with Google Maps). When I looked into the JavaScript (CMSWebParts\Mapx\Basic\BasicGoogleMaps_Files\GoogleMap.js the addGoogleMarker() function creates a new instance of the InfoWindow each time vs, just setting the content. I'm guessing this is by design/default although it should function as Google Maps does.

Here is the code I used and it worked perfect:
// Create a single info window object
var wname = new google.maps.InfoWindow({});
function addGoogleMarker(map, latitude, longitude, title, content, zoom, iconURL) {
// Initialize point coordinates
var point = new google.maps.LatLng(latitude, longitude);
// Create Marker object
var marker = new google.maps.Marker({
map: map,
position: point,
title: title,
icon: iconURL
});
// Register click event
google.maps.event.addListener(marker, 'click', function() {
map.setCenter(point);
var oZoom = map.getZoom();
if (oZoom != zoom) { map.setZoom(zoom); }
// set the content when clicked
wname.setContent(content);
wname.open(map, marker);
});
}

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 1/2/2013 3:17:11 AM
   
RE:Basic Google Maps InfoWindow
Hi,

Thank you for your suggestion. We will consider this update for a future version of Kentico CMS. I've already noticed our development team about your modification :)

Best regards,
Martin Danko