forZoomlevel method

  1. @override
RenderinstructionCircle forZoomlevel(
  1. int zoomlevel,
  2. int level
)
override

Creates a zoom level specific copy of this circle instruction.

Applies zoom level dependent scaling to fill, stroke, and optionally radius properties based on the scaleRadius setting.

zoomlevel Target zoom level for scaling calculations Returns a new scaled circle instruction

Implementation

@override
RenderinstructionCircle forZoomlevel(int zoomlevel, int level) {
  RenderinstructionCircle renderinstruction = RenderinstructionCircle(level)
    ..renderinstructionScale(this, zoomlevel)
    ..baseSrcMixinScale(this, zoomlevel)
    ..fillSrcMixinScale(this, zoomlevel)
    ..strokeSrcMixinScale(this, zoomlevel);

  renderinstruction.scaleRadius = scaleRadius;
  renderinstruction.radius = radius;
  renderinstruction.position = position;
  if (scaleRadius) {
    if (zoomlevel >= strokeMinZoomLevel) {
      double scaleFactor = MapsforgeSettingsMgr().calculateScaleFactor(zoomlevel, strokeMinZoomLevel);
      renderinstruction.radius = radius * scaleFactor;
    }
  }
  return renderinstruction;
}