diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-07-22 17:33:00 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-07-22 17:33:00 +0100 |
commit | 2a64bd4aa8cc0b38c1c728ba84d0b06725691100 (patch) | |
tree | 5d2964ae1806ca022268ddeec29cda4a315d688e /web | |
parent | 03388de7ea81464024abb23e8579e4d9dcfd5555 (diff) |
Delay vector loading until onload in IE only.
Diffstat (limited to 'web')
-rw-r--r-- | web/js/map-OpenLayers.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 6b4a03d7e..d00079517 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -41,6 +41,15 @@ $(function(){ return false; }); + // Vector layers must be added onload as IE sucks + if ($.browser.msie) { + $(window).load(fixmystreet_onload); + } else { + fixmystreet_onload(); + } +}); + +function fixmystreet_onload() { if ( fixmystreet.area ) { var area = new OpenLayers.Layer.Vector("KML", { strategies: [ new OpenLayers.Strategy.Fixed() ], @@ -96,8 +105,7 @@ $(function(){ var bounds = fixmystreet.markers.getDataExtent(); if (bounds) { fixmystreet.map.zoomToExtent( bounds ); } } - -}); +} function fms_markers_list(pins, transform) { var cols = { 'red':'R', 'green':'G', 'blue':'B', 'purple':'P' }; |