in Education by
I'm using the official Google Maps Flutter plugin to show maps and it works perfectly well but now I want to show a route in the map so I'm using this package to provide me the route I only need to add the Polylines. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I had the same probelm solved by using this plugin google_maps_flutter: ^0.5.19 import 'package:google_maps_flutter/google_maps_flutter.dart'; static const LatLng _center = const LatLng(33.738045, 73.084488); final Set _markers = {}; final Set_polyline={}; //add your lat and lng where you wants to draw polyline LatLng _lastMapPosition = _center; List latlng = List(); LatLng _new = LatLng(33.738045, 73.084488); LatLng _news = LatLng(33.567997728, 72.635997456); latlng.add(_new); latlng.add(_news); //call this method on button click that will draw a polyline and markers void _onAddMarkerButtonPressed() { getDistanceTime(); setState(() { _markers.add(Marker( // This marker id can be anything that uniquely identifies each marker. markerId: MarkerId(_lastMapPosition.toString()), //_lastMapPosition is any coordinate which should be your default //position when map opens up position: _lastMapPosition, infoWindow: InfoWindow( title: 'Really cool place', snippet: '5 Star Rating', ), icon: BitmapDescriptor.defaultMarker, )); _polyline.add(Polyline( polylineId: PolylineId(_lastMapPosition.toString()), visible: true, //latlng is List points: latlng, color: Colors.blue, )); }); //in your build widget method GoogleMap( //that needs a list polylines:_polyline, markers: _markers, onMapCreated: _onMapCreated, myLocationEnabled:true, onCameraMove: _onCameraMove, initialCameraPosition: CameraPosition( target: _center, zoom: 11.0, ), mapType: MapType.normal, ); }

Related questions

0 votes
    I'm following the setup guide here and after I unzip flutter and run flutter doctor I get the following ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 15, 2022 in Education by JackTerrance
0 votes
    I want to get access to the pubspec.yaml and read its properties from dart code in my Flutter application ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    I'm getting Authorization failure when trying to display a map in a flutter project using the google maps ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    Video does not capture in the right orientation when running the Camera Plugin example app on my iPhone X in Landscape. It works well ... .0+1 environment: sdk: ">=2.0.0-dev.68.0...
asked Apr 12, 2022 in Education by JackTerrance
0 votes
    Is it possible to confirm if a place name exists for a specified coordinates via PHP? In other words, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    Is it possible to confirm if a place name exists for a specified coordinates via PHP? In other words, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 17, 2022 in Education by JackTerrance
0 votes
    The background purpose is that I want to divide a country into different regions. For example, divide USA ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    How to get list of restaurants by using google maps. I want to get more than 20. Is it possible? ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    I store all of the Google Maps marker objects in a single array. Right now I am trying to set up ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 30, 2022 in Education by JackTerrance
0 votes
    I am trying to create an app using AngularJS that takes a user's location (from their mobile) and ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 19, 2022 in Education by JackTerrance
0 votes
    I am trying to create an app using AngularJS that takes a user's location (from their mobile) and ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 12, 2022 in Education by JackTerrance
0 votes
    I am following up with the Wirecloud User Guide available here https://wirecloud.readthedocs.io/en/latest/ ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    I am using this for slide up layout in my map fragment but my app just crashing again and again ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I am using this for slide up layout in my map fragment but my app just crashing again and again ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
...