Hello! I’m trying to using google map at ionic2.
At using this, I considering performance about map. so I worrying about selecting techniques.
I find two techniques. one is using javascript google map, another is using ionic native.
finding about performance of which techniques, I thought native is better (commonly it can be understand)
and I used both of them.
but, I couldn’t see the better performance. (sometime it makes lower quality)
at this point I think some point
-
bad android device (android 4.2.2, LG gflex which I bought 2 years ago)
-
bad code (which i found, attached under here)
import {Component} from ‘@angular/core’;
import {NavController, Platform} from ‘ionic-angular’;
import {GoogleMap, GoogleMapsAnimation, GoogleMapsEvent, GoogleMapsLatLng, Geolocation, GoogleMapsMarkerOptions, GoogleMapsMarker, CameraPosition} from ‘ionic-native’;
import {Http} from ‘@angular/http’;
@Component({
selector: ‘page-home’,
templateUrl: ‘home.html’
})
export class HomePage {
map: GoogleMap;
url: any;
constructor(public navCtrl: NavController, private platform: Platform, public http:Http) {
// platform.ready().then(() => {
this.loadMap();
// });
}
loadMap(){
let location: GoogleMapsLatLng = new GoogleMapsLatLng(37.284869, 127.045237);
this.map = new GoogleMap('map', {
});
this.map.on(GoogleMapsEvent.MAP_READY).subscribe(() => {
// create CameraPosition
let position: CameraPosition = {
target: location,
zoom: 18,
tilt: 30
};
// move the map's camera to position
this.map.moveCamera(position);
// create new marker
let markerOptions: GoogleMapsMarkerOptions = {
position: location,
title: 'abc'
};
this.map.addMarker(markerOptions)
.then((marker: GoogleMapsMarker) => {
marker.showInfoWindow();
});
});
}
}
can I make better performance with witch of one? and what’s the better?