ngx-map-renderer
v0.8.2
Published
Angular components for rendering geographic data.
Downloads
85
Readme
Map Renderer for Angular
This library provides Angular components for rendering geographical data. It relies on the GeoJSON format and D3 for rendering the data.
Installing
Using npm, you can install the library with:
npm install --save ngx-map-renderer
Using yarn, you can install the library with:
yarn add ngx-map-renderer
Usage
1. Import the MapRendererModule
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {MapRendererModule} from 'ngx-map-renderer';
@NgModule({
imports: [
BrowserModule,
MapRendererModule.forRoot()
],
bootstrap: [AppComponent]
})
export class AppModule { }
2. Use the MapRendererComponent
<ngx-map-renderer [mapData]="mapData" [locations]="locations"></ngx-map-renderer>
API
MapRendererComponent ()
mapData
The mapData attribute expects a JavaScript object, which contains GeoJSON-encoded data. This is rendered within the component. GeoJSON data can be found all around the web, for example here.
locations
The locations attribute expects an array of LocationWithLabel objects. This are rendered as circles with corresponding labels on the map. In order to render locations, mapData must be provided.
Location
TODO
LocationWithLabel
TODO