1.0.1-alpha • Published 9 months ago

@proginnova/ng-map v1.0.1-alpha

Weekly downloads
72
License
-
Repository
-
Last release
9 months ago

NgMap

New update to support with Angular CLI version 16.1.0

How to install

npm install @proginnova/ng-map -S

Then install the package npm install @types/googlemaps.

Getting Started

In the tsconfig.json add the next compiler options:

  "compilerOptions": {
    ...
    "strictPropertyInitialization": false,
    "strictNullChecks": false,
    "noImplicitThis": false,
    "noImplicitAny": false,
    ...
  }

In the module.ts import the library and set the Google api key:

imports: [
    ...
    NgMapModule.forRoot({
      apiKey: {yourApiKey}
    })
]

How to use

This library accept these Inputs:

IGMapMarker {
    position: { lat: number, lng: number };
    title?: string;
    icon?: string;
    metaData?: any;
}

The library has the next outputs:

NameDescriptionExample
markerClickedEmits the data stored in the marker, when click on a marker.(markerClicked)="someFunction($event)"
markerHoverEmits the data stored in the marker, when hover the mouse over marker.(markerHover)="someFunction($event)"
zoomChangedEmits the actual map zoom level.(zoomChanged)="someFunction($event)"
centerChangedEmits the actual latitude and logitude(centerChanged)="someFunction($event)"
groupSelectedEmits an collection of markers. This works when are using draggable is true.(groupSelected)="someFunction($event)"

Example in HTML

<div style="height: 100vh; width: 100%">
  <pgi-ng-map [center]="{lat:9.660880, lng:-84.136653}" [groupSelectConfig]="groupConfig" [mapStyles]="mapStyles" [draggable]="draggable"
    [infoWindowContent]="'Hello'" [showInfoWindow]="{hover:true}" [markers]="markers$ | async" [debug]="false" [enableControls]="enabledControls"
    [defaultMarkerIcon]="'./assets/marker.png'" [clusterConfig]="clusterConfig" (groupSelected)="markerGroupSelected($event)" (markerClicked)="markerSelected($event)"
    [zoom]="5"></pgi-ng-map>
  <button style="position: absolute; bottom:0;left: 0;" (click)="draggable = !draggable">click</button>
</div>

Note: draggable and debug are type boolean. infoWindowContent is data to display in the tooltip (can be a component).

1.0.1-alpha

9 months ago

1.0.0-alpha

9 months ago

0.1.2

3 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.27

4 years ago

0.0.26

4 years ago

0.0.25

5 years ago

0.0.24

5 years ago

0.0.23

5 years ago

0.0.22

5 years ago

0.0.21

5 years ago

0.0.20

5 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.17

5 years ago

0.0.16

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago