diff options
author | pezholio <pezholio@gmail.com> | 2017-03-17 16:36:24 +0000 |
---|---|---|
committer | pezholio <pezholio@gmail.com> | 2017-03-17 16:36:24 +0000 |
commit | 5370647bfa52503948148753bad7bca5c463d79c (patch) | |
tree | 55865dae808167a0cc51fbd8478dcb23d0770065 /web/js/map-OpenLayers.js | |
parent | 013710b997f74da134bc9f6f7896fddae4a38879 (diff) |
Show loading indicator when loading pins
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r-- | web/js/map-OpenLayers.js | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 49801911b..2a5af940d 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -801,6 +801,9 @@ OpenLayers.Strategy.FixMyStreetFixed = OpenLayers.Class(OpenLayers.Strategy.Fixe // params to /ajax if the user has filtered the map. OpenLayers.Protocol.FixMyStreet = OpenLayers.Class(OpenLayers.Protocol.HTTP, { read: function(options) { + // Show the loading indicator over the map + $('#loading-indicator').removeClass('hidden'); + $('#loading-indicator').attr('aria-hidden', false); // Pass the values of the category, status, and sort fields as query params $.each({ filter_category: 'filter_categories', status: 'statuses', sort: 'sort' }, function(key, id) { var val = $('#' + id).val(); @@ -817,17 +820,9 @@ OpenLayers.Protocol.FixMyStreet = OpenLayers.Class(OpenLayers.Protocol.HTTP, { /* Pan data handler */ OpenLayers.Format.FixMyStreet = OpenLayers.Class(OpenLayers.Format.JSON, { read: function(json, filter) { - // Check we haven't received the data after the map has been clicked. - if (fixmystreet.page == 'new') { - // If we have, we want to do nothing, which means returning an - // array of the back-projected version of the current pin - var pin = fixmystreet.markers.features[0].clone(); - pin.geometry.transform( - fixmystreet.map.getProjectionObject(), - new OpenLayers.Projection("EPSG:4326") - ); - return [ pin ]; - } + // Remove loading indicator + $('#loading-indicator').addClass('hidden'); + $('#loading-indicator').attr('aria-hidden', true); if (typeof json == 'string') { obj = OpenLayers.Format.JSON.prototype.read.apply(this, [json, filter]); } else { |