Azure 地图库无法导入(服务和动画 API)

问题描述 投票:0回答:1

我正在尝试制作一个 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 扩展未定义? {

angular typescript azure-maps
1个回答
0
投票

您可以尝试通过此

link
azure-maps-animations
文件夹中的 dist JavaScript 文件添加到您的项目中,以便与 azure 地图 Web sdk 一起使用。

对于 Azure Maps 服务模块,

atlas-services-ui
JavaScript 和 CSS 文件以及
localization
文件夹中的
dist
文件夹从此链接放入您的项目中。

© www.soinside.com 2019 - 2024. All rights reserved.