Skip to content

Trouble when i'm getting current location bounds(North and south values) of map in flutter(iOS) #2

@NarendraAmz

Description

@NarendraAmz

When i'm getting current location bounds working fine in Android but iOS is always return like this.
southWest ( -90, -180) , northEast ( -90, -180) these are the default bounds that i'm getting for all the coordinates for most of the times.

void _onMapCreated(GoogleMapController controller, List Points) async {
_mapController = controller;
_controller.complete(controller);
LatLngBounds latLngBounds = await controller.getVisibleRegion();
_scaffoldKey.currentState.showSnackBar(SnackBar(content: Text("NorthEast: ${latLngBounds.northeast.latitude}, ${latLngBounds.northeast.longitude}. SouthWest: ${latLngBounds.southwest.latitude}, ${latLngBounds.southwest.longitude}")));

if (latLngBounds != null) {
LatLng ne = latLngBounds.northeast;
LatLng sw = latLngBounds.southwest;
print("Bounds: Not Null");
print("NorthEast: ${ne.latitude}, ${ne.longitude}"
"SouthWest: ${sw.latitude}, ${sw.longitude}");

chargePointsStore.updateMarkers(
bounds: latLngBounds,
mapController: controller,
);
} else {
print("Bounds: Null");
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions