Merged pull request #1 from niaxilin/master.
exif_gps: Fixed googlemap_max_autozoom not having desired effect.
This commit is contained in:
commit
c8821221aa
@ -35,14 +35,14 @@
|
||||
<? } else { ?>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
<? if (module::get_var("exif_gps", "googlemap_max_autozoom") != "") : ?>
|
||||
<? if (($max_autozoom = module::get_var("exif_gps", "googlemap_max_autozoom")) != "") : ?>
|
||||
// If there is a maximum auto-zoom value, then set up an event to check the zoom
|
||||
// level the first time it is changed, and adjust it if necessary.
|
||||
// (if we call map.getZoom right after .fitBounds, getZoom will return the initial
|
||||
// zoom level, not the auto zoom level, this way we get the auto zoomed value).
|
||||
google.maps.event.addListener(map, 'zoom_changed', function() {
|
||||
if (google_zoom_hack) {
|
||||
if (map.getZoom() > 18) map.setZoom(18);
|
||||
if (map.getZoom() > <?= $max_autozoom ?>) map.setZoom(<?= $max_autozoom ?>);
|
||||
google_zoom_hack = false;
|
||||
}
|
||||
});
|
||||
|
@ -62,14 +62,14 @@
|
||||
infowindow<?=$counter; ?>.open(map,marker<?=$counter; ?>);
|
||||
});
|
||||
|
||||
<? if (module::get_var("exif_gps", "googlemap_max_autozoom") != "") : ?>
|
||||
<? if (($max_autozoom = module::get_var("exif_gps", "googlemap_max_autozoom")) != "") : ?>
|
||||
// If there is a maximum auto-zoom value, then set up an event to check the zoom
|
||||
// level the first time it is changed, and adjust it if necessary.
|
||||
// (if we call map.getZoom right after .fitBounds, getZoom will return the initial
|
||||
// zoom level, not the auto zoom level, this way we get the auto zoomed value).
|
||||
google.maps.event.addListener(map, 'zoom_changed', function() {
|
||||
if (google_zoom_hack) {
|
||||
if (map.getZoom() > 18) map.setZoom(18);
|
||||
if (map.getZoom() > <?= $max_autozoom ?>) map.setZoom(<?= $max_autozoom ?>);
|
||||
google_zoom_hack = false;
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user