I am trying to add more than one marker in my google maps screen.. but I didn't get any idea how to do that.. I have applied some examples in some articles.. but I get an error...here is part of my code..
GoogleMap(
initialCameraPosition: const CameraPosition(
target: LatLng(...,...),
zoom: 18.0,
),
markers: Set.of([marker]), // here I want to add multiple markers
onMapCreated: _onMapCreated,
)
is there a simple way to add multiple markers?
and here is the code for marker
void loc(LocationData a) {
LatLng latlng = LatLng(a.latitude, a.longitude);
this.setState(() {
marker = Marker(
markerId: MarkerId("mine"),
position: latlng,
icon: BitmapDescriptor.defaultMarker,
draggable: false,
zIndex: 1,
);
});
}