Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

153
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda