marker_crafter 2.1.1
marker_crafter: ^2.1.1 copied to clipboard
Draws custom Google Maps markers (text labels, rings and location pins) with Canvas and turns them into BitmapDescriptors.
2.1.1 #
- The location marker (
LocationMarkerPainter,createLocationMarkerBitmap,addLocationMarker) no longer cuts off the tips of its antennas at the image edges. The circle is a little smaller so the whole shape fits, and it stays centered.
2.1.0 #
MarkerCrafter.clusterManagerIdputs the marker in a marker cluster.addLabelMarker/createLabelMarkerBitmaptakemaxWidthandmaxLines(with "…"), so long text no longer produces an oversized image.textScaleron label and ring markers, for exampleMediaQuery.textScalerOf(context)to follow the system font size. The default is still no scaling.MarkerCrafter.textis optional (defaults to''), since location markers do not draw it.- Example app: the web page loads the Maps JavaScript API without
document.writeand starts Flutter after it; markers follow the font size.
2.0.0 #
Requires Dart 3 and Flutter 3.10 or newer, and google_maps_flutter 2.13 or newer.
Breaking changes #
- Markers are now sized in logical pixels and rendered at the device pixel ratio
(
BitmapDescriptor.byteswithimagePixelRatio), so they look the same size and stay sharp on every screen. PasspixelRatioto override it. Markers look larger than in 1.x, where the bitmap was shown at its raw pixel size. - The default label text style is bold 14 instead of
fontSize: 27with the non-existentRoboto Boldfamily. MarkerCrafter.iconis removed (it was never used),zIndexis replaced byzIndexInt,textStyleandanchorare nullable and default per marker shape, and the constructor isconst.- The
lib/tools/functions are replaced bycreateLabelMarkerBitmap,createRingMarkerBitmapandcreateLocationMarkerBitmap, exported frompackage:marker_crafter/marker_crafter.dart. The unusedcreateLocationMarkerIcon2andcreateLocationMarkerIcon3are gone. LocationMarkerPainterno longer takes asizeargument.- Adding a marker whose
MarkerIdis already in the set now replaces it instead of leaving two markers with the same id. - The unused
font_awesome_flutterdependency is removed.
New #
addLabelMarker,addRingMarkerandaddLocationMarkerreturn the addedMarker. The 1.x methods (addTextMarker,addTextMarker2,addEvilEyeBeadMarker,addRoundedMarker) still work but are deprecated.MarkerCrafter.toMarker(icon)builds aMarkerfrom the options.- Ring markers scale long text down to fit.
Fixes #
- The label arrow tip is now the bottom edge of the image, so the default anchor points exactly at the position (it was 10 px above it).
- Ring markers drew white text on the white inner circle; the default text color is now the background color.
- Text width is rounded up instead of truncated, so the last glyph is not cut.
Picture,ImageandTextPainterobjects are disposed after rendering.LocationMarkerPainter.shouldRepaintcompares colors and its stroke scales with the size.- Removed generated platform folders from the package root and refreshed the example app; its Google Maps key is read from git-ignored files.
1.1.3 #
- Earlier releases.