update to rog_only
This commit is contained in:
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/plugin_api.dart';
|
||||
import 'package:flutter_map_location_marker/flutter_map_location_marker.dart';
|
||||
import 'package:flutter_map_marker_cluster/flutter_map_marker_cluster.dart';
|
||||
import 'package:flutter_polyline_points/flutter_polyline_points.dart';
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_state_manager/get_state_manager.dart';
|
||||
@ -87,6 +88,16 @@ class MapWidget extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
List<LatLng>? getPoints(){
|
||||
print("##### --- route point ${indexController.routePoints.length}");
|
||||
List<LatLng> pts = [];
|
||||
for(PointLatLng p in indexController.routePoints){
|
||||
LatLng l = LatLng(p.latitude, p.longitude);
|
||||
pts.add(l);
|
||||
}
|
||||
return pts;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@ -133,6 +144,21 @@ class MapWidget extends StatelessWidget {
|
||||
),
|
||||
children: [
|
||||
BaseLayer(),
|
||||
Obx(() =>
|
||||
indexController.routePointLenght > 0 ?
|
||||
PolylineLayer(
|
||||
polylines: [
|
||||
Polyline(
|
||||
points: getPoints()!,
|
||||
strokeWidth: 6.0,
|
||||
color: Colors.indigo
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
:
|
||||
Container(),
|
||||
),
|
||||
CurrentLocationLayer(),
|
||||
indexController.locations.isNotEmpty && indexController.locations[0].collection.isNotEmpty ?
|
||||
MarkerLayer(
|
||||
|
||||
Reference in New Issue
Block a user