mehmetoguzderin / decorated_google_maps_flutter

A Flutter package that provides a Decorated Google Maps widget with support for custom widgets that can show charts, visualizations, markers and more.
MIT License
3 stars 0 forks source link

Toggle visible markers #1

Open lickybuay opened 4 years ago

lickybuay commented 4 years ago

Could the markers toggle visibility? in the google_map_flutter is final visible true.

mehmetoguzderin commented 4 years ago

@lickybuay We will take a look at this soon!

mehmetoguzderin commented 4 years ago

Could the markers toggle visibility? in the google_map_flutter is final visible true.

@lickybuay Do you want to change final bool visible of Marker after creating a GoogleMap?

lickybuay commented 4 years ago

Yes, the idea is toggle visibility of a marker, for example i have a list with checkbox, if checked marker visible, otherwise hide.

Actually im making this changing position values on the list (array), i remove all markers and then remake the markers in the map again.

mehmetoguzderin commented 4 years ago

Yes, the idea is toggle visibility of a marker, for example i have a list with checkbox, if checked marker visible, otherwise hide.

Actually im making this changing position values on the list (array), i remove all markers and then remake the markers in the map again.

@lickybuay That actually makes sense, if you opt for a list of Markers, then you essentially have to recreate the objects at each occasion which could be avoided. Let me think about how to patch a way for that in our plugin! Meanwhile, don't hesitate to open other issues or pull requests about the plugin, appreciated!

lickybuay commented 4 years ago

i know that makes sense, but in google map you can make markers[indexOfMarker].setVisible(true or false); that don't remove the value of the list but toggle the visibility.

And if you check the doc of google_maps_flutter you will see that the marker have visible property, the thing is that it's final.

visible → bool True if the marker is visible.

https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/Marker-class.html

mehmetoguzderin commented 4 years ago

i know that makes sense, but in google map you can make markers[indexOfMarker].setVisible(true or false); that don't remove the value of the list but toggle the visibility.

And if you check the doc of google_maps_flutter you will see that the marker have visible property, the thing is that it's final.

visible → bool True if the marker is visible.

https://pub.dev/documentation/google_maps_flutter/latest/google_maps_flutter/Marker-class.html

@lickybuay I meant what you say makes sense, editable visibility