ngx-mapbox
TypeScript icon, indicating that this package has built-in type declarations

1.0.13 • Public • Published

Angular module wrapper for mapbox

This module is create from angular cli

Requierment

Mapbox

npm install --save mapbox-gl

Installation

npm install --save angular-mapbox

Get Started

Add the module to your main module app

//app.module.ts
...
import { MapBoxModule } from 'angular-mapbox/module';
...
@NgModule({
    ...
    imports: [
        ...
        MapBoxModule.forRoot('YOU_MAPBOX_API_KEY')
        ...
    ],
    ...
});

Usage

You can add the balise in your html

<ng-mapbox></ng-mapbox>

Parameters :

  • input

    • config : the map box configuration
    • instructions : the event emiter to give instruction to the map
  • output

    • map : gave an observable return the map instance
    • informations : gave an observable to get information whene a layer or marker is added to the map

Events

events descriptions data parameter
addControl add a mapbox control to the map {control : mapboxgl.Control, position : string}
removeControl remove a mapbox control to the map control : mapboxgl.Control
addNavigationControl add Navigation control position : string
removeNavigationControl remove Navigation control none
addScaleControl add Scale control position : string
removeScaleControl remove Navigation control none
addSource add Source to the map data is Source type
removeSource remove Source to the map id : string
addLayer add Layer to the map data is Layer type
removeLayer remove Layer to the map id : string
addMarker add Marker to the map data is Marker type
removeMarke remove Marker to the map id : string

Readme

Keywords

none

Package Sidebar

Install

npm i ngx-mapbox

Weekly Downloads

15

Version

1.0.13

License

MIT

Last publish

Collaborators

  • brendiche