Skip to main content

RotatedOverlayImage

An image overlay transformed across three corner points.

The top-right corner is derived from top_left_corner, bottom_left_corner, and bottom_right_corner.

Inherits: BaseOverlayImage

Properties

Properties

bottom_left_cornerinstance-attribute

bottom_left_corner: MapLatitudeLongitude

The coordinates of the bottom-left corner of the image.

bottom_right_cornerinstance-attribute

bottom_right_corner: MapLatitudeLongitude

The coordinates of the bottom-right corner of the image.

top_left_cornerinstance-attribute

top_left_corner: MapLatitudeLongitude

The coordinates of the top-left corner of the image.

Examples

Basic example

import flet as ft
import flet_map as ftm

base64_image = "iVBORw0KGgoAAAANSUhEUgAAABkAAAAgCAYAAADnnNMGAAAACXBIWXMAAAORAAADkQFnq8zdAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAA6dJREFUSImllltoHFUYx3/fzOzm0lt23ZrQ1AQbtBehNpvQohgkBYVo410RwQctNE3Sh0IfiiBoIAjqi6TYrKnFy4O3oiiRavDJFi3mXomIBmOxNZe63ay52GR3Zj4f2sTEzmx3m//TYf7/c35zvgPnO6KqrESXqpq3muocAikv6m+/zytj3ejik1VN21G31YA9CgJ6xC+bMyQZPVCuarciPAMYC99V6Vw5pLbFSibHmlVoRVj9P3cmPBM8tSJI/M6mzabpfoAQ9fIF7WK4bd5vvuFnLGgy2vi0abg94A0AcJGvMq3hDxGRyar9r4F+iLAm0yIiRk8m37tctS1WsrIhhrI30+Srmg+J87OXUf3lWGS1q89dC6ltsSanxk4Aj2QBABii96300g87P/rtlrWr8l+vyDMfdlXSyyEikqxsiOUAQJCBhfHdXRfCq1LSsSlcWG+KBAGStvvrMkgiuv8lUc2mREukPwLUfHG+uTQv8Eown7VL3XlbBxYhf1c17hbVF3MDwA9bts280TnaU1YYqPby07aeFlUlHt27wSQ4CLo+F8AvoTCvHmyKF+ZbEb/M77P2LgvAwmrTHAHflN3KZxVbMC2jMFNOpgPnrMSOhvvFkMezXdwV4ePbtvHtxnJAMQ0j4JtVnO+eLb5oiSlt5HDbv7t1O90lpYCCCKbhfzW5kAIwUAazR0BlfII8Ow0I6uoVmI9MyAMwbMs8CExmDbk4zgu931MyO4OI4KrYflkRjOoTI+uM9d1vjotwKPu9QMk/sxzuO8POiVFcdZ1M2YBVsMEAKOqLvaPIe7mACuw0z/80SMH58SMplxlfiDhVi7dw2pltRhjKBQTQdrSja2KKTfE551NHuaZ0QVPvWYQUn31/Vm2nDvgjF4grVJx6suSvrvrSJ/6cSW2Oz9mf264uNrB806xZ1k/CZ49dUKgDEtlCROX2hfHpx8pGuuo3PpqYulw8fjndOp1yhgtNKRevJ1FyR2Ola+jXAjdnwTkZ6o896GdWdxDw7IxFg+0DpmXchTKSBWQnIuJn9u4j7dt+13UfHXEkXQOcuQ4kMhVtqsgUyPiQiPQfHw1NB2sRjmXKuTg1NwwBYLhtPtQX26eqTwGXPDOqvmcC4Hnwfrrad94GrVsOYTqUTkQY+iTlNe/6O1miSP/x0VB/+wMIDwHn/vtV1iQC4Xv95uUEWVCoL9Y5Z+gdovoyMHUFJHv88jmVy0vTuw7cZNv2YaA61Bfb7ZX5F8SaUv2xwZevAAAAAElFTkSuQmCC" # noqa: E501


def main(page: ft.Page):
page.add(
ft.SafeArea(
expand=True,
content=ftm.Map(
expand=True,
initial_center=ftm.MapLatitudeLongitude(51.5, -0.09),
initial_zoom=6,
layers=[
ftm.TileLayer(
url_template="https://tile.memomaps.de/tilegen/{z}/{x}/{y}.png"
),
ftm.OverlayImageLayer(
overlay_images=[
ftm.OverlayImage(
src=base64_image,
bounds=ftm.MapLatitudeLongitudeBounds(
corner_1=ftm.MapLatitudeLongitude(51.5, -0.09),
corner_2=ftm.MapLatitudeLongitude(48.8566, 2.3522),
),
opacity=0.8,
),
ftm.RotatedOverlayImage(
src=base64_image,
top_left_corner=ftm.MapLatitudeLongitude(
53.377, -2.999
),
bottom_left_corner=ftm.MapLatitudeLongitude(
52.503, -1.868
),
bottom_right_corner=ftm.MapLatitudeLongitude(
53.475, 0.275
),
opacity=0.8,
),
]
),
],
),
)
)


if __name__ == "__main__":
ft.run(main)