チェックポイントのラベル表示不具合修正
This commit is contained in:
@ -147,69 +147,14 @@ class _MapWidgetState extends State<MapWidget> with WidgetsBindingObserver {
|
|||||||
child: getMarkerShape(feature),
|
child: getMarkerShape(feature),
|
||||||
));
|
));
|
||||||
|
|
||||||
/*
|
|
||||||
if (_markerCache.containsKey(latLng)) {
|
|
||||||
markers.add(_markerCache[latLng]!);
|
|
||||||
} else {
|
|
||||||
Marker marker = Marker(
|
|
||||||
point: latLng,
|
|
||||||
width: 30.0,
|
|
||||||
height: 30.0,
|
|
||||||
child: getMarkerShape(feature),
|
|
||||||
// child: getMarkerShape(feature, context),
|
|
||||||
);
|
|
||||||
_markerCache[latLng] = marker;
|
|
||||||
markers.add(marker);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return markers;
|
return markers;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
Future<List<Marker>> _getMarkers() async {
|
|
||||||
List<Marker> markers = [];
|
|
||||||
for (var feature in indexController.locations[0].features) {
|
|
||||||
GeoJSONMultiPoint point = feature!.geometry as GeoJSONMultiPoint;
|
|
||||||
LatLng latLng = LatLng(point.coordinates[0][1], point.coordinates[0][0]);
|
|
||||||
|
|
||||||
if (_markerCache.containsKey(latLng)) {
|
|
||||||
markers.add(_markerCache[latLng]!);
|
|
||||||
} else {
|
|
||||||
Marker marker = Marker(
|
|
||||||
point: latLng,
|
|
||||||
width: 30.0,
|
|
||||||
height: 30.0,
|
|
||||||
builder: (ctx) => getMarkerShape(feature, ctx),
|
|
||||||
//child: null,
|
|
||||||
);
|
|
||||||
_markerCache[latLng] = marker;
|
|
||||||
markers.add(marker);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return markers;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Widget getMarkerShape(GeoJSONFeature i, BuildContext context) {
|
// Widget getMarkerShape(GeoJSONFeature i, BuildContext context) {
|
||||||
Widget getMarkerShape(GeoJSONFeature i) {
|
Widget getMarkerShape(GeoJSONFeature i) {
|
||||||
/*
|
|
||||||
String labelText = TextUtils.getDisplayTextFeture(i);
|
|
||||||
if( i.properties!['cp'] == 0 ){
|
|
||||||
labelText="Start/Goal";
|
|
||||||
}else if(i.properties!['cp'] == -1 ){
|
|
||||||
labelText="Start";
|
|
||||||
}else if(i.properties!['cp'] == -2 ){
|
|
||||||
labelText="Goal";
|
|
||||||
//}else{
|
|
||||||
// labelText=i.properties!['cp'];
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
//if( i.properties!['cp'] <= 0 ) {
|
|
||||||
// debugPrint("Text=${labelText}");
|
|
||||||
//}
|
|
||||||
//final double maxWidth = labelText.length * 16.0; //16.0;
|
|
||||||
GeoJSONMultiPoint p = i.geometry as GeoJSONMultiPoint;
|
GeoJSONMultiPoint p = i.geometry as GeoJSONMultiPoint;
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@ -230,7 +175,8 @@ class _MapWidgetState extends State<MapWidget> with WidgetsBindingObserver {
|
|||||||
context: context,
|
context: context,
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
isDismissible: true,
|
isDismissible: true,
|
||||||
builder: ((context) => BottomSheetNew(destination: des, isAlreadyCheckedIn: value.isNotEmpty)),
|
builder: ((context) => BottomSheetNew(
|
||||||
|
destination: des, isAlreadyCheckedIn: value.isNotEmpty)),
|
||||||
).whenComplete(() {
|
).whenComplete(() {
|
||||||
destinationController.shouldShowBottomSheet = true;
|
destinationController.shouldShowBottomSheet = true;
|
||||||
destinationController.skipGps = false;
|
destinationController.skipGps = false;
|
||||||
@ -248,7 +194,9 @@ class _MapWidgetState extends State<MapWidget> with WidgetsBindingObserver {
|
|||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: i.properties!['buy_point'] > 0 ? Colors.blue : Colors.red,
|
color: i.properties!['buy_point'] > 0
|
||||||
|
? Colors.blue
|
||||||
|
: Colors.red,
|
||||||
width: 3,
|
width: 3,
|
||||||
style: BorderStyle.solid,
|
style: BorderStyle.solid,
|
||||||
),
|
),
|
||||||
@ -285,11 +233,13 @@ class _MapWidgetState extends State<MapWidget> with WidgetsBindingObserver {
|
|||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Container (
|
child: Container (
|
||||||
//width: 200, // 幅を指定
|
//width: 80, // 幅を指定
|
||||||
//height: 60, // 40
|
//height: 60, // 40
|
||||||
|
//color: Colors.purple.withOpacity(0.2),
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
|
|
||||||
//child: Text(' ').
|
//child: Text(' ').
|
||||||
//constraints: const BoxConstraints(maxWidth: 1000.0), // 最大幅を設定
|
//constraints: const BoxConstraints(maxWidth: 60.0), // 最大幅を設定
|
||||||
//constraints: BoxConstraints(maxWidth: maxWidth), // 最大幅を設定
|
//constraints: BoxConstraints(maxWidth: maxWidth), // 最大幅を設定
|
||||||
//color: Colors.purple.withOpacity(0.2),
|
//color: Colors.purple.withOpacity(0.2),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
@ -299,26 +249,28 @@ class _MapWidgetState extends State<MapWidget> with WidgetsBindingObserver {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16, // 16
|
fontSize: 16, // 16
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
|
overflow: TextOverflow.visible,
|
||||||
//height: 1.2,
|
//height: 1.2,
|
||||||
foreground: Paint()
|
foreground: Paint()
|
||||||
..style = PaintingStyle.stroke
|
..style = PaintingStyle.stroke
|
||||||
..strokeWidth = 2
|
..strokeWidth = 1 // 2
|
||||||
..color = Colors.white,
|
..color = Colors.white,
|
||||||
),
|
),
|
||||||
//maxLines: 1, // テキストを1行に制限
|
maxLines: 1, // テキストを1行に制限
|
||||||
//softWrap: false, // テキストの折り返しを無効化
|
softWrap: false, // テキストの折り返しを無効化
|
||||||
),
|
),
|
||||||
Text( // テキスト
|
Text( // テキスト
|
||||||
TextUtils.getDisplayTextFeture(i),
|
TextUtils.getDisplayTextFeture(i),
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
|
overflow: TextOverflow.visible,
|
||||||
//fontWeight: FontWeight.bold,
|
//fontWeight: FontWeight.bold,
|
||||||
//height: 1.2,
|
//height: 1.2,
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
//maxLines: 1, // テキストを1行に制限
|
maxLines: 1, // テキストを1行に制限
|
||||||
//softWrap: false, // テキストの折り返しを無効化
|
softWrap: false, // テキストの折り返しを無効化
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user