agm-oms
v1.0.0-beta.5
Published
Angular Google Maps (AGM) extension for OverlappingMarkerSpiderfier support
Downloads
156
Maintainers
Readme
Overlapping Marker Spiderfier for AGM
This package leverages the ts-overlapping-marker-spiderfier package to add spiderfy support to AGM.
Installation
agm-oms has a peer depedency on [email protected]
npm install [email protected] agm-oms --save
# or
yarn add [email protected] agm-oms
Usage
Import the module
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; // add these imports import { AgmCoreModule } from '@agm/core'; import { AgmMarkerSpiderModule } from 'agm-oms'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, AgmCoreModule.forRoot({ apiKey: ['YOUR_API_KEY_HERE'] }), AgmMarkerSpiderModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }
use it in your template
<agm-map style="height: 300px" [latitude]="51.673858" [longitude]="7.815982"> <agm-marker-spider> <agm-marker [latitude]="51.673858" [longitude]="7.815982"> </agm-marker><!-- multiple markers --> </agm-marker-spider> </agm-map>