Commit 38bb35b5 authored by Manideep2897's avatar Manideep2897 Committed by GitHub

Add files via upload

parent a38f310e
<!--
Generated template for the MapsPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>maps</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<div padding>
<button block ion-button style="padding:0px; width: 100%;" medium (click)="mapUser()">LOCATE ME</button>
</div>
<agm-map [latitude]="location?.coords.latitude" [streetViewControl]="true" [longitude]="location?.coords.longitude" [mapTypeId]="'hybrid'" [zoom]="15">
<agm-marker [label]="options" [latitude]=" location?.coords.latitude" [longitude]="location?.coords.longitude" [markerClickable]="true"></agm-marker>
</agm-map>
</ion-content>
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { MapsPage } from './maps';
@NgModule({
declarations: [
MapsPage,
],
imports: [
IonicPageModule.forChild(MapsPage),
],
})
export class MapsPageModule {}
page-maps {
agm-map {
height: 500px;
width: 1000px;
position: absolute;
left: 0;
bottom: 5;
}
}
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams ,Platform} from 'ionic-angular';
import { AgmCoreModule } from '@agm/core';
import { Geolocation } from '@ionic-native/geolocation';
/**
* Generated class for the MapsPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@IonicPage()
@Component({
selector: 'page-maps',
templateUrl: 'maps.html',
})
export class MapsPage {
coords:any;
location:any;
firebase:any;
constructor(public navCtrl: NavController, private geolocation: Geolocation,public navParams: NavParams,public platform:Platform) {
}
options={
colorl:'#ASDF96',
fontfamilyl:'',
fontsizel:'14px',
fontweightl:'bold',
textl:'B',
}
mapUser(): void
{
this.platform.ready().then(()=>{
let options={timeout:3000,enableHighAccuracy:true,maximumAge:0}
this.geolocation.getCurrentPosition(options).then((location) => {
console.log('Fetched the location successfully',location);
this.location=location;
}).catch((error) => {
console.log('Error getting location', error);
});
});
//let latitude : number=this.location.coords.latitude,
//longitude : number=this.location.coords.longitude;
}
ionViewDidLoad() {
console.log('ionViewDidLoad MapsPage');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment