首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >利用角映射包实现角度6中的宾格图积分

利用角映射包实现角度6中的宾格图积分
EN

Stack Overflow用户
提问于 2018-08-23 13:35:38
回答 1查看 3.7K关注 0票数 3

我试图使用“角映射”npm包在角6中实现bingmap,因为我有请参阅转介问题声明:在node_modules中没有创建“bingmap”文件夹。

app.module.ts

代码语言:javascript
复制
/// <reference path="node_modules/bingmaps/types/MicrosoftMaps/Microsoft.Maps.All.d.ts" />
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { MapModule, MapAPILoader, BingMapAPILoaderConfig, BingMapAPILoader, WindowRef, DocumentRef, MapServiceFactory, BingMapServiceFactory } from "angular-maps";
import { AppComponent } from './app.component';

错误:

在./node_modules/angular-maps/fesm5/angular-maps.js模块中找不到错误:错误:无法解决'D:\bingmap\bingmap\node_modules\angular-maps\fesm5‘i“’D:\bingmap\bingmap\node_modules\angular-maps\fesm5‘”中的’bingmap‘:编译失败。src/app/app.module.ts(1,23)中出现错误: ERROR TS6053: File TS6053 not。

还安装了npm install --save @types/bingmaps

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-08-23 15:23:22

我刚刚在stackblitz上进行了本地测试,并意识到为了使角度映射工作,您必须安装一些库依赖项。我收到了与您相同的错误,但是一旦安装了库,错误就消失了。

您的package.json应该包含以下库:

代码语言:javascript
复制
"@types/bingmaps": "0.0.1",
"angular-maps": "^6.0.1",
"async": "^2.5.0",
"bingmaps": "^2.0.3",
"core-js": "^2.5.4",
"font-awesome": "^4.6.3",
"json-loader": "^0.5.7", 

所以你需要安装它们

代码语言:javascript
复制
npm install --save angular-maps
npm install --save bingmaps
npm install --save @types/bingmaps
npm install --save async@2.5.0
npm install --save json-loader

我在index.html中包含了字体-超赞作为外部链接:

代码语言:javascript
复制
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" />

在app.module.ts上包括这一点,以及在app.component.ts上:

代码语言:javascript
复制
import {
    MapModule,
    MapAPILoader,
    MarkerTypeId,
    IMapOptions,
    IBox,
    IMarkerIconInfo,
    WindowRef,
    DocumentRef,
    MapServiceFactory,
    BingMapAPILoaderConfig,
    BingMapAPILoader,
    GoogleMapAPILoader,
    GoogleMapAPILoaderConfig
} from 'angular-maps';

如果您也检查了stackblitz,就可以看到使用了哪些额外的库。

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51987104

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档