In our application we have a mechanism for sharing the initial view of a map. These parameters are saved and can be used to initialise another map, for example:
"initialCamera": {
"west": 133.12335073549156,
"south": -42.38666970744262,
"east": 156.35409851747534,
"north": -31.55857883340345,
"position": {
"x": -4120986.489101264,
"y": 2901296.804778211,
"z": -5529233.584392741
},
"direction": {
"x": -0.009963608676945457,
"y": 0.01443110436389694,
"z": 0.999846223040809
},
"up": {
"x": -0.8138296757070467,
"y": 0.580869360008338,
"z": -0.01649380314139365
}
},
However, it does not work when you try to share a camera orientation where orientation.direction.x
is negative, i.e. where the camera is pointing upwards above the horizon.
Is there a way to make this work given the camera position information we record? I have made a sandcastle demo where this does not work. This is the view that should be set:
But instead we get this: