updated map markers

This commit is contained in:
2023-12-12 16:16:17 +05:30
parent 56c07852f9
commit 445c53d21b
3 changed files with 50 additions and 38 deletions

View File

@ -721,9 +721,11 @@ class DestinationController extends GetxController {
LogManager().addLog( LogManager().addLog(
"GPS : $currentLat, $currentLon - ${DateTime.now().hour}:${DateTime.now().minute}:${DateTime.now().second}:${DateTime.now().microsecond}"); "GPS : $currentLat, $currentLon - ${DateTime.now().hour}:${DateTime.now().minute}:${DateTime.now().second}:${DateTime.now().microsecond}");
if (isInRog.value) {
await addGPStoDB(position.latitude, position.longitude); await addGPStoDB(position.latitude, position.longitude);
lastGPSCollectedTime = DateTime.now(); lastGPSCollectedTime = DateTime.now();
} }
}
currentLat = position.latitude; currentLat = position.latitude;
currentLon = position.longitude; currentLon = position.longitude;

View File

@ -267,7 +267,7 @@ class ExternalService {
); );
String url = 'https://rogaining.sumasen.net/gifuroge/goal_from_rogapp'; String url = 'https://rogaining.sumasen.net/gifuroge/goal_from_rogapp';
//print('++++++++$url'); print('++++++++$url');
if (response.statusCode == 201) { if (response.statusCode == 201) {
Map<String, dynamic> res = json.decode(utf8.decode(response.bodyBytes)); Map<String, dynamic> res = json.decode(utf8.decode(response.bodyBytes));
// print('----_res : $res ----'); // print('----_res : $res ----');
@ -293,8 +293,8 @@ class ExternalService {
.toString() .toString()
.replaceAll('http://localhost:8100', 'http://rogaining.sumasen.net') .replaceAll('http://localhost:8100', 'http://rogaining.sumasen.net')
}); });
// print("-- json -- $rec"); print("-- json -- $rec");
// print('----- response2 is $response2 --------'); print('----- response2 is $response2 --------');
if (response2.statusCode == 200) { if (response2.statusCode == 200) {
res2 = json.decode(utf8.decode(response2.bodyBytes)); res2 = json.decode(utf8.decode(response2.bodyBytes));
} }

View File

@ -29,8 +29,9 @@ class MapWidget extends StatelessWidget {
GeoJSONMultiPoint p = i.geometry as GeoJSONMultiPoint; 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}");
//RegExp regex = RegExp(r'([.]*0)(?!.*\d)'); //RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
return Row( return Stack(
mainAxisAlignment: MainAxisAlignment.start, fit: StackFit.expand,
//mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
@ -81,7 +82,9 @@ class MapWidget extends StatelessWidget {
size: 6.0, size: 6.0,
), ),
i.properties!['cp'] == -1 i.properties!['cp'] == -1
? Transform.rotate( ? Transform.translate(
offset: Offset(18, 0),
child: Transform.rotate(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
origin: Offset.fromDirection(1, 26), origin: Offset.fromDirection(1, 26),
angle: 270 * pi / 180, angle: 270 * pi / 180,
@ -89,14 +92,19 @@ class MapWidget extends StatelessWidget {
Icons.play_arrow_outlined, Icons.play_arrow_outlined,
color: Colors.red, color: Colors.red,
size: 70, size: 70,
)) )),
)
: Container( : Container(
color: Colors.transparent, color: Colors.transparent,
), ),
], ],
)), )),
), ),
Container( Transform.translate(
offset: Offset(40, 0),
child: Align(
alignment: Alignment.center,
child: Container(
color: Colors.purple.withOpacity(0.4), color: Colors.purple.withOpacity(0.4),
// child: Text(TextUtils.getDisplayTextFeture(i), // child: Text(TextUtils.getDisplayTextFeture(i),
// style: const TextStyle( // style: const TextStyle(
@ -115,7 +123,9 @@ class MapWidget extends StatelessWidget {
..strokeWidth = 1 ..strokeWidth = 1
..color = Colors.white, ..color = Colors.white,
), ),
)) )),
),
)
], ],
); );
} }
@ -216,8 +226,8 @@ class MapWidget extends StatelessWidget {
// "lat is ${p.geoSerie!.geoPoints[0].latitude} and lon is ${p.geoSerie!.geoPoints[0].longitude}"); // "lat is ${p.geoSerie!.geoPoints[0].latitude} and lon is ${p.geoSerie!.geoPoints[0].longitude}");
return Marker( return Marker(
alignment: Alignment.center, alignment: Alignment.center,
height: 32.0, height: 27.0,
width: 120.0, width: 127.0,
point: LatLng( point: LatLng(
p.coordinates[0][1], p.coordinates[0][0]), p.coordinates[0][1], p.coordinates[0][0]),
child: getMarkerShape(i, context)); child: getMarkerShape(i, context));