dapriett / nativescript-google-maps-sdk

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

Angular Map not drawing Polylines #464

Closed juniorschen closed 2 years ago

juniorschen commented 3 years ago

image image image

juniorschen commented 3 years ago

Sample: https://github.com/juniorschen/Teste

juniorschen commented 3 years ago

@dapriett

liamcharmer commented 3 years ago

same applies to me. works on iOS but not android.

liamcharmer commented 3 years ago

@juniorschen any fix?

juniorschen commented 3 years ago

@liamcharmer I don't remember for sure, but in the end everything worked out by drawing this way: private drawPolyline(start: { latitude: number, longitude: number }, end: { latitude: number, longitude: number }) { const currentPolyline = new Polyline(); currentPolyline.color = new Color('#e34850'); currentPolyline.visible = true; currentPolyline.geodesic = true; currentPolyline.width = 8; currentPolyline.addPoint(Position.positionFromLatLng(start.latitude, start.longitude)); currentPolyline.addPoint(Position.positionFromLatLng(end.latitude, end.longitude)); this.mapView.addPolyline(currentPolyline); }

juniorschen commented 3 years ago

@liamcharmer Try if this works for you. If we look at the code, in this case I will have to add two polylines at once, different from the test example I put here