Added a maximum auto-zoom level parameter.
This commit is contained in:
parent
e017b7351c
commit
aefa0cf848
|
@ -40,6 +40,7 @@ class Admin_EXIF_GPS_Controller extends Admin_Controller {
|
|||
|
||||
// Save settings to Gallery's database.
|
||||
module::set_var("exif_gps", "googlemap_api_key", $form->Global->google_api_key->value);
|
||||
module::set_var("exif_gps", "googlemap_max_autozoom", $form->Global->max_auto_zoom_level->value);
|
||||
module::set_var("exif_gps", "sidebar_zoom", $form->Sidebar->sidebar_default_zoom->value);
|
||||
module::set_var("exif_gps", "sidebar_mapformat", $form->Sidebar->sidebar_mapformat->value);
|
||||
module::set_var("exif_gps", "sidebar_maptype", $form->Sidebar->sidebar_maptype->value);
|
||||
|
@ -83,6 +84,9 @@ class Admin_EXIF_GPS_Controller extends Admin_Controller {
|
|||
->label(t("Google Maps API Key"))
|
||||
->value(module::get_var("exif_gps", "googlemap_api_key"))
|
||||
->rules("required");
|
||||
$gps_global_group->input("max_auto_zoom_level")
|
||||
->label(t("Maximum Auto-Zoom Level:"))
|
||||
->value(module::get_var("exif_gps", "googlemap_max_autozoom"));
|
||||
$checkbox_user["checkbox_user"] = array(t("Show \"Map this user\" icon?"), module::get_var("exif_gps", "toolbar_map_user"));
|
||||
$checkbox_album["checkbox_album"] = array(t("Show \"Map this album\" icon?"), module::get_var("exif_gps", "toolbar_map_album"));
|
||||
$gps_global_group->checklist("toolbar_map_album")
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
<script type="text/javascript" src="http://www.google.com/jsapi?key=<?= module::get_var("exif_gps", "googlemap_api_key"); ?>"></script>
|
||||
<script type="text/javascript">
|
||||
google.load("maps", "3",{"other_params":"sensor=false"});
|
||||
var google_zoom_hack = false;
|
||||
|
||||
function initialize() {
|
||||
var latlng = new google.maps.LatLng(0,0);
|
||||
var myOptions = {
|
||||
|
@ -33,6 +35,16 @@
|
|||
<? } else { ?>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
<? if (module::get_var("exif_gps", "googlemap_max_autozoom") != "") : ?>
|
||||
google.maps.event.addListener(map, 'zoom_changed', function() {
|
||||
if (google_zoom_hack) {
|
||||
if (map.getZoom() > 18) map.setZoom(18);
|
||||
google_zoom_hack = false;
|
||||
}
|
||||
});
|
||||
<? endif ?>
|
||||
|
||||
google_zoom_hack = true;
|
||||
map.fitBounds(glatlngbounds);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
<script type="text/javascript" src="http://www.google.com/jsapi?key=<?= module::get_var("exif_gps", "googlemap_api_key"); ?>"></script>
|
||||
<script type="text/javascript">
|
||||
google.load("maps", "3",{"other_params":"sensor=false"});
|
||||
var google_zoom_hack = false;
|
||||
|
||||
function initialize() {
|
||||
var latlng = new google.maps.LatLng(0,0);
|
||||
var myOptions = {
|
||||
|
@ -59,11 +61,21 @@
|
|||
google.maps.event.addListener(marker<?=$counter; ?>, 'click', function() {
|
||||
infowindow<?=$counter; ?>.open(map,marker<?=$counter; ?>);
|
||||
});
|
||||
|
||||
<? if (module::get_var("exif_gps", "googlemap_max_autozoom") != "") : ?>
|
||||
google.maps.event.addListener(map, 'zoom_changed', function() {
|
||||
if (google_zoom_hack) {
|
||||
if (map.getZoom() > 18) map.setZoom(18);
|
||||
google_zoom_hack = false;
|
||||
}
|
||||
});
|
||||
<? endif ?>
|
||||
|
||||
google_zoom_hack = true;
|
||||
map.fitBounds(glatlngbounds);
|
||||
}
|
||||
|
||||
google.setOnLoadCallback(initialize);
|
||||
|
||||
</script>
|
||||
|
||||
<div id="g-exif-map-header">
|
||||
|
|
Reference in New Issue
Block a user