Giter Club home page Giter Club logo

flutter_map_marker_popup's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flutter_map_marker_popup's Issues

Can't use along flutter_map ^2.0.0

If i try to use this plugin along with flutter map ^2.0.0. It throws the error.

Because flutter_map_marker_popup >=2.2.0 depends on flutter_map ^1.0.0 and flutter_map_arcgis 2.0.0 depends on flutter_map ^0.14.0, flutter_map_marker_popup >=2.2.0 is incompatible with flutter_map_arcgis 2.0.0.
And because no versions of flutter_map_arcgis match >2.0.0 <3.0.0, flutter_map_marker_popup >=2.2.0 is incompatible with flutter_map_arcgis ^2.0.0.
So, because servicerequest depends on both flutter_map_arcgis ^2.0.0 and flutter_map_marker_popup ^3.1.0+1, version solving failed.
pub get failed (1; So, because servicerequest depends on both flutter_map_arcgis ^2.0.0 and flutter_map_marker_popup ^3.1.0+1, version solving failed.)

Can you update the dependency flutter_map to the latest version ?.

MarkerTapBehavior.togglePopupAndHideRest doesnt work as expected

Hi.
MarkerTapBehavior.togglePopupAndHideRest doesnt work as expected.
When I tap to the Marker popUp is appear, but when I tap one more time to that marker, popUp doesnt dissapear.

popupState.selectedMarkers is always empty and contains(marker) is always return false

This was tested for the example code of the flutter_map_marker_cluster

Conflicts with plugin flutter_map_location_marker

Hi,

I would like to use your plugin, but it conflicts with the flutter_map_location_marker plugin.
When your plugin is lower in the child widget stack, the flutter_map_location_marker grabs the gestures first and no pupup is shown.

When your widget is top, the markes are hiding the location marker, which doesn't look nice.

Any ideas?

Popup does not pop up

Hello! I did my Map like in examples, but popup does not pop up
My part of code:
layers: [
TileLayerOptions(
urlTemplate:
'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
),
if (points != null)
PolylineLayerOptions(
polylines: [
Polyline(
points: points, strokeWidth: 5, color: Colors.red),
],
),
PopupMarkerLayerOptions(
popupController: _popupLayerController,
markers: markers,
popupSnap: PopupSnap.markerTop,
markerRotateAlignment:
PopupMarkerLayerOptions.rotationAlignmentFor(
AnchorAlign.top),
popupBuilder: (BuildContext context, Marker marker) =>
ExamplePopup(marker),
),
MarkerLayerOptions(markers: [_person]),
],
ExamplePopus like in example code

PopupMarkerLayerOptions.popupBuilder callback is called multiple times when marker is clicked

It seems that the PopupMarkerLayerWidget has a bug where when a marker is clicked, the popupBuilder callback is called muliple times. The code is attached below.

import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong2/latlong.dart';
import 'package:flutter_map_marker_popup/flutter_map_marker_popup.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Map',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final PopupController _popupLayerController = PopupController();
  final double _zoom = 10;
  final List<LatLng> _latLngList = [
    LatLng(56.163633, -3.498063),
    LatLng(56.163633, -3.598063),
  ];
  List<Marker> _markers = [];

  @override
  void initState() {
    _markers = _latLngList
        .asMap()
        .entries
        .map((point) => Marker(
              key: Key(point.key.toString()),
              point: point.value,
              width: 60,
              height: 60,
              builder: (context) => GestureDetector(
                child: const Icon(
                  Icons.location_on,
                  size: 50,
                  color: Colors.red,
                ),
              ),
            ))
        .toList();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Awesome Map'),
      ),
      body: FlutterMap(
        options: MapOptions(
          interactiveFlags: InteractiveFlag.doubleTapZoom |
              InteractiveFlag.pinchZoom |
              InteractiveFlag.drag,
          center: _latLngList[0],
          zoom: _zoom,
        ),
        children: [
          TileLayer(
            minZoom: 3,
            maxZoom: 18,
            backgroundColor: Colors.black,
            // errorImage: ,
            urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
            subdomains: const ['a', 'b', 'c'],
          ),
          MarkerLayer(
            markers: _markers,
          ),
          PopupMarkerLayerWidget(
            options: PopupMarkerLayerOptions(
              popupSnap: PopupSnap.mapBottom,
              popupAnimation: const PopupAnimation.fade(),
              markers: _markers,
              popupController: _popupLayerController,
              popupBuilder: (ctx, marker) {
                print("===> ${marker.key} clicked");
                return Container();
                // return Container();
              },
            ),
          ),
        ],
      ),
    );
  }
}

Expected:
callback function is called only once when marker is clicked.

Actual:
callback function is called multiple times (from looking at the console output).

show popup without tap

Hi, I'm trying to have the popups appear on map load.
Is there a way to trigger popup to show up without tapping on marker?

Thanks!

How to show popup programmatically?

Hi! I'm new to flutter and this library and have encountered an issue I don't know how to solve.

I'm developing an app that shows shop locations as markers on the map. I have a map view with markers and a list view with all the shops. The markers have popups implemented using this library and they work perfectly fine. Now I want to show the popup when the user clicks the show on map button. I've figured out how to center a map at the marker location, now I only need to show the popup.

So the question is: how do I do that? Is it even possible with this library?

App crashes with Marker Popups displayed

I'm running a flutter_map 0.9.0 withCachedNetworkTileProviderdisplaying a Mapbox map. Zooming and panning around with just the map displayed works fine. However, then displaying about 50 marker_popup markers my app crashes at completely random times, but always when panning the map. The app slows down notably and then crashes. There is no error thrown and debug only prints

Lost connection to device.
Exited (sigterm)

I have tried enclosing everything in try/catch blocks and also running Crashlytics but nothing shows up anywhere.

During development I am debugging on a physical iPad. Same crashes occur on other devices running the app deployed through Testflight.

DevTools shows available memory and the memory usage is at times much higher than when the crashes occur.

Any ideas on how to find the problem would be highly appreciated

Popup is not displayed over the Markers layer

As we can see on the next picture, popup is not displayed on top of the marker layer. The yellow dots should be displayed behind the popup.

image

In the flutter_map children property, the popupLayerWidgets are displayed after the markerLayerWidget as bellow:

image

Popup keeps state when tapping another marker

Issue originally reported here: fleaflet/flutter_map#590 (comment) :

When I click on a Marker and then click on another Marker it keeps the information from the previous marker in Popup. To update the information you need to click on the map and then click on the Marker. I tried to solve it by calling hide before the change but it doesn't work.

popupLayerController.hidePopup(); mapController.move(LatLng(city.latitude, city.longitude), 7); >popupLayerController.togglePopup(markers[index]);

Popup is not shown

Hello,

I've just found your plugin and gave a try, but, unfortunately, the popup is not displayed.

After trying with Stateless widgets and "complex" layouts, I've reduced it to:

PopupMarkerLayerOptions(
  markers: this._markerList,
  popupSnap: PopupSnap.top,
  popupController: this._popupLayerController,
  popupBuilder: (BuildContext _, Marker marker) => Container(
	child: Text("HI"),
	color: Colors.yellow,
	width: 200,
  ),
),

And even that way, when I tap any marker displayed in the map, nothing happens.

Do you have any insights?

Update example gif

The example gif is for the old example app before rotation and animations were added and the example app updated to showcase those features.

"Floating" Popup Widget

First of all, thanks for developing this plugin - it's great.

I'm just wondering if it is possible to have the popup widget "float" above the map instead of being embedded into the map layer? The behaviour would be the same as a typical floating action button.

Show Popup out of the box?

I am so excited about this package. In particular, the actual popup window has impressed me.

I would like to call the popup outside of this package. How is this possible? Specifically, it is about the package https://pub.dev/packages/flutter_map_tappable_polyline

Unfortunately, I can't get the design right with AlertDialog's customizing. Problems also with the exact positioning of the popup.

TappablePolylineLayerWidget(
  options: TappablePolylineLayerOptions(
      polylineCulling: false,
      pointerDistanceTolerance: 20,
      polylines: _mapPolylines,
      onTap: (polylines, tapPosition) {
        _popupLayerController.hideAllPopups();

        /// HERE:
        MapPopupCorso.show(context, polylines.map((polyline) => polyline.tag).join(','));
      },
     ),
),
PopupMarkerLayerWidget(
  options: PopupMarkerLayerOptions(
    popupController: _popupLayerController,
    markers: _markers,
    markerRotateAlignment: PopupMarkerLayerOptions.rotationAlignmentFor(AnchorAlign.top),
    popupBuilder: (_, Marker marker) {
      if (marker is MapMarker) {
        return MapPopup(markerData: marker.markerData);
      }
      return const SizedBox();
    },
  ),
),

Ordering of LayerWidget's can break popup functionality

I've noticed that if you put a PolylineLayerWidget or PolygonLayerWidget AFTER a PopupMarkerLayerWidget it breaks the popup functionality of the popup marker. Layers will still show correctly but nothing happens when you click on a marker and no error/exception is thrown so you don't know you're doing something wrong.

Sorry if this is in the documentation somewhere and it's known behaviour but I suspect it's not so I'm mentioning it.

Animate opacity?

Hi,

Great plugin! Is there a way to fade the popups in and out?

Thanks so much!

How to adjust popup snap for map rotation

Hi all -

I'm using popupsnap.mapBottom, but the popup moves up and down based on the rotation of the map. Is there a way to snap this to the bottom of the container holding FlutterMap?

Screenshot 2023-03-03 at 12 36 22 PM

Screenshot 2023-03-03 at 12 35 56 PM

Can we use popups with Polygons?

@rorystephenson Hi:)
I know when and which PolyGon a user presses by the below code
Is there a way to show popup around the tapped polygon with this plugin?

body: FlutterMap(
        mapController: mapController,
        options: MapOptions(
          // controller: mapController,
          interactiveFlags: InteractiveFlag.all & ~InteractiveFlag.rotate,
          center: LatLng(40.980222, 29.036929),
          onTap: (tapPosition, latlng) {
            onPolygon(latlng);
          },
        ),

how to pass marker "extra information" to the popup

I would like to give a "name" to the marker and insert this name inside the popup. How can this be realized? In the examples I see only how to display the basic properties of a Marker: position, icon and size of the icon... Thank you.

Popup not displayed

using :

  • flutter_map 0.14.0
  • flutter_map_marker_cluster 0.4.3

in the FlutterMaps layers property:

PopupMarkerLayerOptions(
                popupController: _checkpointPopupController,
                markerCenterAnimation: MarkerCenterAnimation(),
                markers: checkpointMarkers,
                popupBuilder: (BuildContext context, Marker marker) {
                  return ExamplePopup(marker); //CheckpointPopup(checkpoint);
                }),

Markers are correctly displayed but Popup is never displayed when clicking on marker.
ExamplePopup is your sample code.

Any idea ?

Popup doesn't show when markers got from provider

  PopupMarkerLayerOptions(
          markers: mapProvider.markers,
          popupSnap: PopupSnap.top,
          popupController: _popupLayerController,
          popupBuilder: (_, marker) {
            print('@@ $runtimeType @@ popupBuilder() marker=$marker');
            return isSetLocation ? Container() : MyMarkerPopup(marker: marker);
          },
        )

here PopupMarkerLayerOptions get it's marker from provider the problem is the popupBuilder didn't call after the markers updated, therefore the popup didn't show, it's show only when I pop map screen then push to it again

need help

when popup window opened then dragging map, the popup builder triggered?
Screenshot_2022-08-08_02-30-05

Popup does not pop up if marker returns a GestureDetector

This may be obvious to flutter veterans but it took me quite a while to realize that this plugin did not work for me because I had given it my standard markers that returned a GestureDetector:

Marker(
  point: latLng,
  builder: (context) => GestureDetector(
    behavior: HitTestBehavior.opaque,
    child: Icon(...),
    onTap: onTap,
  ),
)

Instead I have to return something else:

Marker(
  point: latLng,
  builder: (context) => Icon(...),
)

Might be worth adding to the readme.

Thanks for this great tool. And feel free to immediately close this issue.

Listen for popup events?

I just updated the plugin from an older version, and noticed that PopupController doesn't expose the streamController anymore. I found that it is still there, but moved to PopupControllerImpl.

So now I'm wondering, what is the proper way to listen for popup events? I need to take some action when a popup has been shown or hidden. Importing and using PopupControllerImpl feels like a hack (and IntelliJ gives a warning that I shouldn't import implementation files from another package), but I can't find any other way to do it.

FLUTTER_MAP RELATIONS: New Documentation

This message has been sent to multiple plugin authors, so it is not personalised

As part of fleaflet/flutter_map#992 & fleaflet/flutter_map#927 (reply in thread), I (a documentation author) am contacting plugin authors to ensure the information about this plugin on the new documentation is correct; or alternatively, if this plugin is not yet on the existing list, to check whether you would like to add your plugin to the new documentation.

I would also like you to check you conform to these new rules:

  • this plugin is available via a pub.dev installation to make it easier for developers - if your plugin does not currently have a pub.dev page, please add one or let me know otherwise,
  • the plugin documentation includes enough information for installation and basic setup/functionality,
  • the plugin includes a runnable example and/or screenshots,
  • the plugin description contains the words ' - IN BETA' after the author link on the same line if your plugin is in beta,

Currently I have copied over the existing plugin descriptions, and you can see these here: https://flutter-map.vercel.app/plugins/list. Please note that this documentation is currently unapproved and should not be used unless otherwise directed, as some information may be incorrect or missing, or might change in the future. There is no ETA at the moment, but things seem to be moving along.

Should you wish for the description to remain the same as current on the page linked above, you do not have to reply, you can close this issue.

If you wish to change any information, please leave this issue open and add your reply as a comment.

flutter_map maintainers do not take any responsibility for this message, I am the sole author.

On behalf of myself and the flutter_map community thank you for your excellent plugin :).

How to update markers dynamically

Hello,
I want to retrieve data from a service depending on the portion of the map available on the screen. The problem is that I didn't find a way to dynamically update markers in a PopupMarkerLayerOption.
Should I use the "rebuild" property? If so, do you have any usage examples?

Thank you

Popups not showing when definition is in layers: []

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, ), ], ), ), ], ), ), ); }

flutter_map_marker_popup does not "play well" with flutter_map_marker_cluster

First of all, the obligatory compliments and thanks for developing this nifty plugin.

I'd like to use marker clustering as well as the marker popup plugin. However, they don't seem to interact together.

When I attempt to use both, the clustering seems to get overridden (or, perhaps, overwritten, it's difficult to tell).

Marker return in a previously position if another marker is pressed during an animations

I have an issue with the animation of the markers. I setted the MarkerCenterAnimation but when I press a marker, if during this animation I press another marker the new marker pressed is unreachable and the map is going crazy.

This is an example:
https://imgur.com/a/RjqVud0

I setted an high duration time of the animation to mark the problem.

I didn't retrieve any error in the console.

This is my flutter doctor:

[✓] Flutter (Channel master, 2.11.0-0.0.pre.752, on macOS 12.2.1 21D62 darwin-arm, locale en-GB)
    • Flutter version 2.11.0-0.0.pre.752 at /Users/carlodenardin/Workspace/Dependencies/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a786f65700 (32 hours ago), 2022-03-03 03:01:22 -0500
    • Engine revision 993285f64d
    • Dart version 2.17.0 (build 2.17.0-165.0.dev)
    • DevTools version 2.11.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/carlodenardin/Library/Android/sdk
    • Platform android-31, build-tools 30.0.3
    • Java binary at: /Library/Java/JavaVirtualMachines/jdk-11.0.11.jdk/Contents/Home/bin/java
    • Java version Java(TM) SE Runtime Environment 18.9 (build 11.0.11+9-LTS-194)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Users/carlodenardin/Downloads/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] VS Code (version 1.65.0)
    • VS Code at /Users/carlodenardin/Workspace/Ide/Visual Studio Code.app/Contents
    • Flutter extension version 3.36.0

[✓] Connected device (2 available)
    • iPhone 13 (mobile) • 0B09936E-70C6-4B29-8E70-594917B29350 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome
      99.0.4844.51

[✓] HTTP Host Availability
    • All required HTTP hosts are available

Error thrown by stack as PopupMarkerLayerOptions is null

Both examples run smoothly in my flutter_map_marker_popup clone.

But when I try a simpler version in my own project, I get the following stack:

Launching lib\simple_map_with_popup.dart on ASUS I01WD in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...
D/FlutterActivity(12790): Using the launch theme as normal theme.
D/FlutterActivityAndFragmentDelegate(12790): Setting up FlutterEngine.
D/FlutterActivityAndFragmentDelegate(12790): No preferred FlutterEngine was provided. Creating a new FlutterEngine for this FlutterFragment.
D/FlutterActivityAndFragmentDelegate(12790): Attaching FlutterEngine to the Activity that owns this Fragment.
D/FlutterView(12790): Attaching to a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@e6a89bb
D/FlutterActivityAndFragmentDelegate(12790): Executing Dart entrypoint: main, and sending initial route: /
Debug service listening on ws://127.0.0.1:54518/2H6JV7ZKrb8=/ws
Syncing files to device ASUS I01WD...
I/flutter (12790): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter (12790): The following assertion was thrown building LayoutBuilder:
I/flutter (12790): Stack's children must not contain any null values, but a null value was found at index 1
I/flutter (12790): 
I/flutter (12790): The relevant error-causing widget was:
I/flutter (12790):   LayoutBuilder
I/flutter (12790):   file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_map-0.9.0/lib/src/map/flutter_map_state.dart:73:12
I/flutter (12790): 
I/flutter (12790): When the exception was thrown, this was the stack:
I/flutter (12790): #0      new MultiChildRenderObjectWidget.<anonymous closure> (package:flutter/src/widgets/framework.dart:1701:11)
I/flutter (12790): #1      new MultiChildRenderObjectWidget (package:flutter/src/widgets/framework.dart:1707:8)
I/flutter (12790): #2      new Stack (package:flutter/src/widgets/basic.dart:3194:8)
I/flutter (12790): #3      FlutterMapState.build.<anonymous closure> (package:flutter_map/src/map/flutter_map_state.dart:97:24)
I/flutter (12790): #4      _LayoutBuilderElement._layout.<anonymous closure> (package:flutter/src/widgets/layout_builder.dart)
I/flutter (12790): #5      BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2412:19)
I/flutter (12790): #6      _LayoutBuilderElement._layout (package:flutter/src/widgets/layout_builder.dart:95:11)
I/flutter (12790): #7      RenderObject.invokeLayoutCallback.<anonymous closure> (package:flutter/src/rendering/object.dart:1823:58)
I/flutter (12790): #8      PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:875:15)
I/flutter (12790): #9      RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1823:13)
I/flutter (12790): #10     RenderConstrainedLayoutBuilder.layoutAndBuildChild (package:flutter/src/widgets/layout_builder.dart:173:5)
I/flutter (12790): #11     _RenderLayoutBuilder.performLayout (package:flutter/src/widgets/layout_builder.dart:240:5)
I/flutter (12790): #12     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #13     RenderStack.performLayout (package:flutter/src/rendering/stack.dart:505:15)
I/flutter (12790): #14     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #15     MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:163:11)
I/flutter (12790): #16     _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:477:7)
I/flutter (12790): #17     MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:232:7)
I/flutter (12790): #18     RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:391:14)
I/flutter (12790): #19     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #20     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #21     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #22     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #23     _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1232:11)
I/flutter (12790): #24     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #25     MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:163:11)
I/flutter (12790): #26     _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:477:7)
I/flutter (12790): #27     MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:232:7)
I/flutter (12790): #28     RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:391:14)
I/flutter (12790): #29     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #30     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #31     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #32     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #33     _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1232:11)
I/flutter (12790): #34     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #35     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #36     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #37     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #38     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #39     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #40     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #41     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #42     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #43     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #44     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #45     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #46     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #47     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #48     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #49     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #50     RenderOffstage.performLayout (package:flutter/src/rendering/proxy_box.dart:3168:13)
I/flutter (12790): #51     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #52     RenderStack.performLayout (package:flutter/src/rendering/stack.dart:505:15)
I/flutter (12790): #53     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #54     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #55     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #56     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #57     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #58     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #59     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #60     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #61     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #62     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #63     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #64     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #65     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #66     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
I/flutter (12790): #67     RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
I/flutter (12790): #68     RenderView.performLayout (package:flutter/src/rendering/view.dart:167:13)
I/flutter (12790): #69     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1584:7)
I/flutter (12790): #70     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:844:18)
I/flutter (12790): #71     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:344:19)
I/flutter (12790): #72     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:774:13)
I/flutter (12790): #73     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:283:5)
I/flutter (12790): #74     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1102:15)
I/flutter (12790): #75     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1041:9)
I/flutter (12790): #76     SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:850:7)
I/flutter (12790): #85     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:384:19)
I/flutter (12790): #86     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:418:5)
I/flutter (12790): #87     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
I/flutter (12790): (elided 8 frames from package dart:async and package dart:async-patch)
I/flutter (12790): 
I/flutter (12790): ════════════════════════════════════════════════════════════════════════════════════════════════════
E/AccessibilityBridge(12790): VirtualView node must not be the root node.

Here you can find my dart code:

import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map_marker_popup/flutter_map_marker_popup.dart';
import 'package:latlong/latlong.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Welcome to Flutter',
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Test'),
        ),
        body: AnimatedMapPage(),
      ),
    );
  }
}

class AnimatedMapPage extends StatefulWidget {
  @override
  AnimatedMapPageState createState() {
    return AnimatedMapPageState();
  }
}

class AnimatedMapPageState extends State<AnimatedMapPage>
    with TickerProviderStateMixin {
  MapController mapController;
  PopupController popupLayerController = PopupController();

  @override
  Widget build(BuildContext context) {
    void _onTap(LatLng point) =>
        {
          popupLayerController.hidePopup()
        };

    final _markers = <Marker>[
      Marker(
          point: LatLng(1, 1),
          builder: (BuildContext c) =>
              Icon(Icons.edit_location,
                  color: Colors.blueAccent, size: 30)),
      Marker(
          point: LatLng(2, 2),
          builder: (BuildContext c) =>
              Icon(Icons.edit_location,
                  color: Colors.blueAccent, size: 30)),
    ];

    return Scaffold(
      body: Stack(
        children: <Widget>[
          FlutterMap(
            mapController: mapController,
            options: MapOptions(
                center: LatLng(51.5, -0.09),
                zoom: 5.0,
                maxZoom: 19.0,
                minZoom: 2.0,
                onTap: _onTap),
            layers: <LayerOptions>[
              TileLayerOptions(
                  urlTemplate:
                  'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
                  subdomains: ['a', 'b', 'c']),
//              MarkerLayerOptions(markers: _markers),
              PopupMarkerLayerOptions(
                markers: _markers,
                popupController: popupLayerController,
                popupBuilder: (_, Marker marker) {
                  return Card(child: const Text('Not a monument'));
                },
              ),
            ],
          ),
        ],
      ),
    );
  }
}

If I use the simple MarkerLayerOptions instead of the PopupMarkerLayerOptions, everything runs smoothly.

My pubspec.yaml:

version: 1.0.0+1

environment:
  sdk: ">=2.2.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  # Added by me
  cloud_firestore: ^0.13.6
  fluttertoast: ^3.1.3
  flutter_bloc: ^4.0.0
  flutter_map: any
  geoflutterfire: any
  geolocator: ^5.3.0
  latlong: ^0.6.1
  pedantic: ^1.8.0
  flutter_map_marker_popup: 0.1.4

method to check whether popup is showing or not

First of all,

thanks for this library, is there any way i can know, whether popup is showing or not, as i know, a method exist there but i can compare it to check whether popup is dismissed or showing.

like nPopupEvent: (event, selectedMarkers) {}

here event is a sealed, and i am not able to use it whehter it is showing or hiding.

Regards,
Vikram Singh

Feature Request: Show popups inside current window

I have a map view that isn't scrollable (that is, the interactiveFlags map option is set to InteractiveFlag.none). I'm also using a PopupLayer with popupSnap set to PopupSnap.markerTop. When these popups are close to the edge of the map, it'd be super useful if there was an option to force them to move over slight (left, right, or down), to ensure the popup fits inside the map.

I'm happy to help by writing or testing a PR if you could give me some pointers for how you'd suggest implementing this. 🙂

Current Behaviour

Suggested Behaviour

Popup.mapXXX and Mapcontroller.move

Hi guys. If popup snap on map and popup ontap runs mapcontroller.move function, after that I cannot move anywhere on map. Did you ever face this problem?

popupBuilder called on map move

If a popup is open, every map move will cause the popupBuilder to be called. Is there a way to prevent this?

In my case, when the popup is build I get data from a local database (which can be a lot) so then if I move the map with the popup open, the database gets called and the dataset processed again, over and over. This slows down performance.

min/max zoom

Is there any implementation of min/max zoom for PopupMarkerLayerOptions? For massive data, this option should be good.

I want to use popup and cluster in same time.

Can't use along flutter_map ^4.0.0

If i try to use this plugin along with flutter map ^4.0.0 i get the following error when getting packages:

Because flutter_map_marker_popup 4.0.3 depends on flutter_map ^3.1.0 and no versions of flutter_map_marker_popup match >4.0.3 <5.0.0, flutter_map_marker_popup ^4.0.3 requires flutter_map ^3.1.0.
So, because fsd_desktop depends on both flutter_map ^4.0.0 and flutter_map_marker_popup ^4.0.3, version solving failed.
pub get failed

How to add button inside popup

Hi, I want to add a button inside the popup, it showed without any problem but I click on the button nothing happens after some research I find that when I click on the button the map on tap event fired its like I am tapping on the map layer itself, not on the popup button.

Popups closes by itself

Hi! I'm experiencing an issue whereby the live location updates will cause the popups to close by themselves. Any workaround on this? Thanks!

marker popup not above other markers

Thanks for your great little package mate. However, I have one undersirable issue.

I have two sepearate marker layers - airports and POIs. The issue is that the airport popup window is showing the poi map markers from the map on the popup window (see screenshot).

children: <Widget>[
    TileLayer(
      urlTemplate: ref.watch(fsdMapLayerStateProvider),
      subdomains: const ['a', 'b', 'c'],
    ),
    const FlightPlanPolylineWidget(),
    Visibility(
      visible: showFlightsChecked,
      child: const FlightPolygonWidget(),
    ),
    Visibility(
      visible: showFlightsChecked,
      child: const FlightPolylineWidget(),
    ),
    const PoiMarkersWidget(),
    const AirportMarkersWidget(),
  ],

`

I could reverse the order of the Poi and Airport markers widgets but i just get the same issue except the airports markers show on the Poi Popup window.

It also very difficult for me to combine these markers - The PoiMarkersWidget widget uses the supercluster plugin, whilst the AirportMarkersWidget doesnt and the airport markers are only visible at a certain zoom level. Basically, messy and difficult to combine these markers.

How can we make the popup window to be above everything else on the map.? I think that any popup window should be above all other map layers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.