mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-02-20 06:58:08 +01:00
feat: upgrade to Angular 9 and Nebular 5 (#5628)
BREAKING CHANGE: Angular updated to version 9. Nebular updated to version 5. `@agm/core` replaced with `@angular/google-maps`. `ng2-completer` replaced with `@akveo/ng2-completer`, read details [here](https://github.com/akveo/ng2-smart-table/pull/1140#issue-392285957).
This commit is contained in:
parent
b48f502f37
commit
aa4ae169d9
21 changed files with 6191 additions and 3175 deletions
3
src/app/pages/maps/search-map/map/map.component.html
Normal file
3
src/app/pages/maps/search-map/map/map.component.html
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<google-map [center]="position" [zoom]="zoom" width="100%" height="36.5625rem">
|
||||
<map-marker [position]="position"></map-marker>
|
||||
</google-map>
|
||||
32
src/app/pages/maps/search-map/map/map.component.ts
Normal file
32
src/app/pages/maps/search-map/map/map.component.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { PositionModel } from '../entity/position.model';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-map',
|
||||
templateUrl: './map.component.html',
|
||||
styleUrls: ['./map.component.scss'],
|
||||
})
|
||||
export class MapComponent implements OnInit {
|
||||
position: PositionModel = null;
|
||||
zoom: number = 1;
|
||||
|
||||
@Input()
|
||||
public set searchedPosition(position: PositionModel) {
|
||||
if (position) {
|
||||
this.position = position;
|
||||
this.zoom = 12;
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
// set up current location
|
||||
if ('geolocation' in navigator) {
|
||||
navigator.geolocation.getCurrentPosition((position) => {
|
||||
this.searchedPosition = new PositionModel(
|
||||
position.coords.latitude,
|
||||
position.coords.longitude,
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue