0.5.1 • Published 3 years ago

ponton-map-library v0.5.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Ponton Map Library

An angular library to help create maps for the Ponton system.

Install

Install by running the following the command:

npm install ponton-map-library

The dependencies get installed automatically, but you have to include their stylesheets manually. Stylesheets that needs to be added:

"node_modules/leaflet/dist/leaflet.css",

Usage

Import PontonMapLibraryModule into your app or feature module:

import { PontonMapLibraryModule } from 'ponton-map-library';

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

The library provides a single component called PontonMapLibraryComponent. A map can be created through this component.

 <ponton-map
    style="width: 100%"
    [floorplan]="img"
    [floorplanConfig]="mapSettings"
    [tagList]="mapTags"
    [selectedTag]="selectedTagMarker"
    (mapLoaded)="mapLoaded()"
    (tagSelected)="tagSelectedMarker($event)"
  >

Reference

PontonMapLibraryComponent

Attributes

AttributeTypeDescriptpion
floorplanBlobImage blob received from the backend
floorplanConfigFloorplanConfigModelConfig for setting the floorplan properly
tagListTagModel[]Tags to display
selecetedTagTagModelThe selected tag

Events | Event | Type | Descriptpion | ------------- |:-------------:| :-------------:| | mapLoaded | simple event | Fired when the map finished loading. | | tagSelected | TagModel | Fired when a tag is selected (clicked) on the map.|

Models

FloorPlanConfig

AttributeTypeDescriptpion
widthnumberwidth of area (in meters)
heightnumberheight of area (in meters)
xOffsetnumberoffset of X axis (in meters)
yOffsetnumberoffset of Y axis (in meters)

Tag

id: 4967 pos: ts: "2021-06-14T18:55:31.598066" x: 5.794398875598649 y: 2.2591296950107456 z: 0.9049999999999999 tag_id: 4967

AttributeTypeDescriptpion
idnumberid in the DB
pospositionData(x,y,z, timestamp)
tag_idnumberid of the Tag
0.5.1

3 years ago

0.5.0

3 years ago