Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add marker to image?

Tags:

flutter

dart

I would like to add a marker to an image of a floorplan.

The image is able to be zoomed in and out. If the image is zoomed in the marker position needs to track the correct position.

I've been looking for solutions. It seems that I am only able to find ways to add markers to maps, not to track them as they pan and zoom.

This is what i've tried

like image 336
hanafi hisyam Avatar asked Sep 12 '25 07:09

hanafi hisyam


1 Answers

Yeah, you can definitely do it. Using the combination of ZoomWidget, CustomPainter, GesturesDetector and yourImage.

  1. Wrap the image with CustomPainter which will paint the markers in your provided coordinate.
  2. Wrap CustomPainter with GesturesDetector and onTap, is should get the coordinates and pass it to CustomPainter.
  3. Wrap it with ZoomWidget with actual width and height of your image.

And this should do the job. Let me know if it solves your problem. I have done this for a project couple days ago. If you need the code I can give it tomorrow..

ZoomWidget : https://pub.dev/packages/zoom_widget

like image 196
towhid Avatar answered Sep 16 '25 06:09

towhid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!