agm-spiderfier
v1.0.1
Published
Angular Google Maps (AGM) extension for google maps marker spiderfier library
Downloads
142
Maintainers
Readme
Overlapping Marker Spiderfier for AGM
This package is a copy of agm-oms rebase with last version on [angular-google-maps][angular-google-maps].
This package leverages the ts-overlapping-marker-spiderfier package to add spiderfy support to AGM.
Installation
agm-spiderfier has a peer depedency on [email protected]
npm install [email protected] agm-spiderfier --save
# or
yarn add [email protected] agm-spiderfier
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-spiderfier'; @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>