MapMarker3D.fromImage constructor

MapMarker3D.fromImage(
  1. GeoCoordinates at,
  2. MapImage image,
  3. double scale,
  4. RenderSizeUnit unit,
)

Creates a flat marker from provided map image.

Such map marker is a flat 3D marker of rectangular shape textured with given image. Aspect ratio of the flat marker is determined by aspect ratio of the image.

Only bitmap images are supported, using a MapImage created from SVG data will result in distorted rendering of the flat marker.

Altitude component of the coordinates, if set, controls 3D marker's elevation above ground. If not set, the 3D marker is placed at ground level.

Size of the rendered flat marker can be specified in either world or screen coordinate space.

For RenderSizeUnit.pixels, the flat marker will cover MapMarker3D.fromImage.scale * image's width pixels horizontally and MapMarker3D.fromImage.scale * image's height pixels vertically. The size of the flat marker remains constant on the screen.

For RenderSizeUnit.densityIndependentPixels the flat marker will cover MapMarker3D.fromImage.scale * image's width density independent pixels horizontally and MapMarker3D.fromImage.scale * image's height density independent pixels vertically. The size of the flat marker remains constant on the screen.

For RenderSizeUnit.meters the flat marker will cover MapMarker3D.fromImage.scale * image's width meters horizontally and MapMarker3D.fromImage.scale * image's height meters vertically. Unlike with pixels or density independent pixels the size of the flat marker will grow and shrink together with regular map content like streets or buildings.

  • at The geographical coordinates where the flat marker is placed corresponding to center of the provided map image.

  • image The MapImage containing the texture data of the flat marker. SVG images are not supported.

  • scale Scale factor applied to the dimensions of the image.

  • unit Determines whether the size of the flat marker is represented in world or in screen space.

Implementation

factory MapMarker3D.fromImage(GeoCoordinates at, MapImage image, double scale, RenderSizeUnit unit) => $prototype.fromImage(at, image, scale, unit);