cluster_marker_style 0.3.0
cluster_marker_style: ^0.3.0 copied to clipboard
Beautiful, count-aware, cached cluster marker icons for Google Maps. A drop-in styling/rendering layer for any map clustering algorithm.
0.3.0 #
- Fix: drop shadows were clipped.
ClusterShadow.extentreserved onlyblur + offset.distanceof canvas margin, but a Gaussian blur stays visible out to roughly three sigma — so the soft edge of the shadow was cut off. The reach is now3 * sigma + offset.distance, and the sigma conversion is exposed asClusterShadow.sigmainstead of being duplicated inside the renderer. Shadowed icons rasterize to a slightly larger bitmap; the shape stays centered, so marker anchoring is unchanged. - Fix:
flusterMarkers(...)built markers one at a time. Each cluster icon was awaited in sequence, so a viewport of N clusters serialized N rasterizations. Markers are now built concurrently viaFuture.waitand are still returned in the order the items were given. - Fix:
ClusterStyle.copyWithcould not clearborderorshadow. Passingnullkeeps the current value (that is what a missingcopyWithargument means), which made "ClusterStyle.soft()without its shadow" impossible to express. AddedremoveBorder/removeShadowflags:ClusterStyle.soft().copyWith(removeShadow: true). - Fix:
ClusterIconCachewas unbounded by default. It now caps atkDefaultClusterIconCacheSize(256) entries with LRU eviction, so a long session that keeps producing new visual outcomes (a changing device pixel ratio, a formatter that emits a unique label per count) can't grow it without bound. UseClusterIconCache.unbounded()for the old behavior. A cache hit now also refreshes recency regardless of whether a cap is set. - Tests: added coverage for the
google_maps_cluster_manager_2adapter, which previously had none, plus shadow geometry, thecopyWithflags, cache eviction order, and fluster marker ordering.
0.2.0 #
- Add a
flusteradapter (package:cluster_marker_style/cluster_marker_style_fluster.dart):flusterMarkers(...)andflusterClusterMarkers(...)turnFluster.clusters(bbox, zoom)results into styled, cached map markers. fluster supplies only the clustering algorithm; this package renders the cluster icons. - Cluster markers from both adapters are now center-anchored
(
Offset(0.5, 0.5)), so the bubble sits on the cluster location instead of above it. - Example app gains a runnable fluster demo
(
flutter run -t lib/fluster_example.dart).
0.1.0 #
Initial release.
ClusterStylewith value equality and three polished named styles (.soft,.flat,.outlined).CountTiercount-aware color/size buckets and a logarithmic size curve.CountFormatterwith a good-lookingDefaultCountFormatter(e.g.1500 -> "1.5k", optional"N+"cap).ClusterRenderer: device-correctPictureRecorder/Canvas/TextPainterpipeline that disposes itsui.Imageand emits aBitmapDescriptorviaimagePixelRatio.ClusterIconCachewith visual-outcome cache keys, in-flight de-duplication, optional LRU eviction, andclear().- One-line
clusterMarkerBuilder(...)adapter forgoogle_maps_cluster_manager_2, in a separate library so the core stays independent of it. - Runnable example app with a live style switcher.