0

I am trying to add bing-maps in my project. I am using angular 6.

I have followed the steps listed here, starting from installation. I got some errors which are solved now by the solution in here from stackoverflow. referring to this link again in 2nd step I get the following error:

ReferenceError: provide is not defined

it comes from the code below:

provide: MapAPILoader,
deps: [],
useFactory: MapServiceProviderFactory

It would be great if some one can help me. Thanks. S.O.

Edit: app.module.ts:

import {
  BrowserModule
} from '@angular/platform-browser';
import {
  NgModule
} from '@angular/core';

import {
  AppComponent
} from './app.component';


// bing STart==========================================
/// <reference path="node_modules/bingmaps/types/MicrosoftMaps/Microsoft.Maps.All.d.ts" />
import {
  MapModule,
  MapAPILoader,
  MarkerTypeId,
  IMapOptions,
  IBox,
  IMarkerIconInfo,
  WindowRef,
  DocumentRef,
  MapServiceFactory,
  BingMapAPILoaderConfig,
  BingMapAPILoader,
  GoogleMapAPILoader,
  GoogleMapAPILoaderConfig
} from 'angular-maps';
// bing End============================================

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MapModule.forRoot()
  ],
  providers: [
    provide: MapAPILoader,
    deps: [],
    useFactory: MapServiceProviderFactory
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}
s144
  • 25
  • 1
  • 4

1 Answers1

0

You should have it inside Provider array,

providers: [
    { provide: MapAPILoader}
  ]
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396