AnatomicMaps / flatmap-viewer

Apache License 2.0
0 stars 7 forks source link

panZoomEvent error #33

Closed alan-wu closed 3 months ago

alan-wu commented 3 months ago

I am getting an error from the pan zoom event with the following error:


TypeError: Cannot read properties of undefined (reading 'layerX')
    at Cht.panZoomEvent_ (@abi-software_flatmap-viewer.js?v=2acb1da3:88921:23)

Looks like it comes from the following function: https://github.com/AnatomicMaps/flatmap-viewer/blob/e0e7976920b8b8ab035eb22c5b4150507918e96c/src/interactions.js#L1664

Our code is calling the zoomToGeoJSONFeatures method with the following list -

 ['12517', '12518', '12519', '12520', '12521', '12522', '12523', '12524', '12525', '12526', '12527', '12528', '12529', '12530', '12531', '12532', '12533', '12534', '12535', '12537', '12538', '12539', '12540', '12541', '12542', '12543', '12544', '12545', '12546', '12547', '12548', '12549', '12550', '12551', '12552', '12553', '12554', '12555', '12556', '12557', '12558', '12559', '12560', '12561', '12562', '12563', '12564', '12565', '12566', '12567', '12568', '12569', '12570', '12571', '12572', '12573', '12574', '12575', '12576', '12577', '12578', '12579', '12580', '12581', '12582', '12583', '12584', '12585', '12586']    in the rat flatmap on the curation server.

dbrnz commented 3 months ago

As a workaround pass {noZoomIn: true} as options -- i.e. zoomToGeoJSONFeatures(zoomIds, {noZoomIn: true}).

I also think we've been here before...

dbrnz commented 3 months ago

No, forget that workaround, there's a second issue at play (and a fix about to made).

dbrnz commented 3 months ago

Fixed in release 3.1.0.