From ccaec98a139761cf528eef0b1ac5bfc129419bde Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Wed, 16 Mar 2016 12:01:56 -0400 Subject: [PATCH] fixed zoom issue by adding code that ensures zoom is not > 15 --- footer.php | 4 ++-- js/app.js | 9 +++++++-- js/custom/google-map.js | 9 +++++++-- scss/_main.scss | 1 + 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/footer.php b/footer.php index 41359de..1aebd5a 100644 --- a/footer.php +++ b/footer.php @@ -6,9 +6,9 @@

Getting Here

-
+
diff --git a/js/app.js b/js/app.js index 073515b..477487b 100644 --- a/js/app.js +++ b/js/app.js @@ -28,7 +28,7 @@ var g=a(f(this.selector(c),a("
").html(c.attr("title")).html())),h=thi Map._map = new google.maps.Map(canvas, myOptions); Map._latLngBounds = new google.maps.LatLngBounds(); Map._infoWindow = new google.maps.InfoWindow; - Map._map.setZoom(14); + $.get(mydir + "map.xml", Map._loadData, 'xml'); }, @@ -82,7 +82,11 @@ var g=a(f(this.selector(c),a("
").html(c.attr("title")).html())),h=thi Map._latLngBounds.getCenter() ); Map._map.fitBounds(Map._latLngBounds); - + google.maps.event.addListenerOnce(Map._map, 'bounds_changed', function(event) { + if (this.getZoom() > 15) { + this.setZoom(13); + } + }); if (typeof glm_searchMapIconActive !== "undefined" && glm_searchMapIconActive) { $(".map-link").click(function (){ var linkId = $(this).attr("rel"); @@ -112,6 +116,7 @@ var g=a(f(this.selector(c),a("
").html(c.attr("title")).html())),h=thi } }); }); + Map._map.setZoom(13); } }; diff --git a/js/custom/google-map.js b/js/custom/google-map.js index 468330e..1f70b77 100644 --- a/js/custom/google-map.js +++ b/js/custom/google-map.js @@ -19,7 +19,7 @@ var Map = { Map._map = new google.maps.Map(canvas, myOptions); Map._latLngBounds = new google.maps.LatLngBounds(); Map._infoWindow = new google.maps.InfoWindow; - Map._map.setZoom(14); + $.get(mydir + "map.xml", Map._loadData, 'xml'); }, @@ -73,7 +73,11 @@ var Map = { Map._latLngBounds.getCenter() ); Map._map.fitBounds(Map._latLngBounds); - + google.maps.event.addListenerOnce(Map._map, 'bounds_changed', function(event) { + if (this.getZoom() > 15) { + this.setZoom(13); + } + }); if (typeof glm_searchMapIconActive !== "undefined" && glm_searchMapIconActive) { $(".map-link").click(function (){ var linkId = $(this).attr("rel"); @@ -103,6 +107,7 @@ var Map = { } }); }); + Map._map.setZoom(13); } }; diff --git a/scss/_main.scss b/scss/_main.scss index 84fb686..f094ed7 100644 --- a/scss/_main.scss +++ b/scss/_main.scss @@ -53,3 +53,4 @@ main { display: none; } + -- 2.17.1