getCurrentMap method

Future<JMapMap?> getCurrentMap()

Retrieves the current map displayed in the application.

This method asynchronously fetches the current JMapMap object that represents the map's current state, including its properties such as dimensions, transformation parameters, and any associated data layers.

Returns a Future that completes with the JMapMap object if available, or null if no map is currently loaded.

Example usage:

Future<void> loadMap() async {
  JMapMap? map = await getCurrentMap();
  if (map != null) {
    // Use the map object to access its properties or perform operations
    print('Map width: ${map.width}');
  } else {
    print('No map is currently loaded.');
  }
}

Implementation

Future<JMapMap?> getCurrentMap() async {
  return JMapFlutterPlatform.instance.getCurrentMap();
}