Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this throws a "newLatLngBounds, int) exception" error on line 14
- mMap = googleMap;
- ArrayList<MyPoint> points = Data.getPoints();
- LatLngBounds.Builder builder = new LatLngBounds.Builder();
- PolylineOptions polylineOptions = new PolylineOptions();
- for (int i = 0; i < points.size(); i++) {
- MyPoint point = points.get(i);
- polylineOptions.add(new LatLng(point.getLat(), point.getLng()));
- builder.include(new LatLng(point.getLat(),point.getLng()));
- }
- Polyline polyline = mMap.addPolyline(polylineOptions);
- LatLngBounds bounds = builder.build();
- mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 20));
- // and pointLatLang is an unresolved symbol
- @Override
- public void onMapReady(GoogleMap googleMap) {
- mMap = googleMap;
- ArrayList<MyPoint> points = Data.getPoints();
- LatLngBounds.Builder builder = new LatLngBounds.Builder();
- PolylineOptions polylineOptions = new PolylineOptions();
- for (int i = 0; i < points.size(); i++) {
- MyPoint point = points.get(i);
- polylineOptions.add(new LatLng(point.getLat(), point.getLng()));
- builder.include(pointLatLng);
- }
- Polyline polyline = mMap.addPolyline(polylineOptions);
- LatLngBounds bounds = builder.build();
- mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 20));
- }
Add Comment
Please, Sign In to add comment