Skip to content

Update for the deprecation of BitmapDescriptor.fromBytes#11

Open
LuisReyes98 wants to merge 15 commits into
santa112358:mainfrom
LuisReyes98:google_maps_update
Open

Update for the deprecation of BitmapDescriptor.fromBytes#11
LuisReyes98 wants to merge 15 commits into
santa112358:mainfrom
LuisReyes98:google_maps_update

Conversation

@LuisReyes98
Copy link
Copy Markdown

@LuisReyes98 LuisReyes98 commented Oct 7, 2024

As of google_maps_flutter_platform_interface: 2.8.0
The method BitmapDescriptor.fromBytes has been deprecated in favor of BitmapDescriptor.bytes and BytesMapBitmap.
The changes in this pull request include

  • The changes added in the example and the code focus on updating the package to flutter 3 and above
  • Updating the minimum dart SDK to 3.0
  • Replacing the use of BitmapDescriptor.bytes to BitmapDescriptor.fromBytes .
  • Updating the size of widgets on the example because the BitmapDescriptor.bytes solves a platform specific bug with the marker size , this fix in turn make the markers too big

Consideration for migration added on the README with the following text

Migrating to 1.0

The update to the google_maps_flutter_platform_interface: ^2.8.0 changes that, Deprecate BitmapDescriptor.fromBytes in favor of BitmapDescriptor.bytes and BytesMapBitmap.

Declaring a multiplatform marker

WidgetMarker(
  position: cafePosition,
  markerId: 'cafe',
  widget: Container(
    color: Colors.brown,
    padding: const EdgeInsets.all(2),
    child: Icon(
      Icons.coffee,
      color: Colors.white,
      size: 14 * MarkerGenerator.getDevicePixelRatio(context),
    ),
  ),
)

@LuisReyes98
Copy link
Copy Markdown
Author

@santa112358

@LuisReyes98
Copy link
Copy Markdown
Author

Latest commit also adds all the new props that are available on GoogleMap to be directly available from WidgetMarkerGoogleMap
this props are:

    this.cloudMapId,
    this.webGestureHandling,
    this.style,
    this.clusterManagers = const <ClusterManager>{},
    this.fortyFiveDegreeImageryEnabled = false,
    this.heatmaps = const <Heatmap>{},

@LuisReyes98
Copy link
Copy Markdown
Author

Several updates where made , the suggestion to stop using device pixel ratio was removed do to breaking changes with Safari and web browser compatibility , has been updated to have the most recent google maps support and google_maps_flutter updates

@LuisReyes98
Copy link
Copy Markdown
Author

The README and Changelog has been updated accordingly to explain how to use the new version

@LuisReyes98
Copy link
Copy Markdown
Author

related to this issue #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant