Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.16.2

* Removes documentation related to the map renderer selection API, as the
legacy renderer is no longer available, so requesting it is a no-op.

## 2.16.1

* Removes obsolete code related to supporting SDK <21.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,42 +46,11 @@ This mode is more performant than Hybrid Composition and we recommend that you u

This mode is available for backwards compatability and corresponds to `useAndroidViewSurface = true`.
We do not recommend its use as it is less performant than Texture Layer Hybrid Composition and
certain flutter rendering effects are not supported.
certain flutter rendering effects are not supported.

If you require this mode for correctness, please file a bug so we can investigate and fix
the issue in the TLHC mode.

## Map renderer

This plugin supports the option to request a specific [map renderer][5].

The renderer must be requested before creating GoogleMap instances, as the renderer can be initialized only once per application context.

<?code-excerpt "readme_excerpts.dart (MapRenderer)"?>
```dart
AndroidMapRenderer mapRenderer = AndroidMapRenderer.platformDefault;
// ···
final GoogleMapsFlutterPlatform mapsImplementation =
GoogleMapsFlutterPlatform.instance;
if (mapsImplementation is GoogleMapsFlutterAndroid) {
WidgetsFlutterBinding.ensureInitialized();
mapRenderer = await mapsImplementation
.initializeWithRenderer(AndroidMapRenderer.latest);
}
```

`AndroidMapRenderer.platformDefault` corresponds to `AndroidMapRenderer.latest`.

You are not guaranteed to get the requested renderer. For example, on emulators without
Google Play the latest renderer will not be available and the legacy renderer will always be used.

WARNING: `AndroidMapRenderer.legacy` is known to crash apps and is no longer supported by the Google Maps team
and therefore cannot be supported by the Flutter team.

### Cloud-based map styling

Cloud-based map styling is not supported with the `AndroidMapRenderer.legacy` renderer.

## Supported Heatmap Options

| Field | Supported |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

import 'dart:async';
import 'dart:convert';
import 'dart:typed_data';
import 'dart:ui' as ui;

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:google_maps_flutter_android/google_maps_flutter_android.dart';
import 'package:google_maps_flutter_example/example_google_map.dart';
import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart';
import 'package:integration_test/integration_test.dart';

import 'resources/icon_image_base64.dart';

Expand Down Expand Up @@ -42,9 +43,39 @@ final LatLngBounds _testCameraBounds = LatLngBounds(
final ValueVariant<CameraUpdateType> _cameraUpdateTypeVariants =
ValueVariant<CameraUpdateType>(CameraUpdateType.values.toSet());

void googleMapsTests() {
void main() {
late AndroidMapRenderer initializedRenderer;
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
GoogleMapsFlutterPlatform.instance.enableDebugInspection();

setUpAll(() async {
final GoogleMapsFlutterAndroid instance =
GoogleMapsFlutterPlatform.instance as GoogleMapsFlutterAndroid;
initializedRenderer =
await instance.initializeWithRenderer(AndroidMapRenderer.latest);
});

testWidgets('initialized with latest renderer', (WidgetTester _) async {
// There is no guarantee that the server will return the latest renderer
// even when requested, so there's no way to deterministically test that.
// Instead, just test that the request succeeded and returned a valid
// value.
expect(
initializedRenderer == AndroidMapRenderer.latest ||
initializedRenderer == AndroidMapRenderer.legacy,
true);
});

testWidgets('throws PlatformException on multiple renderer initializations',
(WidgetTester _) async {
final GoogleMapsFlutterAndroid instance =
GoogleMapsFlutterPlatform.instance as GoogleMapsFlutterAndroid;
expect(
() async => instance.initializeWithRenderer(AndroidMapRenderer.latest),
throwsA(isA<PlatformException>().having((PlatformException e) => e.code,
'code', 'Renderer already initialized')));
});

// Repeatedly checks an asynchronous value against a test condition, waiting
// on frame between each check, returing the value if it passes the predicate
// before [maxTries] is reached.
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: google_maps_flutter_android
description: Android implementation of the google_maps_flutter plugin.
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
version: 2.16.1
version: 2.16.2

environment:
sdk: ^3.6.0
Expand Down