Commit f2d4c703 authored by mohan122's avatar mohan122

added_google_map

parent 867addc7
This diff is collapsed.
......@@ -41,10 +41,26 @@ public isPiecesSelected: boolean;
this.registeritems=this.formBuilder.group({
nameofitem:[''],
cost:[''],
aq:[''],
price:[''],
offers:[''],
pieces:[''],
Weight1:[''],
pieces1:[''],
cost1:[''],
Weight2:[''],
pieces2:[''],
cost2:[''],
Weight3:[''],
pieces3:[''],
cost3:[''],
Weight4:[''],
pieces4:[''],
cost4:[''],
Weight5:[''],
pieces5:[''],
cost5:[''],
Weight6:[''],
pieces6:[''],
cost6:[''],
});
......
<!--
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>
<ion-item id="password" style="position: relative; padding:0px;">
<ion-label floating>LOCATION</ion-label>
<ion-input type="text" value="{{ location?.coords.latitude}} {{ location?.coords.longitude }}" readonly></ion-input>
</ion-item>
<div padding>
<button block ion-button color="vamsi" style="padding:0px; width: 100%;" medium (click)="mapUser()">LOCATE ME</button>
</div>
<agm-map [latitude]=" location?.coords.latitude" [longitude]="location?.coords.longitude" [mapTypeId]="'roadmap'">
<agm-marker [latitude]=" location?.coords.latitude" [longitude]="location?.coords.longitude" [markerClickable]="true"></agm-marker>
</agm-map>
</ion-content>
\ No newline at end of file
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { MapsPage } from './maps';
import { AgmCoreModule } from '@agm/core';
@NgModule({
declarations: [
MapsPage,
],
imports: [
IonicPageModule.forChild(MapsPage),
AgmCoreModule.forRoot({
apiKey:'AIzaSyDeMjFd459tC-fSBnQ4fLhxHnLxd7b1I5E'
})
],
})
export class MapsPageModule {}
page-maps {
#password {
background: color($colors, white);
width: 95%;
}
agm-map {
height: 300px;
zoom: 100%;
}
}
\ No newline at end of file
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams ,Platform} from 'ionic-angular';
import { Geolocation } from '@ionic-native/geolocation';
import { AgmCoreModule } from '@agm/core';
/**
* 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 {
location:any;
constructor(public navCtrl: NavController, public navParams: NavParams,private geolocation: Geolocation,public platform:Platform) {
}
mapUser(){
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);
});
});
}
ionViewDidLoad() {
console.log('ionViewDidLoad MapsPage');
}
}
......@@ -28,7 +28,7 @@
<ion-input type="text"></ion-input>
</ion-item>
<div class="spacer" style="width: 50px; height: 20px;"></div>
<ion-item style="padding:0px; width:285px;">
<ion-item style="padding:0px; width:370px">
<ion-label>Shop category</ion-label>
<ion-select id="category" multiple="false">
<ion-option>Kirana</ion-option>
......
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