Moved "Loading..." message so it doesn't cause a problem for mobile.
authorChuck Scott <cscott@gaslightmedia.com>
Fri, 16 Dec 2016 21:59:12 +0000 (16:59 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Fri, 16 Dec 2016 21:59:12 +0000 (16:59 -0500)
views/front/nearme/index.html

index c66a20d..b3c1a7f 100644 (file)
@@ -20,7 +20,7 @@
         <a id="glmMapSetMyLocation" class="button button-secondary glm-member-button-small glm-hidden">Set My Location Here</a>&nbsp;
         <a id="glmMapGoToMyLocation" class="button button-secondary glm-member-button-small">Return to My Location</a>&nbsp;
         <a id="glmMapBack" class="button button-secondary glm-member-button-small glm-hidden">Back to previous map location</a>&nbsp;
-        <span id="glmMapReload" class="glm-hidden glm-right">Loading ...</span>
+        <span id="glmMapReload" class="glm-hidden">Loading ...</span>
     </div>
     <div id="glm-nearmeMap" class="glm-map-tall">(map loads here)</div>
     <div id="glm-mapLegend" style="margin: .4em;">
@@ -71,7 +71,7 @@
             var refLon = {$refLon};             // Default location for My Location marker - Lon
             var maxAnywhereZoom = 14;           // Max zoom in when doing anywhere search
             var boundsTimeout = 1500;           // Time to wait after a map move or zoom before trying to load new POIs in milliseconds
-            var trackPositionInterval = 60000;  // Time interval for getting user's current geolocation - 1 Min
+            var trackPositionInterval = 10000;  // Time interval for getting user's current geolocation - 1 Min
             var highAccuracyPoisition = false;  // Request high-accuracy user geolocation from user's device
             var postionTimeout = 15000;         // Maximum amount of time we'll wait for geolocation result - 15 Sec
             var geolocationFailCount = 2;       // Allow geolocation to fail this many times before switching to manual location settings ('set')
             var geolocationFailCounter = 0;
             var stopGeolocation = false;
             var noProcessAfterZoom = false;
+            
                         
             function initMap() {
                 
                         content: 'My Selected Location'
                     });
                     mapTitle.open(map, this);
-                        
+                    
+
                 });
                 
                 myMarker.addListener('mouseout', function() {
                     }
                     mapTitle.close();
                     checkNewPOIs();
+                    
                 });
 
                 myMarker.addListener('dragstart', function() {
                     dragging = true;
                     mapTitle.close();
                     window.clearTimeout(boundsDelayTimer);
+                    
                 });
 
                 myMarker.addListener('dragend', function() {
                     
                     dragging = false;
                     checkNewPOIs();
+                    
                 });
 
                 // Request update for points of interest when map dragging stops.
                     if (trackToConsole) { console.log('GLM NearMe: map dragend'); }
                     
                     checkNewPOIs();
+
                 });
                 
                 // Request update for points of interest when map zoom changes.
                 
                 // Set timer to get POIs
                 boundsDelayTimer = window.setTimeout(getBoundsPOIs, timeout, resetPOIs, anywhere);
-
+                
             }
             
             /* 
              *                  Not needed for type 'anywhere' - full reset is assumned
              */
             function getBoundsPOIs(resetPOIs = false, anywhere = false) {
-
+                 
                 if (trackToConsole) { console.log('GLM NearMe: getBoundsPOIs() '); }
                 
                 var searchText = $('#glmNearMeSearchText').val();
                     if (trackToConsole) { console.log('GLM NearMe: No map change, aborting getBoundsPOIs()'); }
                     
                     hideLoadingMsg();
+                    
                     return;
                 }
              
@@ -565,7 +572,7 @@ if (trackToConsole) { console.log('GLM NearMe: Number of markers remaining = '+O
                                         });
                                         
                                         mapTitle.open(map, this);
+                                        
                                 });
                                 
                                 marker.addListener('mouseout', function() {
@@ -575,7 +582,6 @@ if (trackToConsole) { console.log('GLM NearMe: Number of markers remaining = '+O
                                 // Add a click listener for this marker
                                 marker.addListener('click', function() {
                              
-                                    
                                     var infotext = '<h4 style="white-space: nowrap;">'+value.name+'</h4>';
                                     var stateComma = '';
                                     
@@ -692,7 +698,7 @@ if (trackToConsole) { console.log('GLM NearMe: Number of markers remaining = '+O
                 );
                 
                 saveCurrentBounds();
-                    
+                
             }
 
             // Save current bounds as last bounds