question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImageToVieportZoom throws error on multi-image

See original GitHub issue

Getting this error when having more that one tile on the viewer;

[Viewport.imageToViewportZoom] is not accurate with multi-image.

What should I use instead for multi-image ?

I think this should be a warning instead of an error, also anyway to suppress this ?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
iangilmancommented, Nov 15, 2019

Yup, that’s a perfect solution. I wouldn’t call it a workaround… it’s exactly what you’re supposed to do in order to get an accurate result. 😃

1reaction
btzr-iocommented, Nov 15, 2019

Find a workaround for now, just need to get the largest image zoom:

  getTargetZoom = (scale = 1) => {
    let zooms = []
    const { viewport, world } = this.viewer
    const count = world.getItemCount()

    for (let i = 0; i < count; i++) {
      zooms[i] = world.getItemAt(i).imageToViewportZoom(scale)
    }

    return Math.max(zooms)
  }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Load Multiple Images for addImage() · Issue #4736 - GitHub
I need to add multiple images to my map using addImage(). ... loadImage(img.url, function (error, res) { if (error) throw error; map.
Read more >
Displaying error messages on upload - Support - Uploadcare
Hi! I'm using the JS API to open a dialog, and passing a validator array to check for minimum pixel dimensions. I'm also...
Read more >
Viewing more than 1 profile picture - Power Platform Community
Picture ), but when I try to use the same for the column in Sharepoint that allows multiple emails I get an error...
Read more >
Getting an error that images is null while trying to show a ...
I have this function to upload multiple images and it works, now I need to show preview of all the images the user...
Read more >
Multi-image field giving unexplained errors when adding alt text
On the first item, there are 6 images in that field and when I click “save” I keep getting an error that says...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found