cpietsch / vikus-viewer

Explore cultural collections along time, texture and themes
https://vikusviewer.fh-potsdam.de/
Other
136 stars 45 forks source link

Map branch not displaying sprites #23

Closed martimpassos closed 3 years ago

martimpassos commented 3 years ago

Hello @cpietsch, first of all thank you for this beautiful piece of code you put together, it's being really helpful for more than one project I'm working on.

I'm trying to get the map branch to work with my data and everything looks fine except for one or two issues: the sprites don't seem to be loaded either on the timeline or the map, even though they work fine with the "default" vikus-viewer. The console is not giving me any errors about that. Other than that, when I click on a sprite placeholder on the map, it zooms in way more than expected, rendering bigImage larger than it's supposed to (that is, fitting the window left of sidebar detail). Here are some screenshots:

Screen Shot 2021-04-01 at 16 58 54 Screen Shot 2021-04-01 at 16 59 20

Do you know what might be wrong with my instance? I tried messing with the hardcoded scales and ratios such as zoomedToImageScale and zoomToImage related vars but couldn't really get it to behave the way I'd like.

Thanks again!

cpietsch commented 3 years ago

Hi @martimpassos , thx for the feedback. Do you have a demo deployed somewhere so I can have a look ?

martimpassos commented 3 years ago

I just pushed it here. Thank you for taking time to look into this, hopefully I'm not doing something too stupid... My only modifications were to bump Mapbox to v2.1.1, lower fontScaleYear range's minimum value to avoid overlapping on load and fix a typo at mapbox.js:76 ('linaer' --> 'linear').

cpietsch commented 3 years ago

Hi @martimpassos , it looks like the map branch is not up to date regarding the sprite loading. As a feature update moving to vikus-viewer-script v2 I changed some things in the parser: https://github.com/cpietsch/vikus-viewer/blob/master/js/pixi-packer-parser.js#L27

Can you try to take the pixi-packer-parser.js from the master branch and report back if that works for you ?

martimpassos commented 3 years ago

It works! Thanks a lot. I wonder why the Pankow Art example works though, since they seem to use the outdated pixi-packer-parser...

cpietsch commented 3 years ago

The Pankow Art Sprite Json: https://vikus.kunst-im-oeffentlichen-raum-pankow.de/temp/sprites/spritesheet_v1.json uses "type":"pixi-packer" so it is backward compatible / compatible with the original pixi-packer-parser. In a future version of VIKUS Version I plan to ditch the pixi-packer-parser all together since I implemented my own parser https://observablehq.com/@cpietsch/pixi-spritesheet-loader with less code.