1.0.8 • Published 7 years ago

@angular-metro-maps/core v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

Angular Metro Maps (AMM) Core - Angular 2+ Metro Maps components

@angular-metro-maps/core contains solutions for the SVG Metro Maps.

###DEMO (plunkr)

Getting Started

Import AmmModule from angular-metro-maps/core

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

import { AmmModule } from '@angular-metro-maps/core';

@NgModule({
  imports: [
    BrowserModule,
    AmmModule
  ],
  declarations: [ AppComponent ],
  bootstrap: [ AppComponent ]
})
export class AppModule {}

Use amm-metro-map component

@Component({
  selector: 'app-root',
  template: `
  <amm-metro-map 
         (mapClick)="metroClick($event)" 
        [(stations)]="metro"></amm-metro-map>
  `
})
export class AppComponent {
  
  public metro: string[] = [];
  
  public metroClick(mapEvent) {

      // sync data with metroMap click
      this.metro.forEach(item => {
  
        if (this.metro.indexOf(item.stationName) !== -1) {
          this.metro.push(item.stationName);
        } else {
          this.metro.splice(this.metro.indexOf(item.stationName), 1)  
        }
  
      });
      
  }
}			

Documentation

amm-metro-map is currently supported with the following features. Options on how to use them in your own application are linked below.

OptionTypeDefaultParamsDescription
(mapClick)functionnullcallback on map click
(stations)string[][]array of strings that sync map and your set of data
mapUrlstringnull'spb' - (Sankt petersburg map)url to svg map (Default - Moscow map)

The sources for this package are in the angular-metro-maps repository. Please file issues and pull requests against that repo.

License

License: See LICENSE file in this folder © falendary.

Metro map design © Art. Lebedev Studio

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago