Hi,
I am trying to implement, increase/decrease of font size on map zoom in/out. For this, i have used getExtremes api and afterSetExtremes event of xAxis to find zoom level. With this zoom level, font size is updated in chart. is there any other way to achieve this?
This was working fine if map is not dragged after any zoom action, as afterSetExtremes event was triggered. To handle this i have added 'pan' trigger check before updating font size. is there any alternative to this?
Even with the check, issue arises when zoom out action is performed after dragging of map. For this case, when chart width is larger than plotted map width (as shown in below given fiddle) font-size are not decreased gradually on zoom out as they were increased. This can be noticed by looking at zoom levels logged on console. (highmaps version 6.1.1)
fiddle: https://jsfiddle.net/tanmayshah95/bxjqzy8m/9/
Consider eg.
-> zoom in on map and verify zoom levels on console: 1, 0.80, 0.60, 0.40, 0.30
-> drag map horizontally and vertically to view other state.
-> zoom out on map and verify significant changes in zoom levels: 0.75, 0.95, 1
As first zoom level on zoom out is significantly increased from last zoom level. font size are not getting correct size.
NOTE: For latest highcharts version, i was getting issue with label placement on map zoom.
fiddle: https://jsfiddle.net/tanmayshah95/98ox7fep/1/
Thanks
- Tanmay