flet-map 0.70.0.dev6365__tar.gz → 0.70.0.dev6370__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 (38) hide show
  1. {flet_map-0.70.0.dev6365/src/flet_map.egg-info → flet_map-0.70.0.dev6370}/PKG-INFO +2 -2
  2. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/pyproject.toml +2 -2
  3. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flet_map/circle_layer.py +10 -12
  4. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flet_map/map.py +6 -7
  5. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flet_map/marker_layer.py +24 -25
  6. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flet_map/polygon_layer.py +12 -10
  7. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flet_map/polyline_layer.py +15 -12
  8. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flet_map/simple_attribution.py +1 -1
  9. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flet_map/source_attribution.py +8 -10
  10. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flet_map/tile_layer.py +49 -47
  11. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flet_map/types.py +81 -63
  12. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370/src/flet_map.egg-info}/PKG-INFO +2 -2
  13. flet_map-0.70.0.dev6370/src/flet_map.egg-info/requires.txt +1 -0
  14. flet_map-0.70.0.dev6365/src/flet_map.egg-info/requires.txt +0 -1
  15. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/LICENSE +0 -0
  16. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/README.md +0 -0
  17. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/setup.cfg +0 -0
  18. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flet_map/__init__.py +0 -0
  19. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flet_map/map_layer.py +0 -0
  20. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flet_map/rich_attribution.py +0 -0
  21. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flet_map.egg-info/SOURCES.txt +0 -0
  22. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flet_map.egg-info/dependency_links.txt +0 -0
  23. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flet_map.egg-info/top_level.txt +0 -0
  24. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flutter/flet_map/analysis_options.yaml +0 -0
  25. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flutter/flet_map/lib/flet_map.dart +0 -0
  26. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flutter/flet_map/lib/src/circle_layer.dart +0 -0
  27. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flutter/flet_map/lib/src/extension.dart +0 -0
  28. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flutter/flet_map/lib/src/map.dart +0 -0
  29. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flutter/flet_map/lib/src/marker_layer.dart +0 -0
  30. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flutter/flet_map/lib/src/polygon_layer.dart +0 -0
  31. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flutter/flet_map/lib/src/polyline_layer.dart +0 -0
  32. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flutter/flet_map/lib/src/rich_attribution.dart +0 -0
  33. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flutter/flet_map/lib/src/simple_attribution.dart +0 -0
  34. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flutter/flet_map/lib/src/tile_layer.dart +0 -0
  35. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flutter/flet_map/lib/src/utils/attribution_alignment.dart +0 -0
  36. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flutter/flet_map/lib/src/utils/map.dart +0 -0
  37. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flutter/flet_map/pubspec.lock +0 -0
  38. {flet_map-0.70.0.dev6365 → flet_map-0.70.0.dev6370}/src/flutter/flet_map/pubspec.yaml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-map
3
- Version: 0.70.0.dev6365
3
+ Version: 0.70.0.dev6370
4
4
  Summary: Interactive map controls for Flet apps.
5
5
  Author-email: Flet contributors <hello@flet.dev>
6
6
  License-Expression: Apache-2.0
@@ -11,7 +11,7 @@ Project-URL: Issues, https://github.com/flet-dev/flet/issues
11
11
  Requires-Python: >=3.10
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
- Requires-Dist: flet==0.70.0.dev6365
14
+ Requires-Dist: flet==0.70.0.dev6370
15
15
  Dynamic: license-file
16
16
 
17
17
  # flet-map
@@ -1,13 +1,13 @@
1
1
  [project]
2
2
  name = "flet-map"
3
- version = "0.70.0.dev6365"
3
+ version = "0.70.0.dev6370"
4
4
  description = "Interactive map controls for Flet apps."
5
5
  readme = "README.md"
6
6
  authors = [{ name = "Flet contributors", email = "hello@flet.dev" }]
7
7
  license = "Apache-2.0"
8
8
  requires-python = ">=3.10"
9
9
  dependencies = [
10
- "flet==0.70.0.dev6365",
10
+ "flet==0.70.0.dev6370",
11
11
  ]
12
12
 
13
13
  [project.urls]
@@ -12,9 +12,6 @@ class CircleMarker(ft.Control):
12
12
  """
13
13
  A circular marker displayed on the Map at the specified
14
14
  location through the [`CircleLayer`][(p).].
15
-
16
- Raises:
17
- AssertionError: If the [`border_stroke_width`][(c).] is negative.
18
15
  """
19
16
 
20
17
  radius: ft.Number
@@ -30,8 +27,8 @@ class CircleMarker(ft.Control):
30
27
  """
31
28
  The color of the circle border line.
32
29
 
33
- Note:
34
- [`border_stroke_width`][..] must to be greater than
30
+ Tip:
31
+ [`border_stroke_width`][(c).] must be greater than
35
32
  `0.0` in order for this color to be visible.
36
33
  """
37
34
 
@@ -39,21 +36,22 @@ class CircleMarker(ft.Control):
39
36
  """
40
37
  The stroke width for the circle border.
41
38
 
42
- Note:
43
- Must be non-negative.
39
+ Raises:
40
+ ValueError: If it is less than `0.0`.
44
41
  """
45
42
 
46
43
  use_radius_in_meter: bool = False
47
44
  """
48
- Whether the [`radius`][..] should use the unit meters.
45
+ Whether the [`radius`][(c).] should use the unit meters.
49
46
  """
50
47
 
51
48
  def before_update(self):
52
49
  super().before_update()
53
- assert self.border_stroke_width >= 0, (
54
- f"border_stroke_width must be greater than or equal to 0, "
55
- f"got {self.border_stroke_width}"
56
- )
50
+ if self.border_stroke_width < 0:
51
+ raise ValueError(
52
+ "border_stroke_width must be greater than or equal to 0, "
53
+ f"got {self.border_stroke_width}"
54
+ )
57
55
 
58
56
 
59
57
  @ft.control("CircleLayer")
@@ -100,7 +100,7 @@ class Map(ft.LayoutControl):
100
100
  initial_camera_fit: Optional[CameraFit] = None
101
101
  """
102
102
  Defines the visible bounds when the map is first loaded.
103
- Takes precedence over [`initial_center`][..]/[`initial_zoom`][..].
103
+ Takes precedence over [`initial_center`][(c).]/[`initial_zoom`][(c).].
104
104
  """
105
105
 
106
106
  on_init: Optional[ft.ControlEventHandler["Map"]] = None
@@ -244,7 +244,7 @@ class Map(ft.LayoutControl):
244
244
  Zooms out by one zoom-level from the current one.
245
245
 
246
246
  Args:
247
- animation_curve: The curve of the animation. If None (the default),
247
+ animation_curve: The curve of the animation. If `None` (the default),
248
248
  [`Map.animation_curve`][(p).] will be used.
249
249
  animation_duration: The duration of the animation.
250
250
  If None (the default), [`Map.animation_duration`][(p).] will be used.
@@ -272,7 +272,7 @@ class Map(ft.LayoutControl):
272
272
 
273
273
  Args:
274
274
  zoom: The zoom level to zoom to.
275
- animation_curve: The curve of the animation. If None (the default),
275
+ animation_curve: The curve of the animation. If `None` (the default),
276
276
  [`Map.animation_curve`][(p).] will be used.
277
277
  animation_duration: The duration of the animation.
278
278
  If None (the default), [`Map.animation_duration`][(p).] will be used.
@@ -316,11 +316,10 @@ class Map(ft.LayoutControl):
316
316
  ongoing map-animations before starting this new one.
317
317
 
318
318
  Raises:
319
- AssertionError: If `zoom` is not `None` and is negative.
319
+ ValueError: If `zoom` is not `None` and is negative.
320
320
  """
321
- assert zoom is None or zoom >= 0, (
322
- f"zoom must be greater than or equal to zero, got {zoom}"
323
- )
321
+ if zoom is not None and zoom < 0:
322
+ raise ValueError(f"zoom must be greater than or equal to zero, got {zoom}")
324
323
  await self._invoke_method(
325
324
  method_name="move_to",
326
325
  arguments={
@@ -13,18 +13,14 @@ class Marker(ft.Control):
13
13
  """
14
14
  A marker displayed on the Map at the specified location
15
15
  through the [`MarkerLayer`][(p).].
16
-
17
- Raises:
18
- AssertionError: If the [`content`][(c).] is not visible, or
19
- if [`height`][(c).] or [`width`][(c).] are negative.
20
16
  """
21
17
 
22
18
  content: ft.Control
23
19
  """
24
- The content to be displayed at [`coordinates`][..].
20
+ The content to be displayed at [`coordinates`][(c).].
25
21
 
26
- Note:
27
- Must be provided and visible.
22
+ Raises:
23
+ ValueError: If it is not [`visible`][(c).].
28
24
  """
29
25
 
30
26
  coordinates: MapLatitudeLongitude
@@ -32,7 +28,7 @@ class Marker(ft.Control):
32
28
  The coordinates of the marker.
33
29
 
34
30
  This will be the center of the marker,
35
- if [`alignment`][..] is [`Alignment.CENTER`][flet.Alignment.CENTER].
31
+ if [`alignment`][(c).] is [`Alignment.CENTER`][flet.Alignment.].
36
32
  """
37
33
 
38
34
  rotate: Optional[bool] = None
@@ -51,36 +47,39 @@ class Marker(ft.Control):
51
47
 
52
48
  height: ft.Number = 30.0
53
49
  """
54
- The height of the [`content`][..] Control.
50
+ The height of the [`content`][(c).] Control.
55
51
 
56
- Note:
57
- Must be non-negative.
52
+ Raises:
53
+ ValueError: If it is less than `0.0`.
58
54
  """
59
55
 
60
56
  width: ft.Number = 30.0
61
57
  """
62
- The width of the [`content`][..] Control.
58
+ The width of the [`content`][(c).] Control.
63
59
 
64
- Note:
65
- Must be non-negative.
60
+ Raises:
61
+ ValueError: If it is less than `0.0`.
66
62
  """
67
63
 
68
64
  alignment: Optional[ft.Alignment] = None
69
65
  """
70
- Alignment of the marker relative to the normal center at [`coordinates`][..].
66
+ Alignment of the marker relative to the normal center at [`coordinates`][(c).].
71
67
 
72
68
  Defaults to the value of the parent [`MarkerLayer.alignment`][(p).].
73
69
  """
74
70
 
75
71
  def before_update(self):
76
72
  super().before_update()
77
- assert self.content.visible, "content must be visible"
78
- assert self.height >= 0, (
79
- f"height must be greater than or equal to 0, got {self.height}"
80
- )
81
- assert self.width >= 0, (
82
- f"width must be greater than or equal to 0, got {self.width}"
83
- )
73
+ if not self.content.visible:
74
+ raise ValueError("content must be visible")
75
+ if self.height < 0:
76
+ raise ValueError(
77
+ f"height must be greater than or equal to 0, got {self.height}"
78
+ )
79
+ if self.width < 0:
80
+ raise ValueError(
81
+ f"width must be greater than or equal to 0, got {self.width}"
82
+ )
84
83
 
85
84
 
86
85
  @ft.control("MarkerLayer")
@@ -91,7 +90,7 @@ class MarkerLayer(MapLayer):
91
90
 
92
91
  markers: list[Marker]
93
92
  """
94
- A list of [`Marker`][(m).]s to display.
93
+ A list of [`Marker`][(p).]s to display.
95
94
  """
96
95
 
97
96
  alignment: Optional[ft.Alignment] = field(
@@ -99,11 +98,11 @@ class MarkerLayer(MapLayer):
99
98
  )
100
99
  """
101
100
  The alignment of each marker relative to its normal center at
102
- [`Marker.coordinates`][(m).].
101
+ [`Marker.coordinates`][(p).].
103
102
  """
104
103
 
105
104
  rotate: bool = False
106
105
  """
107
- Whether to counter-rotate `markers` to the map's rotation,
106
+ Whether to counter-rotate [`markers`][(c).] to the map's rotation,
108
107
  to keep a fixed orientation.
109
108
  """
@@ -22,10 +22,11 @@ class PolygonMarker(ft.Control):
22
22
  """
23
23
  An optional label for this polygon.
24
24
 
25
- Note: specifying a label will reduce performance, as the internal
26
- canvas must be drawn to and 'saved' more frequently to ensure the proper
27
- stacking order is maintained. This can be avoided, potentially at the
28
- expense of appearance, by setting [`PolygonLayer.draw_labels_last`][(p).].
25
+ Note:
26
+ Specifying a label will reduce performance, as the internal
27
+ canvas must be drawn to and 'saved' more frequently to ensure the proper
28
+ stacking order is maintained. This can be avoided, potentially at the
29
+ expense of appearance, by setting [`PolygonLayer.draw_labels_last`][(p).].
29
30
  """
30
31
 
31
32
  label_text_style: Optional[ft.TextStyle] = None
@@ -47,8 +48,8 @@ class PolygonMarker(ft.Control):
47
48
  """
48
49
  The width of the border outline.
49
50
 
50
- Note:
51
- Must be non-negative.
51
+ Raises:
52
+ ValueError: If it is less than `0.0`.
52
53
  """
53
54
 
54
55
  disable_holes_border: bool = False
@@ -74,10 +75,11 @@ class PolygonMarker(ft.Control):
74
75
 
75
76
  def before_update(self):
76
77
  super().before_update()
77
- assert self.border_stroke_width >= 0, (
78
- f"border_stroke_width must be greater than or equal to 0, "
79
- f"got {self.border_stroke_width}"
80
- )
78
+ if self.border_stroke_width < 0:
79
+ raise ValueError(
80
+ "border_stroke_width must be greater than or equal to 0, "
81
+ f"got {self.border_stroke_width}"
82
+ )
81
83
 
82
84
 
83
85
  @ft.control("PolygonLayer")
@@ -21,7 +21,7 @@ class PolylineMarker(ft.Control):
21
21
 
22
22
  colors_stop: Optional[list[ft.Number]] = None
23
23
  """
24
- The stops for the [`gradient_colors`][..].
24
+ The stops for the [`gradient_colors`][(c).].
25
25
  """
26
26
 
27
27
  gradient_colors: Optional[list[ft.ColorValue]] = None
@@ -43,16 +43,16 @@ class PolylineMarker(ft.Control):
43
43
  """
44
44
  The width of the stroke.
45
45
 
46
- Note:
47
- Must be non-negative.
46
+ Raises:
47
+ ValueError: If it is less than `0.0`.
48
48
  """
49
49
 
50
50
  border_stroke_width: ft.Number = 0.0
51
51
  """
52
52
  The width of the stroke with of the line border.
53
53
 
54
- Note:
55
- Must be non-negative.
54
+ Raises:
55
+ ValueError: If it is less than `0.0`.
56
56
  """
57
57
 
58
58
  use_stroke_width_in_meter: bool = False
@@ -78,13 +78,16 @@ class PolylineMarker(ft.Control):
78
78
 
79
79
  def before_update(self):
80
80
  super().before_update()
81
- assert self.border_stroke_width >= 0, (
82
- f"border_stroke_width must be greater than or equal to 0, "
83
- f"got {self.border_stroke_width}"
84
- )
85
- assert self.stroke_width >= 0, (
86
- f"stroke_width must be greater than or equal to 0, got {self.stroke_width}"
87
- )
81
+ if self.border_stroke_width < 0:
82
+ raise ValueError(
83
+ "border_stroke_width must be greater than or equal to 0, "
84
+ f"got {self.border_stroke_width}"
85
+ )
86
+ if self.stroke_width < 0:
87
+ raise ValueError(
88
+ f"stroke_width must be greater than or equal to 0, "
89
+ f"got {self.stroke_width}"
90
+ )
88
91
 
89
92
 
90
93
  @ft.control("PolylineLayer")
@@ -25,7 +25,7 @@ class SimpleAttribution(MapLayer):
25
25
 
26
26
  bgcolor: ft.ColorValue = ft.Colors.SURFACE
27
27
  """
28
- The color of the box containing the [`text`][..].
28
+ The color of the box containing the [`text`][(c).].
29
29
  """
30
30
 
31
31
  on_click: Optional[ft.ControlEventHandler["SimpleAttribution"]] = None
@@ -23,17 +23,14 @@ class ImageSourceAttribution(SourceAttribution):
23
23
  open/close icon of a [`RichAttribution`][(p).] control.
24
24
  For it to be displayed, it should be part of a
25
25
  [`RichAttribution.attributions`][(p).] list.
26
-
27
- Raises:
28
- AssertionError: If the [`image`][(c).] is not visible.
29
26
  """
30
27
 
31
28
  image: ft.Image
32
29
  """
33
- The `Image` to be displayed.
30
+ The [`Image`][flet.] to be displayed.
34
31
 
35
- Note:
36
- Must be provided and visible.
32
+ Raises:
33
+ ValueError: If the image is not visible.
37
34
  """
38
35
 
39
36
  height: ft.Number = 24.0
@@ -51,7 +48,8 @@ class ImageSourceAttribution(SourceAttribution):
51
48
 
52
49
  def before_update(self):
53
50
  super().before_update()
54
- assert self.image.visible, "image must be visible"
51
+ if not self.image.visible:
52
+ raise ValueError("image must be visible")
55
53
 
56
54
 
57
55
  @ft.control("TextSourceAttribution")
@@ -63,14 +61,14 @@ class TextSourceAttribution(SourceAttribution):
63
61
  """
64
62
 
65
63
  text: str
66
- """The text to display as attribution, styled with [`text_style`][..]."""
64
+ """The text to display as attribution, styled with [`text_style`][(c).]."""
67
65
 
68
66
  text_style: Optional[ft.TextStyle] = None
69
- """Style used to display the [`text`][..]."""
67
+ """Style used to display the [`text`][(c).]."""
70
68
 
71
69
  prepend_copyright: bool = True
72
70
  """
73
- Whether to add the '©' character to the start of [`text`][..] automatically.
71
+ Whether to add the '©' character to the start of [`text`][(c).] automatically.
74
72
  """
75
73
 
76
74
  on_click: Optional[ft.ControlEventHandler["TextSourceAttribution"]] = None
@@ -22,12 +22,6 @@ class TileLayer(MapLayer):
22
22
  Typically the first layer to be added to a [`Map`][(p).],
23
23
  as it provides the tiles on which
24
24
  other layers are displayed.
25
-
26
- Raises:
27
- AssertionError: If one or more of the following is negative:
28
- [`tile_size`][(c).], [`min_native_zoom`][(c).],
29
- [`max_native_zoom`][(c).], [`zoom_offset`][(c).],
30
- [`max_zoom`][(c).], [`min_zoom`][(c).]
31
25
  """
32
26
 
33
27
  url_template: str
@@ -39,21 +33,21 @@ class TileLayer(MapLayer):
39
33
  fallback_url: Optional[str] = None
40
34
  """
41
35
  Fallback URL template, used if an error occurs when fetching tiles from
42
- the [`url_template`][..].
36
+ the [`url_template`][(c).].
43
37
 
44
38
  Note that specifying this (non-none) will result in tiles not being cached
45
- in memory. This is to avoid issues where the [`url_template`][..] is flaky, to
39
+ in memory. This is to avoid issues where the [`url_template`][(c).] is flaky, to
46
40
  prevent different tilesets being displayed at the same time.
47
41
 
48
42
  It is expected that this follows the same retina support behaviour
49
- as [`url_template`][..].
43
+ as [`url_template`][(c).].
50
44
  """
51
45
 
52
46
  subdomains: list[str] = field(default_factory=lambda: ["a", "b", "c"])
53
47
  """
54
48
  List of subdomains used in the URL template.
55
49
 
56
- For example, if [`subdomains`][..] is set to `["a", "b", "c"]` and the
50
+ For example, if [`subdomains`][(c).] is set to `["a", "b", "c"]` and the
57
51
  `url_template` is `"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"`,
58
52
  the resulting tile URLs will be:
59
53
 
@@ -73,8 +67,8 @@ class TileLayer(MapLayer):
73
67
  The size in pixels of each tile image.
74
68
  Should be a positive power of 2.
75
69
 
76
- Note:
77
- Must be greater than or equal to `0.0`.
70
+ Raises:
71
+ ValueError: If it is less than `0.0`.
78
72
  """
79
73
 
80
74
  min_native_zoom: int = 0
@@ -87,8 +81,8 @@ class TileLayer(MapLayer):
87
81
  This should usually be 0 (as default), as most tile sources will support
88
82
  zoom levels onwards from this.
89
83
 
90
- Note:
91
- Must be greater than or equal to `0.0`.
84
+ Raises:
85
+ ValueError: If it is less than `0.0`.
92
86
  """
93
87
 
94
88
  max_native_zoom: int = 19
@@ -101,8 +95,8 @@ class TileLayer(MapLayer):
101
95
  Most tile servers support up to zoom level `19`, which is the default.
102
96
  Otherwise, this should be specified.
103
97
 
104
- Note:
105
- Must be greater than or equal to `0.0`.
98
+ Raises:
99
+ ValueError: If it is less than `0.0`.
106
100
  """
107
101
 
108
102
  zoom_reverse: bool = False
@@ -115,8 +109,8 @@ class TileLayer(MapLayer):
115
109
  """
116
110
  The zoom number used in tile URLs will be offset with this value.
117
111
 
118
- Note:
119
- Must be greater than or equal to `0.0`.
112
+ Raises:
113
+ ValueError: If it is less than `0.0`.
120
114
  """
121
115
 
122
116
  keep_buffer: int = 2
@@ -148,7 +142,7 @@ class TileLayer(MapLayer):
148
142
 
149
143
  additional_options: dict[str, str] = field(default_factory=dict)
150
144
  """
151
- Static information that should replace placeholders in the [`url_template`][..].
145
+ Static information that should replace placeholders in the [`url_template`][(c).].
152
146
  Applying API keys, for example, is a good usecase of this parameter.
153
147
 
154
148
  Example:
@@ -159,7 +153,7 @@ class TileLayer(MapLayer):
159
153
  'accessToken': '<ACCESS_TOKEN_HERE>',
160
154
  'id': 'mapbox.streets',
161
155
  },
162
- ),
156
+ )
163
157
  ```
164
158
  """
165
159
 
@@ -169,29 +163,30 @@ class TileLayer(MapLayer):
169
163
  The main usage for this property is to display a different `TileLayer`
170
164
  when zoomed far in.
171
165
 
172
- Prefer [`max_native_zoom`][..] for setting the maximum zoom level supported by the
166
+ Prefer [`max_native_zoom`][(c).] for setting the maximum zoom level supported by the
173
167
  tile source.
174
168
 
175
169
  Typically set to infinity so that there are tiles always displayed.
176
170
 
177
- Note:
178
- Must be greater than or equal to `0.0`.
171
+ Raises:
172
+ ValueError: If it is less than `0.0`.
179
173
  """
180
174
 
181
175
  min_zoom: ft.Number = 0.0
182
176
  """
183
177
  The minimum zoom level at which this layer is displayed (inclusive).
178
+
184
179
  Typically `0.0`.
185
180
 
186
- Note:
187
- Must be greater than or equal to `0.0`.
181
+ Raises:
182
+ ValueError: If it is less than `0.0`.
188
183
  """
189
184
 
190
185
  error_image_src: Optional[str] = None
191
186
  """
192
187
  The source of the tile image to show in place of the tile that failed to load.
193
188
 
194
- See [`on_image_error`][..] property for details on the error.
189
+ See [`on_image_error`][(c).] property for details on the error.
195
190
  """
196
191
 
197
192
  evict_error_tile_strategy: Optional[TileLayerEvictErrorTileStrategy] = (
@@ -217,29 +212,36 @@ class TileLayer(MapLayer):
217
212
  """
218
213
  Fires if an error occurs when fetching the tiles.
219
214
 
220
- Event handler argument [`data`][flet.Event.data] property contains
215
+ Event handler argument [`data`][flet.Event.] property contains
221
216
  information about the error.
222
217
  """
223
218
 
224
219
  def before_update(self):
225
220
  super().before_update()
226
- assert self.tile_size >= 0, (
227
- f"tile_size must be greater than or equal to 0, got {self.tile_size}"
228
- )
229
- assert self.min_native_zoom >= 0, (
230
- f"min_native_zoom must be greater than or equal to 0, "
231
- f"got {self.min_native_zoom}"
232
- )
233
- assert self.max_native_zoom >= 0, (
234
- f"max_native_zoom must be greater than or equal to 0, "
235
- f"got {self.max_native_zoom}"
236
- )
237
- assert self.zoom_offset >= 0, (
238
- f"zoom_offset must be greater than or equal to 0, got {self.zoom_offset}"
239
- )
240
- assert self.max_zoom >= 0, (
241
- f"max_zoom must be greater than or equal to 0, got {self.max_zoom}"
242
- )
243
- assert self.min_zoom >= 0, (
244
- f"min_zoom must be greater than or equal to 0, got {self.min_zoom}"
245
- )
221
+ if self.tile_size < 0:
222
+ raise ValueError(
223
+ f"tile_size must be greater than or equal to 0, got {self.tile_size}"
224
+ )
225
+ if self.min_native_zoom < 0:
226
+ raise ValueError(
227
+ "min_native_zoom must be greater than or equal to 0, "
228
+ f"got {self.min_native_zoom}"
229
+ )
230
+ if self.max_native_zoom < 0:
231
+ raise ValueError(
232
+ "max_native_zoom must be greater than or equal to 0, "
233
+ f"got {self.max_native_zoom}"
234
+ )
235
+ if self.zoom_offset < 0:
236
+ raise ValueError(
237
+ f"zoom_offset must be greater than or equal to 0, "
238
+ f"got {self.zoom_offset}"
239
+ )
240
+ if self.max_zoom < 0:
241
+ raise ValueError(
242
+ f"max_zoom must be greater than or equal to 0, got {self.max_zoom}"
243
+ )
244
+ if self.min_zoom < 0:
245
+ raise ValueError(
246
+ f"min_zoom must be greater than or equal to 0, got {self.min_zoom}"
247
+ )
@@ -91,13 +91,13 @@ class PatternFit(Enum):
91
91
  SCALE_DOWN = "scaleDown"
92
92
  """
93
93
  Scale the pattern to ensure it fits an integer number of times into the
94
- polyline (smaller version regarding rounding, cf. [`SCALE_UP`][..]).
94
+ polyline (smaller version regarding rounding, cf. [`SCALE_UP`][(c).]).
95
95
  """
96
96
 
97
97
  SCALE_UP = "scaleUp"
98
98
  """
99
99
  Scale the pattern to ensure it fits an integer number of times into the
100
- polyline (bigger version regarding rounding, cf. [`SCALE_DOWN`][..]).
100
+ polyline (bigger version regarding rounding, cf. [`SCALE_DOWN`][(c).]).
101
101
  """
102
102
 
103
103
  APPEND_DOT = "appendDot"
@@ -177,7 +177,7 @@ class DashedStrokePattern(StrokePattern):
177
177
  A stroke pattern of alternating dashes and gaps, defined by [`segments`][(c).].
178
178
 
179
179
  Raises:
180
- AssertionError: If [`segments`][(c).] does not contain at least two items,
180
+ ValueError: If [`segments`][(c).] does not contain at least two items,
181
181
  or has an odd length.
182
182
  """
183
183
 
@@ -185,9 +185,11 @@ class DashedStrokePattern(StrokePattern):
185
185
  """
186
186
  A list of alternating dash and gap lengths, in pixels.
187
187
 
188
- Note:
189
- Must contain at least two items, and have an even length.
188
+ Raises:
189
+ ValueError: If the list does not contain at least two items,
190
+ or if its length is not even.
190
191
  """
192
+
191
193
  pattern_fit: PatternFit = PatternFit.SCALE_UP
192
194
  """
193
195
  Determines how this stroke pattern should be fit to a line when their lengths
@@ -195,10 +197,12 @@ class DashedStrokePattern(StrokePattern):
195
197
  """
196
198
 
197
199
  def __post_init__(self):
198
- assert len(self.segments) >= 2, (
199
- f"segments must contain at least two items, got {len(self.segments)}"
200
- )
201
- assert len(self.segments) % 2 == 0, "segments must have an even length"
200
+ if len(self.segments) < 2:
201
+ raise ValueError(
202
+ f"segments must contain at least two items, got {len(self.segments)}"
203
+ )
204
+ if len(self.segments) % 2 != 0:
205
+ raise ValueError("segments must have an even length")
202
206
  self._type = "dashed"
203
207
 
204
208
 
@@ -206,9 +210,6 @@ class DashedStrokePattern(StrokePattern):
206
210
  class DottedStrokePattern(StrokePattern):
207
211
  """
208
212
  A stroke pattern of circular dots, spaced with [`spacing_factor`][(c).].
209
-
210
- Raises:
211
- AssertionError: If [`spacing_factor`][(c).] is negative.
212
213
  """
213
214
 
214
215
  spacing_factor: ft.Number = 1.5
@@ -220,9 +221,10 @@ class DottedStrokePattern(StrokePattern):
220
221
 
221
222
  May also be scaled by the use of [`PatternFit.SCALE_UP`][(p).].
222
223
 
223
- Note:
224
- Must be non-negative.
224
+ Raises:
225
+ ValueError: If it is less than or equal to zero.
225
226
  """
227
+
226
228
  pattern_fit: PatternFit = PatternFit.SCALE_UP
227
229
  """
228
230
  Determines how this stroke pattern should be fit to a line when their
@@ -230,10 +232,10 @@ class DottedStrokePattern(StrokePattern):
230
232
  """
231
233
 
232
234
  def __post_init__(self):
233
- assert self.spacing_factor > 0, (
234
- f"spacing_factor must be greater than or equal to 0.0, "
235
- f"got {self.spacing_factor}"
236
- )
235
+ if self.spacing_factor <= 0:
236
+ raise ValueError(
237
+ f"spacing_factor must be greater than to 0.0, got {self.spacing_factor}"
238
+ )
237
239
  self._type = "dotted"
238
240
 
239
241
 
@@ -396,7 +398,7 @@ class InteractionFlag(IntFlag):
396
398
  def has_rotate(flags: int) -> bool:
397
399
  """
398
400
  Returns:
399
- `True` if the [`ROTATE`][..] interactive flag is enabled.
401
+ `True` if the [`ROTATE`][(c).] interactive flag is enabled.
400
402
  """
401
403
  return InteractionFlag.has_flag(flags, InteractionFlag.ROTATE)
402
404
 
@@ -404,7 +406,7 @@ class InteractionFlag(IntFlag):
404
406
  def has_scroll_wheel_zoom(flags: int) -> bool:
405
407
  """
406
408
  Returns:
407
- `True` if the [`SCROLL_WHEEL_ZOOM`][..] interaction flag is enabled.
409
+ `True` if the [`SCROLL_WHEEL_ZOOM`][(c).] interaction flag is enabled.
408
410
  """
409
411
  return InteractionFlag.has_flag(flags, InteractionFlag.SCROLL_WHEEL_ZOOM)
410
412
 
@@ -434,11 +436,11 @@ class MultiFingerGesture(IntFlag):
434
436
  class InteractionConfiguration:
435
437
  enable_multi_finger_gesture_race: bool = False
436
438
  """
437
- If `True`, then [`rotation_threshold`][..] and [`pinch_zoom_threshold`][..]
438
- and [`pinch_move_threshold`][..] will race.
439
+ If `True`, then [`rotation_threshold`][(c).] and [`pinch_zoom_threshold`][(c).]
440
+ and [`pinch_move_threshold`][(c).] will race.
439
441
  If multiple gestures win at the same time, then precedence:
440
- [`pinch_zoom_win_gestures`][..] > [`rotation_win_gestures`][..] >
441
- [`pinch_move_win_gestures`][..]
442
+ [`pinch_zoom_win_gestures`][(c).] > [`rotation_win_gestures`][(c).] >
443
+ [`pinch_move_win_gestures`][(c).]
442
444
  """
443
445
 
444
446
  pinch_move_threshold: ft.Number = 40.0
@@ -449,8 +451,8 @@ class InteractionConfiguration:
449
451
 
450
452
  Note:
451
453
  If [`InteractionConfiguration.flags`][(p).] doesn't contain
452
- [`InteractionFlag.PINCH_MOVE`][(p).]
453
- or [`enable_multi_finger_gesture_race`][..] is false then pinch move cannot win.
454
+ [`InteractionFlag.PINCH_MOVE`][(p).] or
455
+ [`enable_multi_finger_gesture_race`][(c).] is false then pinch move cannot win.
454
456
  """
455
457
 
456
458
  scroll_wheel_velocity: ft.Number = 0.005
@@ -468,7 +470,7 @@ class InteractionConfiguration:
468
470
  Note:
469
471
  If [`InteractionConfiguration.flags`][(p).]
470
472
  doesn't contain [`InteractionFlag.PINCH_ZOOM`][(p).]
471
- or [`enable_multi_finger_gesture_race`][..] is false then zoom cannot win.
473
+ or [`enable_multi_finger_gesture_race`][(c).] is false then zoom cannot win.
472
474
  """
473
475
 
474
476
  rotation_threshold: ft.Number = 20.0
@@ -479,7 +481,7 @@ class InteractionConfiguration:
479
481
  Note:
480
482
  If [`InteractionConfiguration.flags`][(p).]
481
483
  doesn't contain [`InteractionFlag.ROTATE`][(p).]
482
- or [`enable_multi_finger_gesture_race`][..] is false then rotate cannot win.
484
+ or [`enable_multi_finger_gesture_race`][(c).] is false then rotate cannot win.
483
485
  """
484
486
 
485
487
  flags: InteractionFlag = InteractionFlag.ALL
@@ -489,16 +491,16 @@ class InteractionConfiguration:
489
491
 
490
492
  rotation_win_gestures: MultiFingerGesture = MultiFingerGesture.ROTATE
491
493
  """
492
- When [`rotation_threshold`][..] wins over [`pinch_zoom_threshold`][..] and
493
- [`pinch_move_threshold`][..] then `rotation_win_gestures` gestures will be used.
494
+ When [`rotation_threshold`][(c).] wins over [`pinch_zoom_threshold`][(c).] and
495
+ [`pinch_move_threshold`][(c).] then `rotation_win_gestures` gestures will be used.
494
496
  """
495
497
 
496
498
  pinch_move_win_gestures: MultiFingerGesture = (
497
499
  MultiFingerGesture.PINCH_ZOOM | MultiFingerGesture.PINCH_MOVE
498
500
  )
499
501
  """
500
- When [`pinch_move_threshold`][..] wins over [`rotation_threshold`][..]
501
- and [`pinch_zoom_threshold`][..] then `pinch_move_win_gestures` gestures
502
+ When [`pinch_move_threshold`][(c).] wins over [`rotation_threshold`][(c).]
503
+ and [`pinch_zoom_threshold`][(c).] then `pinch_move_win_gestures` gestures
502
504
  will be used.
503
505
 
504
506
  By default [`MultiFingerGesture.PINCH_MOVE`][(p).]
@@ -510,8 +512,8 @@ class InteractionConfiguration:
510
512
  MultiFingerGesture.PINCH_ZOOM | MultiFingerGesture.PINCH_MOVE
511
513
  )
512
514
  """
513
- When [`pinch_zoom_threshold`][..] wins over [`rotation_threshold`][..]
514
- and [`pinch_move_threshold`][..]
515
+ When [`pinch_zoom_threshold`][(c).] wins over [`rotation_threshold`][(c).]
516
+ and [`pinch_move_threshold`][(c).]
515
517
  then `pinch_zoom_win_gestures` gestures will be used.
516
518
 
517
519
  By default [`MultiFingerGesture.PINCH_ZOOM`][(p).]
@@ -620,7 +622,7 @@ class CameraFit:
620
622
  depending on which one was provided.
621
623
 
622
624
  Raises:
623
- AssertionError: If both [`bounds`][(c).] and [`coordinates`][(c).]
625
+ ValueError: If both [`bounds`][(c).] and [`coordinates`][(c).]
624
626
  are `None` or not `None`.
625
627
  """
626
628
 
@@ -629,7 +631,7 @@ class CameraFit:
629
631
  The bounds which the camera should contain once it is fitted.
630
632
 
631
633
  Note:
632
- If this is not `None`, [`coordinates`][..] should be `None`, and vice versa.
634
+ If this is not `None`, [`coordinates`][(c).] should be `None`, and vice versa.
633
635
  """
634
636
 
635
637
  coordinates: Optional[list[MapLatitudeLongitude]] = None
@@ -637,7 +639,7 @@ class CameraFit:
637
639
  The coordinates which the camera should contain once it is fitted.
638
640
 
639
641
  Note:
640
- If this is not `None`, [`bounds`][..] should be `None`, and vice versa.
642
+ If this is not `None`, [`bounds`][(c).] should be `None`, and vice versa.
641
643
  """
642
644
 
643
645
  max_zoom: Optional[ft.Number] = None
@@ -664,9 +666,13 @@ class CameraFit:
664
666
  """
665
667
 
666
668
  def __post_init__(self):
667
- assert (self.bounds and not self.coordinates) or (
668
- self.coordinates and not self.bounds
669
- ), "only one of bounds or coordinates must be provided, not both"
669
+ if not (
670
+ (self.bounds and not self.coordinates)
671
+ or (self.coordinates and not self.bounds)
672
+ ):
673
+ raise ValueError(
674
+ "only one of bounds or coordinates must be provided, not both"
675
+ )
670
676
 
671
677
 
672
678
  @dataclass
@@ -724,12 +730,16 @@ class InstantaneousTileDisplay(TileDisplay):
724
730
  opacity: ft.Number = 1.0
725
731
  """
726
732
  The optional opacity of the tile.
733
+
734
+ Raises:
735
+ ValueError: If its value is not between `0.0` and `1.0` inclusive.
727
736
  """
728
737
 
729
738
  def __post_init__(self):
730
- assert 0.0 <= self.opacity <= 1.0, (
731
- f"opacity must be between 0.0 and 1.0 inclusive, got {self.opacity}"
732
- )
739
+ if not (0.0 <= self.opacity <= 1.0):
740
+ raise ValueError(
741
+ f"opacity must be between 0.0 and 1.0 inclusive, got {self.opacity}"
742
+ )
733
743
  self._type = "instantaneous"
734
744
 
735
745
 
@@ -747,22 +757,30 @@ class FadeInTileDisplay(TileDisplay):
747
757
  start_opacity: ft.Number = 0.0
748
758
  """
749
759
  Opacity start value when a tile is faded in.
760
+
761
+ Raises:
762
+ ValueError: If its value is not between `0.0` and `1.0` inclusive.
750
763
  """
751
764
 
752
765
  reload_start_opacity: ft.Number = 0.0
753
766
  """
754
767
  Opacity start value when a tile is reloaded.
768
+
769
+ Raises:
770
+ ValueError: If its value is not between `0.0` and `1.0` inclusive.
755
771
  """
756
772
 
757
773
  def __post_init__(self):
758
- assert 0.0 <= self.start_opacity <= 1.0, (
759
- f"start_opacity must be between 0.0 and 1.0 inclusive, "
760
- f"got {self.start_opacity}"
761
- )
762
- assert 0.0 <= self.reload_start_opacity <= 1.0, (
763
- f"reload_start_opacity must be between 0.0 and 1.0 inclusive, "
764
- f"got {self.reload_start_opacity}"
765
- )
774
+ if not (0.0 <= self.start_opacity <= 1.0):
775
+ raise ValueError(
776
+ "start_opacity must be between 0.0 and 1.0 inclusive, "
777
+ f"got {self.start_opacity}"
778
+ )
779
+ if not (0.0 <= self.reload_start_opacity <= 1.0):
780
+ raise ValueError(
781
+ "reload_start_opacity must be between 0.0 and 1.0 inclusive, "
782
+ f"got {self.reload_start_opacity}"
783
+ )
766
784
  self._type = "fadein"
767
785
 
768
786
 
@@ -798,7 +816,7 @@ class KeyboardConfiguration:
798
816
  Duration of the curved ([`AnimationCurve.EASE_IN`][flet.AnimationCurve.EASE_IN])
799
817
  portion of the animation occuring
800
818
  after a key down event (and after a key up event if
801
- [`animation_curve_reverse_duration`][..] is `None`)
819
+ [`animation_curve_reverse_duration`][(c).] is `None`)
802
820
  """
803
821
 
804
822
  animation_curve_reverse_duration: Optional[ft.DurationValue] = field(
@@ -809,7 +827,7 @@ class KeyboardConfiguration:
809
827
  [`AnimationCurve.EASE_IN`][flet.AnimationCurve.EASE_IN])
810
828
  portion of the animation occuring after a key up event.
811
829
 
812
- Set to `None` to use [`animation_curve_duration`][..].
830
+ Set to `None` to use [`animation_curve_duration`][(c).].
813
831
  """
814
832
 
815
833
  animation_curve_curve: AnimationCurve = AnimationCurve.EASE_IN_OUT
@@ -872,7 +890,7 @@ class KeyboardConfiguration:
872
890
 
873
891
  Must be greater than 0 and less than or equal to 1.
874
892
  To disable leaping, or change the maximum length of the key press
875
- that will trigger a leap, see [`perform_leap_trigger_duration`][..].
893
+ that will trigger a leap, see [`perform_leap_trigger_duration`][(c).].
876
894
  """
877
895
 
878
896
  max_rotate_velocity: ft.Number = 3
@@ -896,7 +914,7 @@ class KeyboardConfiguration:
896
914
  The amount to scale the panning offset velocity by during a leap animation.
897
915
 
898
916
  The larger the number, the larger the movement during a leap.
899
- To change the duration of a leap, see [`leap_max_of_curve_component`][..].
917
+ To change the duration of a leap, see [`leap_max_of_curve_component`][(c).].
900
918
  """
901
919
 
902
920
  rotate_leap_velocity_multiplier: ft.Number = 3
@@ -904,9 +922,9 @@ class KeyboardConfiguration:
904
922
  The amount to scale the rotation velocity by during a leap animation
905
923
 
906
924
  The larger the number, the larger the rotation difference during a leap.
907
- To change the duration of a leap, see [`leap_max_of_curve_component`][..].
925
+ To change the duration of a leap, see [`leap_max_of_curve_component`][(c).].
908
926
 
909
- This may cause the pan velocity to exceed [`max_rotate_velocity`][..].
927
+ This may cause the pan velocity to exceed [`max_rotate_velocity`][(c).].
910
928
  """
911
929
 
912
930
  zoom_leap_velocity_multiplier: ft.Number = 3
@@ -914,9 +932,9 @@ class KeyboardConfiguration:
914
932
  The amount to scale the zooming velocity by during a leap animation.
915
933
 
916
934
  The larger the number, the larger the zoom difference during a leap. To
917
- change the duration of a leap, see [`leap_max_of_curve_component`][..].
935
+ change the duration of a leap, see [`leap_max_of_curve_component`][(c).].
918
936
 
919
- This may cause the pan velocity to exceed [`max_zoom_velocity`][..].
937
+ This may cause the pan velocity to exceed [`max_zoom_velocity`][(c).].
920
938
  """
921
939
 
922
940
  perform_leap_trigger_duration: Optional[ft.DurationValue] = field(
@@ -926,10 +944,10 @@ class KeyboardConfiguration:
926
944
  Maximum duration between the key down and key up events of an animation
927
945
  which will trigger a 'leap'.
928
946
 
929
- To customize the leap itself, see the [`leap_max_of_curve_component`][..] &
930
- `*leap_velocity_multiplier` ([`zoom_leap_velocity_multiplier`][..],
931
- [`pan_leap_velocity_multiplier`][..] and [`rotate_leap_velocity_multiplier`][..])
932
- properties.
947
+ To customize the leap itself, see the [`leap_max_of_curve_component`][(c).] &
948
+ `*leap_velocity_multiplier` ([`zoom_leap_velocity_multiplier`][(c).],
949
+ [`pan_leap_velocity_multiplier`][(c).] and
950
+ [`rotate_leap_velocity_multiplier`][(c).]) properties.
933
951
 
934
952
  Set to `None` to disable leaping.
935
953
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-map
3
- Version: 0.70.0.dev6365
3
+ Version: 0.70.0.dev6370
4
4
  Summary: Interactive map controls for Flet apps.
5
5
  Author-email: Flet contributors <hello@flet.dev>
6
6
  License-Expression: Apache-2.0
@@ -11,7 +11,7 @@ Project-URL: Issues, https://github.com/flet-dev/flet/issues
11
11
  Requires-Python: >=3.10
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
- Requires-Dist: flet==0.70.0.dev6365
14
+ Requires-Dist: flet==0.70.0.dev6370
15
15
  Dynamic: license-file
16
16
 
17
17
  # flet-map
@@ -0,0 +1 @@
1
+ flet==0.70.0.dev6370
@@ -1 +0,0 @@
1
- flet==0.70.0.dev6365