Skip to content

Commit

Permalink
10083: Condition on Mapping Service Question seems to apply to all fo…
Browse files Browse the repository at this point in the history
…llowing questions

Dev Added a listener to reset the map tiles when question is shown
  • Loading branch information
tpartner committed Dec 9, 2015
1 parent ebd056b commit 6d9c2c9
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions scripts/map.js
Expand Up @@ -221,6 +221,35 @@ function OSGeoInitialize(question,latLng){
$( this ).removeClass( "searching" );
}
});

var mapQuestion = $('#question'+name.split('X')[2]);

function resetMapTiles(mapQuestion) {

//window.setTimeout(function(){

if($(mapQuestion).css('display') == 'none' && $.support.leadingWhitespace) { // IE7-8 excluded (they work as-is)
$(mapQuestion).css({
'position': 'relative',
'left': '-9999em'
}).show();
map.invalidateSize();
$(mapQuestion).css({
'position': 'relative',
'left': 'auto'
}).hide();
}

//},50);
}

resetMapTiles(mapQuestion);

jQuery(window).resize(function() {
window.setTimeout(function(){
resetMapTiles(mapQuestion);
},5);
});

return map;

Expand Down

0 comments on commit 6d9c2c9

Please sign in to comment.