DerivePointAnnotationOptionsIconImage extension

Derives PointAnnotationOptions.iconImage / PointAnnotation.iconImage from a hash of PointAnnotationOptions.image / PointAnnotation.image, when the caller has not set an explicit iconImage.

Neither iOS nor Android compares image bytes. Both platforms re-apply an icon only when its style-image id changes. A hash-based id makes update() work without the caller managing ids: a content change changes the hash. Callers who set iconImage themselves keep full control of the style-image name.

iconImage is never null after the first hash is derived: both create() and getAnnotations() return it. So deriving only when iconImage is null would derive once, then never again. Every later update() would treat the old hash as an explicit id, making a bytes-only change a no-op again — the original #532 bug. Instead, this method re-derives whenever the current iconImage is absent, or starts with _autoIconImagePrefix. A prefixed id can only come from a previous derivation, never from the caller, so it is safe to overwrite.

on
  • PointAnnotationOptions

Methods

deriveIconImageIfNeeded() → void

Available on PointAnnotationOptions, provided by the DerivePointAnnotationOptionsIconImage extension

See DerivePointAnnotationOptionsIconImage.