使用Angular map包在Angular 6中集成Bingmap
我正在尝试在angular 6中使用“angular map”npm包来实现bingmap,我也有 问题陈述:未在节点_模块中创建“bingmaps”文件夹 app.module.ts使用Angular map包在Angular 6中集成Bingmap,angular,typescript,bing-maps,Angular,Typescript,Bing Maps,我正在尝试在angular 6中使用“angular map”npm包来实现bingmap,我也有 问题陈述:未在节点_模块中创建“bingmaps”文件夹 app.module.ts /// <reference path="node_modules/bingmaps/types/MicrosoftMaps/Microsoft.Maps.All.d.ts" /> import { BrowserModule } from '@angular/platform-browser'; i
/// <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';
//
从“@angular/platform browser”导入{BrowserModule};
从“@angular/core”导入{NgModule};
从“角度贴图”导入{MapModule、MapAPILoader、BingMapAPILoaderConfig、BingMapAPILoader、WindowRef、DocumentRef、MapServiceFactory、BingMapServiceFactory};
从“./app.component”导入{AppComponent};
错误:
./node_modules/angular maps/fesm5/angular-maps.js中出错
找不到模块:错误:无法解析“D:\bingmap\bingmap\node\u modules\angular maps\fesm5”中的“bingmap”
i(wdm):编译失败。
src/app/app.module.ts(1,23)中出错:错误TS6053:文件'D:/bingmap/bingmap/src/app/node_modules/bingmap/types/microsoftmap/Microsoft.Maps.All.D.ts'
没有找到
还安装了
npm安装--save@types/bingmaps
我刚刚在本地和stackblitz上进行了测试,并意识到为了使角度贴图正常工作,必须安装一些库依赖项。我收到了与您相同的错误,但一旦我安装了库,错误就消失了
您的package.json应该包含以下库:
"@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",
所以你需要安装它们
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中包含了字体作为外部链接:
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" />
如果您也检查一下,您可以查看使用了哪些附加库的依赖项工作正常……您可以建议我如何缩放一个特定区域并使其成为不同的颜色,这是一个不同的主题。你需要把它作为一个新问题发布。我已经在这里发布了:谢谢你的努力。它解决了我的问题…继续做illumination@kboul
import {
MapModule,
MapAPILoader,
MarkerTypeId,
IMapOptions,
IBox,
IMarkerIconInfo,
WindowRef,
DocumentRef,
MapServiceFactory,
BingMapAPILoaderConfig,
BingMapAPILoader,
GoogleMapAPILoader,
GoogleMapAPILoaderConfig
} from 'angular-maps';