这可能是由于地球的大小和默认的缩放级别不匹配所致。您可以使用以下代码示例来设置初始缩放级别和地球半径:
var chart = am5xy.create("chartdiv", am5plugins_geodata);
chart.geodata = am5geodata_earthLow;
var home = chart.series.push(new am5xy.MapPolygonSeries());
home.useGeodata = true;
home.mapPolygon.template.radius = 10;
home.mapPolygon.template.fill = am5.color("#39B54A");
home.mapPolygon.template.strokeOpacity = 0;
var globeSeries = chart.series.push(new am5plugins_globe.GlobeMapPolygonSeries());
globeSeries.useGeodata = true;
globeSeries.exclude = ["AQ"];
globeSeries.mapPolygons.template.fill = am5.color("#5D5C5C");
globeSeries.mapPolygons.template.stroke = am5.color("#5D5C5C");
globeSeries.mapPolygons.template.fillOpacity = 0.25;
globeSeries.mapPolygons.template.strokeOpacity = 0.5;
globeSeries.mapPolygons.template.tooltipText = "{name}";
globeSeries.deltaLongitude = -11;
globeSeries.minZoomLevel = 1;
chart.projection = new am5plugins_globe.Orthographic();
chart.panBehavior = "rotateLongLat";
chart.homeGeoPoint = { longitude: 0, latitude: 0 };
chart.homeZoomLevel = 1;
circle.radius = chart.series.getIndex(0).mapPolygon.template.getFeatureById("earth").radius;
在此示例中,我们更新了以下内容:
deltaLongitude属性,以在地球旋转时保持地球的位置。homeZoomLevel属性,以设置地图初始缩放级别。circle变量以匹配地球的半径。