Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
Openseadragon - Load & remove additional tiled images when zooming in / out

is there any example on how to load & remove additional tiled images when zooming in / out? This way the browser would only have to handle a subset of tiled images (reduced level of detail) & might be more performant.

I tried to figure out how to do this. Its a shame, that I do not have the programming skills to do that :( I ended up with this:

viewer.addTiledImage({
        tileSource: 'g2.dzi',
        x: 0.2,
        y: 0.1,
        width: 0.01,
            opacity: 0
           });  

viewer.addHandler('bookmark-url-change', function(event) {  
  var zoom = viewer.viewport.getZoom();
  if (zoom >= 2) {
        viewer.world.getItemAt().setOpacity(1)
  } else if (zoom < 2) {
        viewer.world.getItemAt().setOpacity(0)
  }
  });

It would be great, if you could help me to get it right. Thanks!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This should work:

// Before this presumably you have made a viewer with a single image.

viewer.addTiledImage({
  tileSource: 'g2.dzi',
  x: 0.2,
  y: 0.1,
  width: 0.01,
  opacity: 0
 });  

viewer.addHandler('zoom', function(event) {  
  var topImage = viewer.world.getItemAt(1);
  if (topImage) {
    var zoom = viewer.viewport.getZoom();
    if (zoom >= 2) {
      topImage.setOpacity(1)
    } else if (zoom < 2) {
      topImage.setOpacity(0)
    }
  }
});

I haven't tested, but it should be the general right idea.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda