Safari Bug - tiled images outside of viewport
See original GitHub issueHi,
I’m having an issue that seems to affect only Safari (using 10.1.1) and I think Edge too, but I’ve not tested as thoroughly on Edge yet.
I’m using addTiledImage for several images to create a sort of zoomable carousel. This is working great on Chrome and Firefox. Last I tested on IE11 it was okay too.
On Safari however, when zooming in and out, images will disappear and reappear. As far as I can tell if the image would be entirely in the viewport/canvas, it displays, the moment it hits the edge of the canvas, either by panning or by zooming, it seems to disappear entirely.
What should happen is it should just be clipped by the viewport.
I’ve stripped down our working site to the bare minimum to demonstrate the problem here:
http://files.onedarnleyroad.com/safari.html
Try in Safari, then in Chrome and see the difference. Use the input range to change zoom
Full source code of that link is here, aside from the CDN links and refs to placehold.it, it should work as is:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1">
<title>Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/openseadragon/2.2.1/openseadragon.js"></script>
<script>
$(function() {
var heroZoom = OpenSeadragon({
id: 'heroZoom',
prefixUrl: '',
showNavigationControl: false,
showNavigator: false,
defaultZoomLevel: 0.5,
gestureSettingsMouse: {
scrollToZoom: false,
clickToZoom: false
},
visibilityRatio: 1,
mouseNavEnabled: false,
// collectionMode: true,
// collectionRows: 1,
// collectionTileSize: 1,
// collectionTileMargin: config.tileMargin,
// Initialise with a transparent spacer
tileSources: [ {
type:"image",
url: 'http://placehold.it/1/ffffff/ffffff'
} ]
});
var xOffset = 1.1;
// This is adapted from our CMS output:
[0,1,2,3,4,5,6].forEach(function( i ) {
// First add a low image
heroZoom.addTiledImage({
tileSource: {
type: "image",
url: "http://placehold.it/3000x3000"
},
x: xOffset * (i),
y: 0,
width: 1,
opacity: 1,
index: 1,
collectionImmediately: true,
success: function( t ) {
}
});
});
var $zoomSlider = $('#carouselZoomControls');
$zoomSlider.on('input', function(e) {
heroZoom.viewport.zoomTo( $(this).val() / 100 );
$('#carouselZoomControlsAmount').text( $(this).val() );
});
});
</script>
</head>
<body>
<div style="width: 100%; height: 90vh;" id="heroZoom"></div>
<div class="interface">
<input type="range"
id="carouselZoomControls"
min="1"
max="100"
value="50"
step="1"
aria-valuemin="1"
aria-valuemax="100"
aria-valuenow="50">
<output class='visually-hidden' for="carouselZoomControls" id="carouselZoomControlsAmount">50</output>
</div>
</div>
</body>
</html>
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
@nathanedwards Okay, I think I’ve fixed it… please try #1222.
Excellent… thank you for confirming, and reporting in the first place 😃