optimized
This commit is contained in:
@ -26,7 +26,7 @@ class MapWidget extends StatelessWidget {
|
||||
Widget getMarkerShape(GeoJsonFeature i, BuildContext context) {
|
||||
GeoJsonMultiPoint p = i.geometry as GeoJsonMultiPoint;
|
||||
//print("lat is ${p.geoSerie!.geoPoints[0].latitude} and lon is ${p.geoSerie!.geoPoints[0].longitude}");
|
||||
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
|
||||
//RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
@ -35,12 +35,11 @@ class MapWidget extends StatelessWidget {
|
||||
GeoJsonFeature? fs = indexController.getFeatureForLatLong(
|
||||
p.geoSerie!.geoPoints[0].latitude,
|
||||
p.geoSerie!.geoPoints[0].longitude);
|
||||
print("------- fs $fs------");
|
||||
//print("------- fs $fs------");
|
||||
if (fs != null) {
|
||||
indexController.currentFeature.clear();
|
||||
indexController.currentFeature.add(fs);
|
||||
//print("----- fs is ${fs.properties!['photos']}");
|
||||
indexController.getAction();
|
||||
|
||||
Destination des = destinationController.festuretoDestination(fs);
|
||||
|
||||
@ -55,7 +54,7 @@ class MapWidget extends StatelessWidget {
|
||||
))
|
||||
//builder:((context) => BottomSheetWidget())
|
||||
).whenComplete(() {
|
||||
destinationController.skip_gps = false;
|
||||
destinationController.skipGps = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -107,7 +106,7 @@ class MapWidget extends StatelessWidget {
|
||||
}
|
||||
|
||||
List<LatLng>? getPoints() {
|
||||
print("##### --- route point ${indexController.routePoints.length}");
|
||||
//print("##### --- route point ${indexController.routePoints.length}");
|
||||
List<LatLng> pts = [];
|
||||
for (PointLatLng p in indexController.routePoints) {
|
||||
LatLng l = LatLng(p.latitude, p.longitude);
|
||||
@ -118,13 +117,13 @@ class MapWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
print(
|
||||
"---------- rog mode is ${indexController.rog_mode.value.toString()}----------");
|
||||
// print(
|
||||
// "---------- rog mode is ${indexController.rog_mode.value.toString()}----------");
|
||||
|
||||
final PopupController _popupController = PopupController();
|
||||
final PopupController popupController = PopupController();
|
||||
return Stack(
|
||||
children: [
|
||||
Obx(() => indexController.is_loading == true
|
||||
Obx(() => indexController.isLoading.value == true
|
||||
? const Padding(
|
||||
padding: EdgeInsets.only(top: 60.0),
|
||||
child: CircularProgressIndicator(),
|
||||
@ -134,19 +133,13 @@ class MapWidget extends StatelessWidget {
|
||||
options: MapOptions(
|
||||
maxZoom: 18.4,
|
||||
onMapReady: () {
|
||||
indexController.is_mapController_loaded.value = true;
|
||||
subscription = indexController.mapController.mapEventStream
|
||||
.listen((MapEvent mapEvent) {
|
||||
if (mapEvent is MapEventMoveStart) {
|
||||
//print(DateTime.now().toString() + ' [MapEventMoveStart] START');
|
||||
// do something
|
||||
}
|
||||
if (mapEvent is MapEventMoveEnd &&
|
||||
indexController.currentUser.isEmpty) {
|
||||
//print(DateTime.now().toString() + ' [MapEventMoveStart] END');
|
||||
indexController.loadLocationsBound();
|
||||
//indexController.rogMapController!.move(c.center, c.zoom);
|
||||
}
|
||||
if (mapEvent is MapEventMoveEnd) {}
|
||||
});
|
||||
},
|
||||
//center: LatLng(37.15319600454702, 139.58765950528198),
|
||||
@ -163,7 +156,7 @@ class MapWidget extends StatelessWidget {
|
||||
onPositionChanged: (MapPosition pos, isvalue) {
|
||||
indexController.currentBound = [pos.bounds!];
|
||||
},
|
||||
onTap: (_, __) => _popupController
|
||||
onTap: (_, __) => popupController
|
||||
.hideAllPopups(), // Hide popup when the map is tapped.
|
||||
),
|
||||
children: [
|
||||
@ -181,7 +174,7 @@ class MapWidget extends StatelessWidget {
|
||||
: Container(),
|
||||
),
|
||||
CurrentLocationLayer(
|
||||
followOnLocationUpdate: FollowOnLocationUpdate.once,
|
||||
followOnLocationUpdate: FollowOnLocationUpdate.never,
|
||||
turnOnHeadingUpdate: TurnOnHeadingUpdate.never,
|
||||
style: const LocationMarkerStyle(
|
||||
marker: DefaultLocationMarker(
|
||||
@ -199,13 +192,13 @@ class MapWidget extends StatelessWidget {
|
||||
? MarkerLayer(
|
||||
markers:
|
||||
indexController.locations[0].collection.map((i) {
|
||||
print("i si ${i.properties!['location_id']}");
|
||||
//print("i si ${i.properties!['location_id']}");
|
||||
|
||||
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
|
||||
GeoJsonMultiPoint p =
|
||||
i.geometry as GeoJsonMultiPoint;
|
||||
print(
|
||||
"lat is ${p.geoSerie!.geoPoints[0].latitude} and lon is ${p.geoSerie!.geoPoints[0].longitude}");
|
||||
//print(
|
||||
// "lat is ${p.geoSerie!.geoPoints[0].latitude} and lon is ${p.geoSerie!.geoPoints[0].longitude}");
|
||||
return Marker(
|
||||
anchorPos: AnchorPos.exactly(Anchor(108.0, 18.0)),
|
||||
height: 32.0,
|
||||
|
||||
Reference in New Issue
Block a user