IshikiHIkaru
IshikiHIkaru

Reputation: 85

Flutter maps: implement dotted line when coordinates is not on the main road

Is there a way to replicate this from google maps?

enter image description here

I currently have now the polyline on the road close to the marker but no dots when the marker is not on the road.

Upvotes: 2

Views: 703

Answers (1)

Gicu Aftene
Gicu Aftene

Reputation: 532

Just add another polyline after the road's ones... it would be something like

      //in the setState()
      
      _polyline.add(
          Polyline(
              polylineId: PolylineId('another id of polyline'),
              color: ThemeColors.primary,
              width: 2,
              patterns: [ //< dotted style
                PatternItem.dash(8), 
                PatternItem.gap(15),
              ],
              points: const [
                LatLng(RoadLat, RoadLng),
                LatLng(DestinationLat, DestinationLng),
              ],
          )
      )

Upvotes: 0

Related Questions