Skip to content
Snippets Groups Projects
Commit 6a80c04c authored by Daemon_Byte's avatar Daemon_Byte Committed by podarok
Browse files

Issue #2366821 by Daemon_Byte: Fixed issues with clustering and popups.

parent c3ea8872
No related branches found
Tags 7.x-2.10-rc1
No related merge requests found
......@@ -61,26 +61,16 @@ Clusterer.origFunctions = {};
Clusterer.origFunctions.PopUp = Clusterer.PopUp;
Clusterer.PopUp = function (cluster) {
var mode = Drupal.settings.gmap_markermanager.popup_mode;
if (mode === 'orig') {
return Clusterer.origFunctions.PopUp(cluster);
}
else if (mode === 'zoom') {
var bounds = new GLatLngBounds();
for (var k in cluster.markers)
bounds.extend(cluster.markers[k].getPoint());
var sw = bounds.getSouthWest();
var ne = bounds.getNorthEast();
var rect = [
sw,
new GLatLng(sw.lat(), ne.lng()),
ne,
new GLatLng(ne.lat(), sw.lng()),
sw
];
var center = bounds.getCenter();
var zoom = cluster.clusterer.map.getBoundsZoomLevel(bounds);
cluster.clusterer.map.setCenter(new GLatLng(+center.lat(), +center.lng()), +zoom);
var bounds = new google.maps.LatLngBounds();
for (var k in cluster.markers) {
bounds.extend(cluster.markers[k].getPosition());
}
cluster.clusterer.map.fitBounds(bounds);
}
};
};
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment