Browse Source

Add current timestamp as query string to GeoJSON path to bypass browser cache. #13

opi 9 years ago
parent
commit
dc29fbf29f
2 changed files with 4 additions and 2 deletions
  1. 2 1
      assets/form.js
  2. 2 1
      assets/map.js

+ 2 - 1
assets/form.js

@@ -41,7 +41,8 @@ $( document ).ready(function() {
 
     // Display tiny circles on existing public points
     var GeoJsonPath = $('#map').data('json');
-    $.getJSON(GeoJsonPath, function(data){
+    // We add current time to bypass browser cache
+    $.getJSON(GeoJsonPath + '?time=' + Date.now(), function(data){
         var featureLayer = L.geoJson(data, {
             pointToLayer: function (feature, latlng) {
                 return L.circleMarker(latlng, {color: '#00B300'});

+ 2 - 1
assets/map.js

@@ -41,7 +41,8 @@ $( document ).ready(function() {
 
     // Get JSON
     var GeoJsonPath = $('#map').data('json')
-    $.getJSON(GeoJsonPath, function(data){
+    // We add current time to bypass browser cache
+    $.getJSON(GeoJsonPath + '?time=' + Date.now(), function(data){
 
         function buildPopupContent(feature, layer) {
             feature.properties.popupContent = '';