rorystephenson / flutter_map_marker_popup

Popups for flutter_map markers
BSD 3-Clause "New" or "Revised" License
103 stars 84 forks source link

Popups not showing when definition is in layers: [] #53

Closed dinonovak closed 2 years ago

dinonovak commented 2 years ago

Hi,

I am trying to add popups to already functioning map that is showing track. This is how markers are added to page. If I try to move to children: [] as widget markers are not shown on map

this is how page is rendered at the end. @override Widget build(BuildContext context) { return SafeArea( child: Scaffold( body: Column( children: <Widget>[ ElevatedButton( onPressed: getCurrentLocation, child: Text('current location'), ), Container( height: 700, child: FlutterMap( options: MapOptions( center: _center, zoom: 10.0, //onTap: (_, __) => _popupLayerController // .hideAllPopups(), // Hide popup when the map is tapped. plugins: [ ZoomButtonsPlugin(), ], ), mapController: _mapController, layers: [ TileLayerOptions( urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", subdomains: ['a', 'b', 'c'], ), PolylineLayerOptions( polylines: _polylines, ), PopupMarkerLayerOptions( popupController: _popupLayerController, markers: _markers, markerRotateAlignment: PopupMarkerLayerOptions.rotationAlignmentFor( AnchorAlign.top), popupBuilder: (BuildContext context, Marker marker) => ExamplePopup(marker), ), ], nonRotatedLayers: [ ZoomButtonsPluginOption( minZoom: 4, maxZoom: 19, mini: true, padding: 10, alignment: Alignment.bottomRight, ), ], ), ), ], ), ), ); }

dinonovak commented 2 years ago

Sorry, issue with flutter_map version, all fixed