Registry / maps / ng2-bingmaps

ng2-bingmaps

JSON →
library0.5.1jsnpmunverified

Angular 2 components for Bing Maps, version 0.5.1. This package provides Angular 2 directives and services to integrate Bing Maps into Angular 2 applications. It is designed for Angular 2 (not Angular 4+), with limited maintenance. The library is deprecated in favor of modern Angular versions and the official Bing Maps SDK. It supports CommonJS, ES6, and TypeScript sources.

npm install ng2-bingmaps
INSTALL
IMPORT
SIG · NG2-BINGMAPS
N
ng2-bingmaps
mapsjavascriptv0.5.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BingMapDirective
import { BingMapDirective } from 'ng2-bingmaps'
import BingMapDirective from 'ng2-bingmaps'
Default export not available; named import only.
BingMapService
import { BingMapService } from 'ng2-bingmaps'
const BingMapService = require('ng2-bingmaps').BingMapService
CommonJS require works but ESM import is preferred.
BingMapsModule
import { BingMapsModule } from 'ng2-bingmaps'
import { BingMapsModule } from 'ng2-bingmaps/ng2-bingmaps'
Incorrect path; use 'ng2-bingmaps' directly.

Set up Bing Maps in Angular 2 app using module import and component directive.

// app.module.ts import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { BingMapsModule } from 'ng2-bingmaps'; import { AppComponent } from './app.component'; @NgModule({ declarations: [AppComponent], imports: [BrowserModule, BingMapsModule.forRoot({ apiKey: process.env.BING_MAPS_KEY ?? '' })], bootstrap: [AppComponent] }) export class AppModule { } // app.component.html <ng2-bingmaps [latitude]="47.6" [longitude]="-122.3" [zoom]="10"></ng2-bingmaps>
Debug
Known issues
breakingAngular 2 compatibility only; does not work with Angular 4+.
fix
Use angular2-google-maps for Angular 2 or migrate to official @microsoft/maps-bing package for newer Angular versions.
affects: >=0.5.0
deprecatedPackage is deprecated and no longer maintained.
fix
Consider using the official Bing Maps SDK: `npm install bingmaps` or `@microsoft/maps-bing`.
affects: >=0.5.1
breakingMissing dependency `bingmaps` will cause runtime error.
fix
Install `bingmaps` package alongside ng2-bingmaps: `npm install bingmaps`.
affects: >=0.5.0
gotchaAPI key must be passed via forRoot() method.
fix
Ensure key is provided: `BingMapsModule.forRoot({ apiKey: 'YOUR_KEY' })`.
affects: >=0.5.0
Errors
Common errors & fixes
Error: Can't resolve 'bingmaps'
Missing peer dependency bingmaps.
fix
Run `npm install bingmaps`.
No provider for BingMapService
BingMapsModule not imported or forRoot not called.
fix
Import BingMapsModule and call forRoot() with API key.
Invalid argument for forRoot - must be an object with apiKey
Incorrect configuration object.
fix
Use `BingMapsModule.forRoot({ apiKey: '...' })`.
Upgrade
Version history
0.5.1latest on npm
Audit
Dependencies
@angular/corerequiredAngular 2 dependency for component/directive support
bingmapsrequiredBing Maps JavaScript SDK wrapper
Agent activity
47 hits · last 30 days
node
40
OpenAI (training)
1
Resources
ng2-bingmaps — npm install ng2-bingmaps · libregistry