我正在尝试制作一个 Angular 应用程序,它将显示优化的路线以及一组目的地的方向。我在应用程序中安装了 Azure Maps SDK 并开始使用 API。一切都工作正常,但动画 API 却不行。 我正在导入这样的地图
import * as atlas from 'azure-maps-control';
然后按照文档使用动画 api:
this.animation = atlas.animation.moveAlongRoute(this.routePoints, this.pin, {
//Specify the property that contains the timestamp.
timestampProperty: 'timestamp',
//Capture metadata so that data driven styling can be done.
captureMetadata: true,
loop: document.getElementById('loopAnimation'),
reverse: document.getElementById('reverseAnimation'),
rotationOffset: (document.getElementById('reverseAnimation'))? 90: 0,
//Animate such that 1 second of animation time = 1 minute of data time.
speedMultiplier: 60,
//If following enabled, add a map to the animation.
map: (document.getElementById('followSymbol'))? this.map: null,
//Camera options to use when following.
zoom: 15,
pitch: 45,
rotate: true
});
});
});
}
但是它给出了这样的错误
“typeof atlas”类型上不存在属性“animation”
我还需要服务模块,所以我从
导入它import * as atlases from 'azure-maps-rest';
这次通过使用此导入,我能够使用 atlases.services 模块,但现在出现一些接口错误,说明
类型“undefined”不满足约束“IBaseGeojson”。
2153 G 扩展 IBaseGeojson = 未定义> = D & (G 扩展未定义? {