update
This commit is contained in:
@ -21,7 +21,26 @@ class MapPage extends StatelessWidget {
|
||||
|
||||
final HomeController homeController = Get.find<HomeController>();
|
||||
|
||||
final MapController mapController = MapController();
|
||||
static final MapController mapController = MapController();
|
||||
|
||||
|
||||
Widget getBreadCurms(){
|
||||
print("---------map-------------");
|
||||
return Obx(() =>
|
||||
homeController.perfectures.length > 0 ?
|
||||
BreadCrumb.builder(
|
||||
itemCount: homeController.perfectures.length,
|
||||
builder: (index) {
|
||||
return BreadCrumbItem(
|
||||
content: PerfectureWidget(homeController: homeController,) //Text('Item$index')
|
||||
);
|
||||
},
|
||||
divider: Icon(Icons.chevron_right),
|
||||
) :
|
||||
Container(width: 0, height: 0,),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -68,16 +87,8 @@ class MapPage extends StatelessWidget {
|
||||
height: 50.0,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: BreadCrumb(
|
||||
items: <BreadCrumbItem>[
|
||||
BreadCrumbItem(content:
|
||||
//Text('Item1', style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold),)
|
||||
PerfectureWidget(),
|
||||
),
|
||||
BreadCrumbItem(content: Text('Item2', style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold),)),
|
||||
],
|
||||
divider: Icon(Icons.chevron_right),
|
||||
),
|
||||
child:
|
||||
getBreadCurms(),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
@ -87,7 +98,9 @@ class MapPage extends StatelessWidget {
|
||||
FlutterMap(
|
||||
mapController: mapController,
|
||||
options: MapOptions(
|
||||
center: LatLng(37.15319600454702, 139.58765950528198),
|
||||
|
||||
//center: LatLng(37.15319600454702, 139.58765950528198),
|
||||
bounds: homeController.currentBound.length > 0 ? homeController.currentBound[0]: LatLngBounds.fromPoints([LatLng(37.15319600454702, 139.58765950528198)]),
|
||||
zoom: 6,
|
||||
maxZoom: 20,
|
||||
plugins: [
|
||||
@ -121,13 +134,14 @@ class MapPage extends StatelessWidget {
|
||||
builder:((context) => BottomSheetWidget())
|
||||
);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
size: Size(40, 40),
|
||||
anchor: AnchorPos.align(AnchorAlign.center),
|
||||
fitBoundsOptions: const FitBoundsOptions(
|
||||
padding: EdgeInsets.all(50),
|
||||
maxZoom: 15,
|
||||
maxZoom: 265,
|
||||
),
|
||||
markers:homeController.locations[0].collection.map((i) {
|
||||
GeoJsonMultiPoint p = i.geometry as GeoJsonMultiPoint;
|
||||
|
||||
Reference in New Issue
Block a user