a14n / dart-google-maps

A library to use Google Maps JavaScript API v3 from Dart scripts.
Other
125 stars 63 forks source link

Remove Polyline from Map #110

Closed exilonX closed 2 years ago

exilonX commented 2 years ago

I'm drawing a PolyLine like this:

      var line = Polyline(PolylineOptions()
        ..path = multiLine
        ..strokeColor = colorHex
        ..strokeOpacity = 0.8
        ..strokeWeight = 5
        ..map = map);

But unfortunately I couldn't remove it from the map... I tried setting the Polyline's map property to null but it doesn't work...

a14n commented 2 years ago

The polyline-remove example does exactly that and I can't see any issue running it.

Are you using line.map = null ?

exilonX commented 2 years ago

Hey @a14n, thanks for the reply, actually it was a problem on my end (was doing an additional redraw aparently), sorry to bother you!