Complete de-globalization of map
authorJohn Firebaugh <john.firebaugh@gmail.com>
Tue, 11 Jun 2013 22:15:41 +0000 (15:15 -0700)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Thu, 18 Jul 2013 17:45:13 +0000 (10:45 -0700)
app/assets/javascripts/index.js
app/assets/javascripts/index/browse.js
app/assets/javascripts/index/notes.js.erb

index 184b57419770a5d750bb5456d5be4b5bfec275ee..c9316ebae2df558d6a2d5b30ce23a96e929989cb 100644 (file)
@@ -145,6 +145,9 @@ $(document).ready(function () {
   if (!("autofocus" in document.createElement("input"))) {
     $("#query").focus();
   }
+
+  initializeBrowse(map);
+  initializeNotes(map);
 });
 
 function getMapBaseLayerId(map) {
index 8681d8f56658bba1bc91b930621fb8621711ca4a..e98e56b2797c0e468eb0a7ac4c646b8390e4dd6e 100644 (file)
@@ -2,7 +2,7 @@
 //= require templates/browse/feature_list
 //= require templates/browse/feature_history
 
-$(document).ready(function () {
+function initializeBrowse(map) {
   var browseBounds;
   var layersById;
   var selectedLayer;
@@ -327,4 +327,4 @@ $(document).ready(function () {
     $("#browse_status").html("");
     $("#browse_status").hide();
   }
-});
+}
index 81d6042c707b28656caaee85d7b5804a3fe74348..1646e8b6d2a83680a3719d3e421e5f567d58a9de 100644 (file)
@@ -1,7 +1,7 @@
 //= require templates/notes/show
 //= require templates/notes/new
 
-$(document).ready(function () {
+function initializeNotes(map) {
   var params = OSM.mapParams(),
       noteLayer = new L.LayerGroup({code: 'N'}),
       notes = {},
@@ -268,4 +268,4 @@ $(document).ready(function () {
       e.target.openPopup();
     });
   });
-});
+}