kimdanielarthur
Posts: 3
Joined: Mon Jan 02, 2023 3:19 pm

Jittering position of map with orthographic positioning

Hi,

I have a map in orthographic view that I rotate based on scroll position of map:
networkMap.mapView.update({zoom: 2, projection: {rotation: [-80+self.progress*130,-30,0]}}, true, false);

However the globe jitters both up and down when rotating. This I think because of the bounds of the map are changing and highcharts is centering the rendering of the globe based on the extents of the map.

So the total size of the rendered map varies based on what countries are rendered, causing jittering in position.

Is there a way to fix the position of the rendered globe no matter what the bounds of the rendered countries are?

Thanks,
Kim
kimdanielarthur
Posts: 3
Joined: Mon Jan 02, 2023 3:19 pm

Re: Jittering position of map with orthographic positioning

projectedBounds: 'world' did the trick in the mapView config

mapView: {
projection: {
name: 'Orthographic',
rotation: [-100, -30],
projectedBounds: 'world'
},
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Jittering position of map with orthographic positioning

Hello and welcome to our forum!

I don't quite understand. Could you reproduce the problem in an online demo (for example in JSFiddle), so it will be easier for me to help and understand what exactly the problem is?

Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
kimdanielarthur
Posts: 3
Joined: Mon Jan 02, 2023 3:19 pm

Re: Jittering position of map with orthographic positioning

Thanks for replying! I posted my fix, which was related to setting the projectedBounds. The problem was that the globe rendered in orthographic view was jittering in position based on what the bounds of the rendered map content was. With the projectedBounds set to 'world' the projection was consistent and independent of what was visible on the globe at any time.
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Jittering position of map with orthographic positioning

Hi,

Okay, now I get it. So thanks for sharing your solution with us!

Let me know if you have any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Maps”