Giter Club home page Giter Club logo

Comments (5)

rorystephenson avatar rorystephenson commented on August 22, 2024

Hi @deezaster, thanks for the interest in this plugin :).

Can you give me some more information about what is not working?

If you can give me a full example that I can run (or a link to a repo) it will be easier to help you out!

from flutter_map_marker_popup.

deezaster avatar deezaster commented on August 22, 2024

Everything works perfectly!

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

But I want to use the popup for the package flutter_map_tappable_polyline but don't know how.

Currently I am calling an AlertDialog (customized as MapPopupCorso, see HERE in the code). But this one is ugly and is only displayed centered. I would like to use your popup with exact positioning.

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

        /// === > HERE:
        MapPopupCorso.show(context, polylines.map((polyline) => polyline.tag).join(','));
      },
     ),
),

from flutter_map_marker_popup.

rorystephenson avatar rorystephenson commented on August 22, 2024

@deezaster Ah OK I think I understand now. So it looks like you have map markers with the working popup but you also want the popups to show when you tap on the polyline. If that's right then you need to have a mapping from the polyline to the marker (either stored in a Map or perhaps it's possible to extend polyline to have it contain a reference to a marker) then just call _popupLayerController.showPopupsOnlyFor() with the relevant marker.

from flutter_map_marker_popup.

deezaster avatar deezaster commented on August 22, 2024

Yeah, i did it! Thanks for the support and help.

from flutter_map_marker_popup.

rorystephenson avatar rorystephenson commented on August 22, 2024

Great I'm glad it works for you 🙂.

from flutter_map_marker_popup.

Related Issues (20)

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.