marker_crafter 2.2.2
marker_crafter: ^2.2.2 copied to clipboard
Draws custom Google Maps markers (text labels, rings and location pins) with Canvas and turns them into BitmapDescriptors.
2.2.2 #
- DOCS: README lists the author's other packages. / README'de geliştiricinin diğer paketleri listelendi.
2.2.1 #
- The SDK constraints now match what the package really needs: Dart 3.7 and
Flutter 3.29, the minimum of
google_maps_flutter2.13. The old^3.0.0/>=3.10.0were never resolvable withgoogle_maps_flutter2.13 anyway. - README: screenshots of the example's Marker Studio (also on pub.dev), the
requirements, and a section on using the icons with
animated_route_markerandgoogle_maps_polyline. - Tests for
textDirectionon ring markers and for the extension methods passing the text options through.
2.2.0 #
textDirectionon label and ring markers (addLabelMarker,addRingMarker,createLabelMarkerBitmap,createRingMarkerBitmap). PassTextDirection.rtlorDirectionality.of(context)for right-to-left languages such as Arabic or Hebrew. The default is still left-to-right.- Example app: Turkish and English, following the device language, with a language menu on both tabs.
2.1.2 #
- Markers created right after start-up (for example in
initStateof the first screen) were drawn at 1x and looked blurry: Android reports a pixel ratio of 1.0 until the screen metrics arrive. Without an explicitpixelRatio, marker functions now wait for the metrics (up to 2 seconds). NewwaitForPixelRatio()exposes the same logic. - Example app: redesigned with a Map tab and a Marker Studio tab (live preview, anchor guides, copyable code); only the newest marker drawing is shown, so an older, slower one cannot replace it.
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.
