Fix initial world size on mobile
All checks were successful
Deploy Spot / deploy (push) Successful in 38s
All checks were successful
Deploy Spot / deploy (push) Successful in 38s
This commit is contained in:
@@ -233,7 +233,10 @@ export default {
|
|||||||
|
|
||||||
//Adapt zoom to see whole planet
|
//Adapt zoom to see whole planet
|
||||||
const $Canvas = this.map.getCanvas();
|
const $Canvas = this.map.getCanvas();
|
||||||
const iTargetRadius = Math.min($Canvas.clientWidth, $Canvas.clientHeight) / 2;
|
const oMapBounds = this.map.getContainer().getBoundingClientRect();
|
||||||
|
|
||||||
|
//Adapt zoom to see whole planet
|
||||||
|
const iTargetRadius = Math.max(1, Math.min(oMapBounds.width || $Canvas.clientWidth, oMapBounds.height || $Canvas.clientHeight) / 2);
|
||||||
const iWorldSize = iTargetRadius * 2 * Math.PI * Math.cos(oDefaultProject.latitude * Math.PI / 180);
|
const iWorldSize = iTargetRadius * 2 * Math.PI * Math.cos(oDefaultProject.latitude * Math.PI / 180);
|
||||||
|
|
||||||
this.map.jumpTo({
|
this.map.jumpTo({
|
||||||
|
|||||||
Reference in New Issue
Block a user