Try to search your question here, if you can't find : Ask Any Question Now ?

Flutter Firebase clustering_google_maps

HomeCategory: stackoverflowFlutter Firebase clustering_google_maps
willson asked 2 weeks ago

The goal is to produce google map markers using clusters. I’m working on implementing this clustering_google_maps 0.0.4 dependency in Flutter using an array of Latitudes and Longitudes. It is challenging to understand the Quick Example and knowing where I should connect the array of latitudes and longitudes?

class _HomeScreenState extends State<HomeScreen> {
  ClusteringHelper clusteringHelper;
  final CameraPosition initialCameraPosition =
      CameraPosition(target: LatLng(0.000000, 0.000000), zoom: 0.0);

  Set<Marker> markers = Set();

  void _onMapCreated(GoogleMapController mapController) async {
    print("onMapCreated");
    clusteringHelper.database = await AppDatabase.get().getDb();
    clusteringHelper.updateMap();
  }

  updateMarkers(Set<Marker> markers) {
    setState(() {
      this.markers = markers;
    });
  }

  @override
  void initState() {
    initClustering();
    super.initState();
  }

  initClustering() {
    clusteringHelper = ClusteringHelper.forDB(
      dbGeohashColumn: FakePoint.dbGeohash,
      dbLatColumn: FakePoint.dbLat,
      dbLongColumn: FakePoint.dbLong,
      dbTable: FakePoint.tblFakePoints,
      updateMarkers: updateMarkers,
    );
  }

  @override
  Widget build(BuildContext context) {
    [...]
  }
}
1 Answers
Best Answer
Mannu answered 2 weeks ago
Your Answer

3 + 14 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com