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,8 +721,10 @@ 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}");
await addGPStoDB(position.latitude, position.longitude); if (isInRog.value) {
lastGPSCollectedTime = DateTime.now(); await addGPStoDB(position.latitude, position.longitude);
lastGPSCollectedTime = DateTime.now();
}
} }
currentLat = position.latitude; currentLat = position.latitude;

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,41 +82,50 @@ class MapWidget extends StatelessWidget {
size: 6.0, size: 6.0,
), ),
i.properties!['cp'] == -1 i.properties!['cp'] == -1
? Transform.rotate( ? Transform.translate(
alignment: Alignment.centerLeft, offset: Offset(18, 0),
origin: Offset.fromDirection(1, 26), child: Transform.rotate(
angle: 270 * pi / 180, alignment: Alignment.centerLeft,
child: const Icon( origin: Offset.fromDirection(1, 26),
Icons.play_arrow_outlined, angle: 270 * pi / 180,
color: Colors.red, child: const Icon(
size: 70, Icons.play_arrow_outlined,
)) color: Colors.red,
size: 70,
)),
)
: Container( : Container(
color: Colors.transparent, color: Colors.transparent,
), ),
], ],
)), )),
), ),
Container( Transform.translate(
color: Colors.purple.withOpacity(0.4), offset: Offset(40, 0),
// child: Text(TextUtils.getDisplayTextFeture(i), child: Align(
// style: const TextStyle( alignment: Alignment.center,
// fontSize: 16, child: Container(
// fontWeight: FontWeight.bold, color: Colors.purple.withOpacity(0.4),
// color: Colors.red, // child: Text(TextUtils.getDisplayTextFeture(i),
// ))), // style: const TextStyle(
child: Text( // fontSize: 16,
TextUtils.getDisplayTextFeture(i), // fontWeight: FontWeight.bold,
style: TextStyle( // color: Colors.red,
fontSize: 16, // ))),
fontWeight: FontWeight.w700, child: Text(
// アウトラインの色と幅を設定 TextUtils.getDisplayTextFeture(i),
foreground: Paint() style: TextStyle(
..style = PaintingStyle.stroke fontSize: 16,
..strokeWidth = 1 fontWeight: FontWeight.w700,
..color = Colors.white, // アウトラインの色と幅を設定
), foreground: Paint()
)) ..style = PaintingStyle.stroke
..strokeWidth = 1
..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));