flet-map 0.2.0.dev46__tar.gz → 0.2.0.dev63__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of flet-map might be problematic. Click here for more details.

Files changed (43) hide show
  1. {flet_map-0.2.0.dev46/src/flet_map.egg-info → flet_map-0.2.0.dev63}/PKG-INFO +6 -4
  2. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/README.md +5 -3
  3. flet_map-0.2.0.dev63/pyproject.toml +97 -0
  4. flet_map-0.2.0.dev63/src/flet_map/__init__.py +85 -0
  5. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flet_map/circle_layer.py +17 -13
  6. flet_map-0.2.0.dev63/src/flet_map/map.py +368 -0
  7. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flet_map/marker_layer.py +38 -25
  8. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flet_map/polygon_layer.py +15 -14
  9. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flet_map/polyline_layer.py +15 -12
  10. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flet_map/rich_attribution.py +14 -11
  11. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flet_map/simple_attribution.py +5 -7
  12. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flet_map/source_attribution.py +12 -8
  13. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flet_map/tile_layer.py +50 -40
  14. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flet_map/types.py +218 -155
  15. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63/src/flet_map.egg-info}/PKG-INFO +6 -4
  16. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/lib/src/utils/map.dart +4 -2
  17. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/pubspec.lock +68 -44
  18. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/pubspec.yaml +1 -1
  19. flet_map-0.2.0.dev46/pyproject.toml +0 -71
  20. flet_map-0.2.0.dev46/src/flet_map/__init__.py +0 -41
  21. flet_map-0.2.0.dev46/src/flet_map/map.py +0 -532
  22. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/LICENSE +0 -0
  23. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/setup.cfg +0 -0
  24. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flet_map/map_layer.py +0 -0
  25. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flet_map.egg-info/SOURCES.txt +0 -0
  26. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flet_map.egg-info/dependency_links.txt +0 -0
  27. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flet_map.egg-info/requires.txt +0 -0
  28. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flet_map.egg-info/top_level.txt +0 -0
  29. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/CHANGELOG.md +0 -0
  30. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/LICENSE +0 -0
  31. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/README.md +0 -0
  32. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/analysis_options.yaml +0 -0
  33. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/lib/flet_map.dart +0 -0
  34. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/lib/src/circle_layer.dart +0 -0
  35. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/lib/src/extension.dart +0 -0
  36. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/lib/src/map.dart +0 -0
  37. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/lib/src/marker_layer.dart +0 -0
  38. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/lib/src/polygon_layer.dart +0 -0
  39. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/lib/src/polyline_layer.dart +0 -0
  40. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/lib/src/rich_attribution.dart +0 -0
  41. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/lib/src/simple_attribution.dart +0 -0
  42. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/lib/src/tile_layer.dart +0 -0
  43. {flet_map-0.2.0.dev46 → flet_map-0.2.0.dev63}/src/flutter/flet_map/lib/src/utils/attribution_alignment.dart +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-map
3
- Version: 0.2.0.dev46
3
+ Version: 0.2.0.dev63
4
4
  Summary: Display interactive Maps in your Flet apps.
5
5
  Author-email: Flet contributors <hello@flet.dev>
6
6
  License-Expression: Apache-2.0
@@ -41,7 +41,9 @@ This package supports the following platforms:
41
41
  | Android | ✅ |
42
42
  | Web | ✅ |
43
43
 
44
- ## Installation
44
+ ## Usage
45
+
46
+ ### Installation
45
47
 
46
48
  To install the `flet-map` package and add it to your project dependencies:
47
49
 
@@ -61,6 +63,6 @@ To install the `flet-map` package and add it to your project dependencies:
61
63
  poetry add flet-map
62
64
  ```
63
65
 
64
- ## Examples
66
+ ### Examples
65
67
 
66
- For examples, see [this](./examples)
68
+ For examples, see [these](./examples).
@@ -25,7 +25,9 @@ This package supports the following platforms:
25
25
  | Android | ✅ |
26
26
  | Web | ✅ |
27
27
 
28
- ## Installation
28
+ ## Usage
29
+
30
+ ### Installation
29
31
 
30
32
  To install the `flet-map` package and add it to your project dependencies:
31
33
 
@@ -45,6 +47,6 @@ To install the `flet-map` package and add it to your project dependencies:
45
47
  poetry add flet-map
46
48
  ```
47
49
 
48
- ## Examples
50
+ ### Examples
49
51
 
50
- For examples, see [this](./examples)
52
+ For examples, see [these](./examples).
@@ -0,0 +1,97 @@
1
+ [project]
2
+ name = "flet-map"
3
+ version = "0.2.0.dev63"
4
+ description = "Display interactive Maps in your Flet apps."
5
+ readme = "README.md"
6
+ authors = [{ name = "Flet contributors", email = "hello@flet.dev" }]
7
+ license = "Apache-2.0"
8
+ requires-python = ">=3.10"
9
+ dependencies = [
10
+ "flet >=0.70.0.dev0",
11
+ ]
12
+
13
+ [project.urls]
14
+ Homepage = "https://flet.dev"
15
+ Documentation = "https://flet-dev.github.io/flet-map"
16
+ Repository = "https://github.com/flet-dev/flet-map"
17
+ Issues = "https://github.com/flet-dev/flet-map/issues"
18
+
19
+ [tool.setuptools.package-data]
20
+ "flutter.flet_map" = ["**/*"]
21
+
22
+ [dependency-groups]
23
+ test = [
24
+ "pytest >=7.2.0",
25
+ ]
26
+ lint = [
27
+ "ruff >=0.11.7",
28
+ ]
29
+ dev = [
30
+ "pre-commit >=4.2.0",
31
+ { include-group = 'lint' },
32
+ { include-group = 'test' },
33
+ ]
34
+ docs-coverage = [
35
+ "docstr-coverage >=2.3.2",
36
+ ]
37
+ docs = [
38
+ "mkdocs >=1.6.1",
39
+ "mkdocs-material >=9.6.15",
40
+ "mkdocstrings-python >=1.16.12",
41
+ "mkdocstrings-python-xref >=1.16.3",
42
+ "mike >=2.1.3",
43
+ "markdown >=3.6",
44
+ "pymdown-extensions >=10.16",
45
+ "mkdocs-exclude >=1.0.2",
46
+ "mkdocs-glightbox >=0.4.0",
47
+ "mkdocs-open-in-new-tab >=1.0.8",
48
+ "mkdocs-section-index >=0.3.10",
49
+ "griffe-modernized-annotations >=1.0.8",
50
+ "griffe-warnings-deprecated >=1.1.0",
51
+ "pygments >=2.16",
52
+ "markdown-exec[ansi] >=1.11.0",
53
+ "pydocstyle >=6.3.0",
54
+ "linkcheckmd >=1.4.0",
55
+ "mkdocs-external-images",
56
+ { include-group = 'docs-coverage' },
57
+ ]
58
+ all = [
59
+ { include-group = 'dev' },
60
+ { include-group = 'docs' },
61
+ ]
62
+
63
+ [tool.uv.sources]
64
+ mkdocs-external-images = { git = "https://github.com/flet-dev/mkdocs-external-images", tag = "v0.2.0" }
65
+
66
+ [build-system]
67
+ requires = ["setuptools"]
68
+ build-backend = "setuptools.build_meta"
69
+
70
+ [tool.ruff]
71
+ line-length = 88
72
+ target-version = "py39"
73
+ fix = true
74
+ show-fixes = true
75
+
76
+ [tool.ruff.lint]
77
+ select = [
78
+ # pycodestyle
79
+ "E",
80
+ # Pyflakes
81
+ "F",
82
+ # pyupgrade
83
+ "UP",
84
+ # flake8-bugbear
85
+ "B",
86
+ # flake8-simplify
87
+ "SIM",
88
+ # isort
89
+ "I"
90
+ ]
91
+ preview = true
92
+ pydocstyle = { convention = 'google' }
93
+
94
+ [tool.ruff.format]
95
+ quote-style = "double"
96
+ indent-style = "space"
97
+ line-ending = "auto"
@@ -0,0 +1,85 @@
1
+ from flet_map.circle_layer import CircleLayer, CircleMarker
2
+ from flet_map.map import Map
3
+ from flet_map.marker_layer import Marker, MarkerLayer
4
+ from flet_map.polygon_layer import PolygonLayer, PolygonMarker
5
+ from flet_map.polyline_layer import PolylineLayer, PolylineMarker
6
+ from flet_map.rich_attribution import RichAttribution
7
+ from flet_map.simple_attribution import SimpleAttribution
8
+ from flet_map.source_attribution import (
9
+ ImageSourceAttribution,
10
+ SourceAttribution,
11
+ TextSourceAttribution,
12
+ )
13
+ from flet_map.tile_layer import TileLayer
14
+ from flet_map.types import (
15
+ AttributionAlignment,
16
+ Camera,
17
+ CameraFit,
18
+ CursorKeyboardRotationConfiguration,
19
+ CursorRotationBehaviour,
20
+ DashedStrokePattern,
21
+ DottedStrokePattern,
22
+ FadeInTileDisplay,
23
+ InstantaneousTileDisplay,
24
+ InteractionConfiguration,
25
+ InteractionFlag,
26
+ KeyboardConfiguration,
27
+ MapEvent,
28
+ MapEventSource,
29
+ MapHoverEvent,
30
+ MapLatitudeLongitude,
31
+ MapLatitudeLongitudeBounds,
32
+ MapPointerEvent,
33
+ MapPositionChangeEvent,
34
+ MapTapEvent,
35
+ MultiFingerGesture,
36
+ PatternFit,
37
+ SolidStrokePattern,
38
+ StrokePattern,
39
+ TileDisplay,
40
+ TileLayerEvictErrorTileStrategy,
41
+ )
42
+
43
+ __all__ = [
44
+ "AttributionAlignment",
45
+ "Camera",
46
+ "CameraFit",
47
+ "CircleLayer",
48
+ "CircleMarker",
49
+ "CursorKeyboardRotationConfiguration",
50
+ "CursorRotationBehaviour",
51
+ "DashedStrokePattern",
52
+ "DottedStrokePattern",
53
+ "FadeInTileDisplay",
54
+ "ImageSourceAttribution",
55
+ "InstantaneousTileDisplay",
56
+ "InteractionConfiguration",
57
+ "InteractionFlag",
58
+ "KeyboardConfiguration",
59
+ "Map",
60
+ "MapEvent",
61
+ "MapEventSource",
62
+ "MapHoverEvent",
63
+ "MapLatitudeLongitude",
64
+ "MapLatitudeLongitudeBounds",
65
+ "MapPointerEvent",
66
+ "MapPositionChangeEvent",
67
+ "MapTapEvent",
68
+ "Marker",
69
+ "MarkerLayer",
70
+ "MultiFingerGesture",
71
+ "PatternFit",
72
+ "PolygonLayer",
73
+ "PolygonMarker",
74
+ "PolylineLayer",
75
+ "PolylineMarker",
76
+ "RichAttribution",
77
+ "SimpleAttribution",
78
+ "SolidStrokePattern",
79
+ "SourceAttribution",
80
+ "StrokePattern",
81
+ "TextSourceAttribution",
82
+ "TileDisplay",
83
+ "TileLayer",
84
+ "TileLayerEvictErrorTileStrategy",
85
+ ]
@@ -1,17 +1,18 @@
1
- from typing import List, Optional
1
+ from typing import Optional
2
2
 
3
3
  import flet as ft
4
4
 
5
- from .map_layer import MapLayer
6
- from .types import MapLatitudeLongitude
5
+ from flet_map.map_layer import MapLayer
6
+ from flet_map.types import MapLatitudeLongitude
7
7
 
8
- __all__ = ["CircleMarker", "CircleLayer"]
8
+ __all__ = ["CircleLayer", "CircleMarker"]
9
9
 
10
10
 
11
11
  @ft.control("CircleMarker")
12
12
  class CircleMarker(ft.Control):
13
13
  """
14
- A circular marker displayed on the Map at the specified location through the [`CircleLayer`][(p).].
14
+ A circular marker displayed on the Map at the specified
15
+ location through the [`CircleLayer`][(p).].
15
16
 
16
17
  Raises:
17
18
  AssertionError: If the [`border_stroke_width`][(c).] is negative.
@@ -29,14 +30,16 @@ class CircleMarker(ft.Control):
29
30
  border_color: Optional[ft.ColorValue] = None
30
31
  """
31
32
  The color of the circle border line.
32
-
33
- Needs [`border_stroke_width`][..] to be greater than `0.0` in order to be visible.
33
+
34
+ Note:
35
+ [`border_stroke_width`][..] must to be greater than
36
+ `0.0` in order for this color to be visible.
34
37
  """
35
38
 
36
39
  border_stroke_width: ft.Number = 0.0
37
40
  """
38
- The stroke width for the circle border.
39
-
41
+ The stroke width for the circle border.
42
+
40
43
  Note:
41
44
  Must be non-negative.
42
45
  """
@@ -48,9 +51,10 @@ class CircleMarker(ft.Control):
48
51
 
49
52
  def before_update(self):
50
53
  super().before_update()
51
- assert (
52
- self.border_stroke_width >= 0
53
- ), "border_stroke_width must be greater than or equal to 0"
54
+ assert self.border_stroke_width >= 0, (
55
+ f"border_stroke_width must be greater than or equal to 0, "
56
+ f"got {self.border_stroke_width}"
57
+ )
54
58
 
55
59
 
56
60
  @ft.control("CircleLayer")
@@ -59,5 +63,5 @@ class CircleLayer(MapLayer):
59
63
  A layer to display [`CircleMarker`][(p).]s.
60
64
  """
61
65
 
62
- circles: List[CircleMarker]
66
+ circles: list[CircleMarker]
63
67
  """A list of [`CircleMarker`][(p).]s to display."""
@@ -0,0 +1,368 @@
1
+ from dataclasses import field
2
+ from typing import Optional
3
+
4
+ import flet as ft
5
+
6
+ from flet_map.map_layer import MapLayer
7
+ from flet_map.types import (
8
+ CameraFit,
9
+ InteractionConfiguration,
10
+ MapEvent,
11
+ MapHoverEvent,
12
+ MapLatitudeLongitude,
13
+ MapPointerEvent,
14
+ MapPositionChangeEvent,
15
+ MapTapEvent,
16
+ )
17
+
18
+ __all__ = ["Map"]
19
+
20
+
21
+ @ft.control("Map")
22
+ class Map(ft.ConstrainedControl):
23
+ """
24
+ An interactive map that displays various layers.
25
+ """
26
+
27
+ layers: list[MapLayer]
28
+ """
29
+ A list of layers to be displayed (stack-like) on the map.
30
+ """
31
+
32
+ initial_center: MapLatitudeLongitude = field(
33
+ default_factory=lambda: MapLatitudeLongitude(latitude=50.5, longitude=30.51)
34
+ )
35
+ """
36
+ The initial center of the map.
37
+ """
38
+
39
+ initial_rotation: ft.Number = 0.0
40
+ """
41
+ The rotation (in degrees) when the map is first loaded.
42
+ """
43
+
44
+ initial_zoom: ft.Number = 13.0
45
+ """
46
+ The zoom when the map is first loaded.
47
+ If initial_camera_fit is defined this has no effect.
48
+ """
49
+
50
+ interaction_configuration: InteractionConfiguration = field(
51
+ default_factory=lambda: InteractionConfiguration()
52
+ )
53
+ """
54
+ The interaction configuration.
55
+ """
56
+
57
+ bgcolor: ft.ColorValue = ft.Colors.GREY_300
58
+ """
59
+ The background color of this control.
60
+ """
61
+
62
+ keep_alive: bool = False
63
+ """
64
+ Whether to enable the built in keep-alive functionality.
65
+
66
+ If the map is within a complex layout, such as a [`ListView`][flet.ListView],
67
+ the map will reset to it's inital position after it appears back into view.
68
+ To ensure this doesn't happen, enable this flag to prevent it from rebuilding.
69
+ """
70
+
71
+ max_zoom: Optional[ft.Number] = None
72
+ """
73
+ The maximum (highest) zoom level of every layer.
74
+ Each layer can specify additional zoom level restrictions.
75
+ """
76
+
77
+ min_zoom: Optional[ft.Number] = None
78
+ """
79
+ The minimum (smallest) zoom level of every layer.
80
+ Each layer can specify additional zoom level restrictions.
81
+ """
82
+
83
+ animation_curve: ft.AnimationCurve = ft.AnimationCurve.FAST_OUT_SLOWIN
84
+ """
85
+ The default animation curve to be used for map-animations
86
+ when calling instance methods like [`zoom_in()`][(c).zoom_in],
87
+ [`rotate_from()`][(c).rotate_from],
88
+ [`move_to()`][(c).move_to] etc.
89
+ """
90
+
91
+ animation_duration: ft.DurationValue = field(
92
+ default_factory=lambda: ft.Duration(milliseconds=500)
93
+ )
94
+ """
95
+ The default animation duration to be used for map-animations
96
+ when calling instance methods like [`zoom_in()`][(c).zoom_in],
97
+ [`rotate_from()`][(c).rotate_from],
98
+ [`move_to()`][(c).move_to] etc.
99
+ """
100
+
101
+ initial_camera_fit: Optional[CameraFit] = None
102
+ """
103
+ Defines the visible bounds when the map is first loaded.
104
+ Takes precedence over [`initial_center`][..]/[`initial_zoom`][..].
105
+ """
106
+
107
+ on_init: Optional[ft.ControlEventHandler["Map"]] = None
108
+ """
109
+ Fires when the map is initialized.
110
+ """
111
+
112
+ on_tap: Optional[ft.EventHandler[MapTapEvent]] = None
113
+ """
114
+ Fires when a tap event occurs.
115
+ """
116
+
117
+ on_hover: Optional[ft.EventHandler[MapHoverEvent]] = None
118
+ """
119
+ Fires when a hover event occurs.
120
+ """
121
+
122
+ on_secondary_tap: Optional[ft.EventHandler[MapTapEvent]] = None
123
+ """
124
+ Fires when a secondary tap event occurs.
125
+ """
126
+
127
+ on_long_press: Optional[ft.EventHandler[MapTapEvent]] = None
128
+ """
129
+ Fires when a long press event occurs.
130
+ """
131
+
132
+ on_event: Optional[ft.EventHandler[MapEvent]] = None
133
+ """
134
+ Fires when any map events occurs.
135
+ """
136
+
137
+ on_position_change: Optional[ft.EventHandler[MapPositionChangeEvent]] = None
138
+ """
139
+ Fires when the map position changes.
140
+ """
141
+
142
+ on_pointer_down: Optional[ft.EventHandler[MapPointerEvent]] = None
143
+ """
144
+ Fires when a pointer down event occurs.
145
+ """
146
+
147
+ on_pointer_cancel: Optional[ft.EventHandler[MapPointerEvent]] = None
148
+ """
149
+ Fires when a pointer cancel event occurs.
150
+ """
151
+
152
+ on_pointer_up: Optional[ft.EventHandler[MapPointerEvent]] = None
153
+ """
154
+ Fires when a pointer up event occurs.
155
+ """
156
+
157
+ async def rotate_from(
158
+ self,
159
+ degree: ft.Number,
160
+ animation_curve: Optional[ft.AnimationCurve] = None,
161
+ animation_duration: Optional[ft.DurationValue] = None,
162
+ cancel_ongoing_animations: bool = False,
163
+ ) -> None:
164
+ """
165
+ Applies a rotation of `degree` to the current rotation.
166
+
167
+ Args:
168
+ degree: The number of degrees to increment to the current rotation.
169
+ animation_curve: The curve of the animation. If None (the default),
170
+ [`Map.animation_curve`][(p).] will be used.
171
+ animation_duration: The duration of the animation.
172
+ If None (the default), [`Map.animation_duration`][(p).] will be used.
173
+ cancel_ongoing_animations: Whether to cancel/stop all
174
+ ongoing map-animations before starting this new one.
175
+ """
176
+ await self._invoke_method(
177
+ method_name="rotate_from",
178
+ arguments={
179
+ "degree": degree,
180
+ "curve": animation_curve or self.animation_curve,
181
+ "duration": animation_duration or self.animation_duration,
182
+ "cancel_ongoing_animations": cancel_ongoing_animations,
183
+ },
184
+ )
185
+
186
+ async def reset_rotation(
187
+ self,
188
+ animation_curve: Optional[ft.AnimationCurve] = None,
189
+ animation_duration: Optional[ft.DurationValue] = None,
190
+ cancel_ongoing_animations: bool = False,
191
+ ) -> None:
192
+ """
193
+ Resets the map's rotation to 0 degrees.
194
+
195
+ Args:
196
+ animation_curve: The curve of the animation. If None (the default),
197
+ [`Map.animation_curve`][(p).] will be used.
198
+ animation_duration: The duration of the animation.
199
+ If None (the default), [`Map.animation_duration`][(p).] will be used.
200
+ cancel_ongoing_animations: Whether to cancel/stop all
201
+ ongoing map-animations before starting this new one.
202
+ """
203
+ await self._invoke_method(
204
+ method_name="reset_rotation",
205
+ arguments={
206
+ "curve": animation_curve or self.animation_curve,
207
+ "duration": animation_duration or self.animation_duration,
208
+ "cancel_ongoing_animations": cancel_ongoing_animations,
209
+ },
210
+ )
211
+
212
+ async def zoom_in(
213
+ self,
214
+ animation_curve: Optional[ft.AnimationCurve] = None,
215
+ animation_duration: Optional[ft.DurationValue] = None,
216
+ cancel_ongoing_animations: bool = False,
217
+ ) -> None:
218
+ """
219
+ Zooms in by one zoom-level from the current one.
220
+
221
+ Args:
222
+ animation_curve: The curve of the animation. If None (the default),
223
+ [`Map.animation_curve`][(p).] will be used.
224
+ animation_duration: The duration of the animation.
225
+ If None (the default), [`Map.animation_duration`][(p).] will be used.
226
+ cancel_ongoing_animations: Whether to cancel/stop all
227
+ ongoing map-animations before starting this new one.
228
+ """
229
+ await self._invoke_method(
230
+ method_name="zoom_in",
231
+ arguments={
232
+ "curve": animation_curve or self.animation_curve,
233
+ "duration": animation_duration or self.animation_duration,
234
+ "cancel_ongoing_animations": cancel_ongoing_animations,
235
+ },
236
+ )
237
+
238
+ async def zoom_out(
239
+ self,
240
+ animation_curve: Optional[ft.AnimationCurve] = None,
241
+ animation_duration: Optional[ft.DurationValue] = None,
242
+ cancel_ongoing_animations: bool = False,
243
+ ) -> None:
244
+ """
245
+ Zooms out by one zoom-level from the current one.
246
+
247
+ Args:
248
+ animation_curve: The curve of the animation. If None (the default),
249
+ [`Map.animation_curve`][(p).] will be used.
250
+ animation_duration: The duration of the animation.
251
+ If None (the default), [`Map.animation_duration`][(p).] will be used.
252
+ cancel_ongoing_animations: Whether to cancel/stop all
253
+ ongoing map-animations before starting this new one.
254
+ """
255
+ await self._invoke_method(
256
+ method_name="zoom_out",
257
+ arguments={
258
+ "curve": animation_curve or self.animation_curve,
259
+ "duration": animation_duration or self.animation_duration,
260
+ "cancel_ongoing_animations": cancel_ongoing_animations,
261
+ },
262
+ )
263
+
264
+ async def zoom_to(
265
+ self,
266
+ zoom: ft.Number,
267
+ animation_curve: Optional[ft.AnimationCurve] = None,
268
+ animation_duration: Optional[ft.DurationValue] = None,
269
+ cancel_ongoing_animations: bool = False,
270
+ ) -> None:
271
+ """
272
+ Zoom the map to a specific zoom level.
273
+
274
+ Args:
275
+ zoom: The zoom level to zoom to.
276
+ animation_curve: The curve of the animation. If None (the default),
277
+ [`Map.animation_curve`][(p).] will be used.
278
+ animation_duration: The duration of the animation.
279
+ If None (the default), [`Map.animation_duration`][(p).] will be used.
280
+ cancel_ongoing_animations: Whether to cancel/stop all
281
+ ongoing map-animations before starting this new one.
282
+ """
283
+ await self._invoke_method(
284
+ method_name="zoom_to",
285
+ arguments={
286
+ "zoom": zoom,
287
+ "curve": animation_curve or self.animation_curve,
288
+ "duration": animation_duration or self.animation_duration,
289
+ "cancel_ongoing_animations": cancel_ongoing_animations,
290
+ },
291
+ )
292
+
293
+ async def move_to(
294
+ self,
295
+ destination: Optional[MapLatitudeLongitude] = None,
296
+ zoom: Optional[ft.Number] = None,
297
+ rotation: Optional[ft.Number] = None,
298
+ animation_curve: Optional[ft.AnimationCurve] = None,
299
+ animation_duration: Optional[ft.DurationValue] = None,
300
+ offset: ft.OffsetValue = (0, 0),
301
+ cancel_ongoing_animations: bool = False,
302
+ ) -> None:
303
+ """
304
+ Moves to a specific location.
305
+
306
+ Args:
307
+ destination: The destination point to move to.
308
+ zoom: The zoom level to be applied. If provided,
309
+ must be greater than or equal to `0.0`.
310
+ rotation: Rotation (in degrees) to be applied.
311
+ offset: The offset to be used. Only works when `rotation` is `None`.
312
+ animation_curve: The curve of the animation. If None (the default),
313
+ [`Map.animation_curve`][(p).] will be used.
314
+ animation_duration: The duration of the animation.
315
+ If None (the default), [`Map.animation_duration`][(p).] will be used.
316
+ cancel_ongoing_animations: Whether to cancel/stop all
317
+ ongoing map-animations before starting this new one.
318
+
319
+ Raises:
320
+ AssertionError: If `zoom` is not `None` and is negative.
321
+ """
322
+ assert zoom is None or zoom >= 0, (
323
+ f"zoom must be greater than or equal to zero, got {zoom}"
324
+ )
325
+ await self._invoke_method(
326
+ method_name="move_to",
327
+ arguments={
328
+ "destination": destination,
329
+ "zoom": zoom,
330
+ "offset": offset,
331
+ "rotation": rotation,
332
+ "curve": animation_curve or self.animation_curve,
333
+ "duration": animation_duration or self.animation_duration,
334
+ "cancel_ongoing_animations": cancel_ongoing_animations,
335
+ },
336
+ )
337
+
338
+ async def center_on(
339
+ self,
340
+ point: MapLatitudeLongitude,
341
+ zoom: Optional[ft.Number],
342
+ animation_curve: Optional[ft.AnimationCurve] = None,
343
+ animation_duration: Optional[ft.DurationValue] = None,
344
+ cancel_ongoing_animations: bool = False,
345
+ ) -> None:
346
+ """
347
+ Centers the map on the given point.
348
+
349
+ Args:
350
+ point: The point on which to center the map.
351
+ zoom: The zoom level to be applied.
352
+ animation_curve: The curve of the animation. If `None` (the default),
353
+ [`Map.animation_curve`][(p).] will be used.
354
+ animation_duration: The duration of the animation.
355
+ If None (the default), [`Map.animation_duration`][(p).] will be used.
356
+ cancel_ongoing_animations: Whether to cancel/stop all
357
+ ongoing map-animations before starting this new one.
358
+ """
359
+ await self._invoke_method(
360
+ method_name="center_on",
361
+ arguments={
362
+ "point": point,
363
+ "zoom": zoom,
364
+ "curve": animation_curve or self.animation_curve,
365
+ "duration": animation_duration or self.animation_duration,
366
+ "cancel_ongoing_animations": cancel_ongoing_animations,
367
+ },
368
+ )