arcgis - 画布高度不断增加 Arcgis/core
问题描述
我在使用 Arcgis/core 4.18 时遇到问题。我的地图画布高度不断增加。我正在使用 Arcgis/Core 和 Angular 11。
这是我的代码
app.component.html
<html>
<head>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
应用组件.css
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
应用组件.ts
import { Component,OnInit} from '@angular/core';
import MapView from '@arcgis/core/views/MapView';
import config from '@arcgis/core/config';
import Map from '@arcgis/core/Map';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
constructor() {
}
ngOnInit() {
this.initMap();
}
initMap(){
config.assetsPath = './assets';
const map = new Map({
basemap: "arcgis-topographic" //Basemap layer service
});
// Create a MapView instance (for 2D viewing) and reference the map instance
const view = new MapView({
map: map,
center: [-118.80500, 34.02700], //Longitude, latitude
zoom: 13,
container: "viewDiv"
});
view.when(() => console.log('view ready'));
}
}
安装 npm arcgis/core
解决方案
推荐阅读
- node.js - Angular:如何使用 nodejs 服务器 api 在 postgres bytea 字段中保存图像
- angular - 由于类型为“Promise”,此条件将始终返回“false”
' 和 '1' 没有重叠 - json - JSON Schema中有序数组中的条件条件
- css - React 组件没有拾取 CSS 文件
- node.js - debain 10 上的 systemd 服务文件不适用于 nodejs
- gstreamer - GStreamer:来自 osxaudiosrc 的输入,超过 8 个通道
- highcharts - 使用 HighCharts 在时间序列 LineChart 中显示开始和结束日期范围
- python - QMainWindow.__init__(self)
- java - 自定义 ListView 仅显示 Cursor 中的一项
- python - Flask Sqlalchemy 按关系计数排序