dapriett / nativescript-google-maps-sdk

Cross Platform Google Maps SDK for Nativescript
MIT License
244 stars 169 forks source link

Performance Angular? #478

Closed SnowYeti closed 3 years ago

SnowYeti commented 3 years ago

Hi, I am using Nativescript 8.0.2 and the sdk; I tried it with javascript first and the loading time for the app was just a few seconds. However using Angular it needs about 20 secs (!) to start. Did I do anything wrong or is this long loading time for Angular just normal? ( I already tried all the webpack flags to improve startup time) I got it running like this:

map.component.ts: import { MapView, Marker, Position , Bounds} from 'nativescript-google-maps-sdk'; registerElement('MapView', () => MapView);

@Component({ moduleId: module.id, selector: 'Map', templateUrl: './map.component.html', styleUrls: ['./map.css'], })

export class MapComponent implements OnInit{ mapView: MapView; ... }

onMapReady(event) {

 const mapView = event.object;
  this.mapView = mapView;

...}

Thanks for any hint

Anja

SnowYeti commented 3 years ago

Just in case there is anybody out there who tried to use the sdk with Nativescript 8.x and Angular: Here is the magic which increased my startup time for the app by roughly 17 seconds!!! don't use the styleUrl... @Component({ selector: 'Map', templateUrl: './map.component.html', // styleUrls: ['./map.css'], })