flet-map 0.1.0.dev2__py3-none-any.whl → 0.2.0.dev45__py3-none-any.whl
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.
- flet_map/__init__.py +30 -19
- flet_map/circle_layer.py +46 -139
- flet_map/map.py +462 -604
- flet_map/map_layer.py +14 -20
- flet_map/marker_layer.py +83 -169
- flet_map/polygon_layer.py +95 -232
- flet_map/polyline_layer.py +85 -262
- flet_map/rich_attribution.py +48 -126
- flet_map/simple_attribution.py +24 -75
- flet_map/source_attribution.py +73 -0
- flet_map/tile_layer.py +224 -266
- flet_map/types.py +953 -0
- flet_map-0.2.0.dev45.dist-info/METADATA +66 -0
- flet_map-0.2.0.dev45.dist-info/RECORD +35 -0
- {flet_map-0.1.0.dev2.dist-info → flet_map-0.2.0.dev45.dist-info}/WHEEL +1 -1
- flet_map-0.2.0.dev45.dist-info/licenses/LICENSE +201 -0
- flutter/flet_map/CHANGELOG.md +4 -0
- flutter/flet_map/lib/flet_map.dart +1 -1
- flutter/flet_map/lib/src/circle_layer.dart +15 -25
- flutter/flet_map/lib/src/extension.dart +37 -0
- flutter/flet_map/lib/src/map.dart +93 -105
- flutter/flet_map/lib/src/marker_layer.dart +21 -33
- flutter/flet_map/lib/src/polygon_layer.dart +32 -52
- flutter/flet_map/lib/src/polyline_layer.dart +41 -64
- flutter/flet_map/lib/src/rich_attribution.dart +34 -34
- flutter/flet_map/lib/src/simple_attribution.dart +9 -23
- flutter/flet_map/lib/src/tile_layer.dart +47 -60
- flutter/flet_map/lib/src/utils/attribution_alignment.dart +1 -3
- flutter/flet_map/lib/src/utils/map.dart +257 -203
- flutter/flet_map/pubspec.lock +179 -130
- flutter/flet_map/pubspec.yaml +10 -5
- flet_map/text_source_attribution.py +0 -87
- flet_map-0.1.0.dev2.dist-info/METADATA +0 -168
- flet_map-0.1.0.dev2.dist-info/RECORD +0 -34
- flutter/flet_map/lib/src/create_control.dart +0 -70
- flutter/flet_map/lib/src/text_source_attribution.dart +0 -29
- {flet_map-0.1.0.dev2.dist-info → flet_map-0.2.0.dev45.dist-info}/top_level.txt +0 -0
flet_map/__init__.py
CHANGED
|
@@ -1,30 +1,41 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
3
|
-
|
|
1
|
+
from .circle_layer import CircleLayer, CircleMarker
|
|
2
|
+
from .map import Map
|
|
3
|
+
from .marker_layer import Marker, MarkerLayer
|
|
4
|
+
from .polygon_layer import PolygonLayer, PolygonMarker
|
|
5
|
+
from .polyline_layer import PolylineLayer, PolylineMarker
|
|
6
|
+
from .rich_attribution import RichAttribution
|
|
7
|
+
from .simple_attribution import SimpleAttribution
|
|
8
|
+
from .source_attribution import (
|
|
9
|
+
ImageSourceAttribution,
|
|
10
|
+
SourceAttribution,
|
|
11
|
+
TextSourceAttribution,
|
|
12
|
+
)
|
|
13
|
+
from .tile_layer import TileLayer
|
|
14
|
+
from .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,
|
|
4
27
|
MapEvent,
|
|
5
28
|
MapEventSource,
|
|
6
29
|
MapHoverEvent,
|
|
7
|
-
MapInteractionConfiguration,
|
|
8
|
-
MapInteractiveFlag,
|
|
9
30
|
MapLatitudeLongitude,
|
|
10
31
|
MapLatitudeLongitudeBounds,
|
|
11
|
-
MapMultiFingerGesture,
|
|
12
|
-
MapPointerDeviceType,
|
|
13
32
|
MapPointerEvent,
|
|
14
33
|
MapPositionChangeEvent,
|
|
15
34
|
MapTapEvent,
|
|
16
|
-
|
|
17
|
-
from flet_map.marker_layer import Marker, MarkerLayer
|
|
18
|
-
from flet_map.polygon_layer import PolygonLayer, PolygonMarker
|
|
19
|
-
from flet_map.polyline_layer import (
|
|
20
|
-
DashedStrokePattern,
|
|
21
|
-
DottedStrokePattern,
|
|
35
|
+
MultiFingerGesture,
|
|
22
36
|
PatternFit,
|
|
23
|
-
PolylineLayer,
|
|
24
|
-
PolylineMarker,
|
|
25
37
|
SolidStrokePattern,
|
|
38
|
+
StrokePattern,
|
|
39
|
+
TileDisplay,
|
|
40
|
+
TileLayerEvictErrorTileStrategy,
|
|
26
41
|
)
|
|
27
|
-
from flet_map.rich_attribution import RichAttribution
|
|
28
|
-
from flet_map.simple_attribution import SimpleAttribution
|
|
29
|
-
from flet_map.text_source_attribution import TextSourceAttribution
|
|
30
|
-
from flet_map.tile_layer import MapTileLayerEvictErrorTileStrategy, TileLayer
|
flet_map/circle_layer.py
CHANGED
|
@@ -1,156 +1,63 @@
|
|
|
1
|
-
from typing import
|
|
1
|
+
from typing import List, Optional
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
from flet_map.map import MapLatitudeLongitude
|
|
5
|
-
from flet_map.map_layer import MapLayer
|
|
6
|
-
from flet.core.ref import Ref
|
|
7
|
-
from flet.core.types import ColorEnums, ColorValue
|
|
3
|
+
import flet as ft
|
|
8
4
|
|
|
5
|
+
from .map_layer import MapLayer
|
|
6
|
+
from .types import MapLatitudeLongitude
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
__all__ = ["CircleMarker", "CircleLayer"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@ft.control("CircleMarker")
|
|
12
|
+
class CircleMarker(ft.Control):
|
|
13
|
+
"""
|
|
14
|
+
A circular marker displayed on the Map at the specified location through the [`CircleLayer`][(p).].
|
|
15
|
+
|
|
16
|
+
Raises:
|
|
17
|
+
AssertionError: If the [`border_stroke_width`][(c).] is negative.
|
|
11
18
|
"""
|
|
12
|
-
A circular marker displayed on the Map at the specified location through the CircleLayer.
|
|
13
19
|
|
|
14
|
-
|
|
20
|
+
radius: ft.Number
|
|
21
|
+
"""The radius of the circle"""
|
|
22
|
+
|
|
23
|
+
coordinates: MapLatitudeLongitude
|
|
24
|
+
"""The center coordinates of the circle"""
|
|
25
|
+
|
|
26
|
+
color: Optional[ft.ColorValue] = None
|
|
27
|
+
"""The color of the circle area."""
|
|
28
|
+
|
|
29
|
+
border_color: Optional[ft.ColorValue] = None
|
|
30
|
+
"""
|
|
31
|
+
The color of the circle border line.
|
|
32
|
+
|
|
33
|
+
Needs [`border_stroke_width`][..] to be greater than `0.0` in order to be visible.
|
|
34
|
+
"""
|
|
15
35
|
|
|
16
|
-
|
|
36
|
+
border_stroke_width: ft.Number = 0.0
|
|
37
|
+
"""
|
|
38
|
+
The stroke width for the circle border.
|
|
39
|
+
|
|
40
|
+
Note:
|
|
41
|
+
Must be non-negative.
|
|
17
42
|
"""
|
|
18
43
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
color: Optional[ColorValue] = None,
|
|
24
|
-
border_color: Optional[ColorValue] = None,
|
|
25
|
-
border_stroke_width: OptionalNumber = None,
|
|
26
|
-
use_radius_in_meter: Optional[bool] = None,
|
|
27
|
-
#
|
|
28
|
-
# Control
|
|
29
|
-
#
|
|
30
|
-
ref: Optional[Ref] = None,
|
|
31
|
-
visible: Optional[bool] = None,
|
|
32
|
-
data: Any = None,
|
|
33
|
-
):
|
|
34
|
-
|
|
35
|
-
Control.__init__(
|
|
36
|
-
self,
|
|
37
|
-
ref=ref,
|
|
38
|
-
visible=visible,
|
|
39
|
-
data=data,
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
self.coordinates = coordinates
|
|
43
|
-
self.color = color
|
|
44
|
-
self.border_color = border_color
|
|
45
|
-
self.border_stroke_width = border_stroke_width
|
|
46
|
-
self.use_radius_in_meter = use_radius_in_meter
|
|
47
|
-
self.radius = radius
|
|
48
|
-
|
|
49
|
-
def _get_control_name(self):
|
|
50
|
-
return "map_circle_marker"
|
|
44
|
+
use_radius_in_meter: bool = False
|
|
45
|
+
"""
|
|
46
|
+
Whether the [`radius`][..] should use the unit meters.
|
|
47
|
+
"""
|
|
51
48
|
|
|
52
49
|
def before_update(self):
|
|
53
50
|
super().before_update()
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
@property
|
|
58
|
-
def use_radius_in_meter(self) -> bool:
|
|
59
|
-
return self._get_attr("useRadiusInMeter", data_type="bool", def_value=False)
|
|
60
|
-
|
|
61
|
-
@use_radius_in_meter.setter
|
|
62
|
-
def use_radius_in_meter(self, value: Optional[bool]):
|
|
63
|
-
self._set_attr("useRadiusInMeter", value)
|
|
64
|
-
|
|
65
|
-
# color
|
|
66
|
-
@property
|
|
67
|
-
def color(self) -> Optional[ColorValue]:
|
|
68
|
-
return self.__color
|
|
69
|
-
|
|
70
|
-
@color.setter
|
|
71
|
-
def color(self, value: Optional[ColorValue]):
|
|
72
|
-
self.__color = value
|
|
73
|
-
self._set_enum_attr("color", value, ColorEnums)
|
|
74
|
-
|
|
75
|
-
# border_color
|
|
76
|
-
@property
|
|
77
|
-
def border_color(self) -> Optional[ColorValue]:
|
|
78
|
-
return self.__border_color
|
|
79
|
-
|
|
80
|
-
@border_color.setter
|
|
81
|
-
def border_color(self, value: Optional[ColorValue]):
|
|
82
|
-
self.__border_color = value
|
|
83
|
-
self._set_enum_attr("borderColor", value, ColorEnums)
|
|
84
|
-
|
|
85
|
-
# radius
|
|
86
|
-
@property
|
|
87
|
-
def radius(self) -> Union[int, float]:
|
|
88
|
-
return self._get_attr("radius", data_type="float")
|
|
89
|
-
|
|
90
|
-
@radius.setter
|
|
91
|
-
def radius(self, value: Union[int, float]):
|
|
92
|
-
self._set_attr("radius", value)
|
|
93
|
-
|
|
94
|
-
# border_stroke_width
|
|
95
|
-
@property
|
|
96
|
-
def border_stroke_width(self) -> OptionalNumber:
|
|
97
|
-
return self._get_attr("borderStrokeWidth", data_type="float")
|
|
98
|
-
|
|
99
|
-
@border_stroke_width.setter
|
|
100
|
-
def border_stroke_width(self, value: OptionalNumber):
|
|
101
|
-
assert value is None or value >= 0, "border_stroke_width cannot be negative"
|
|
102
|
-
self._set_attr("borderStrokeWidth", value)
|
|
103
|
-
|
|
104
|
-
# coordinates
|
|
105
|
-
@property
|
|
106
|
-
def coordinates(self) -> MapLatitudeLongitude:
|
|
107
|
-
return self.__coordinates
|
|
108
|
-
|
|
109
|
-
@coordinates.setter
|
|
110
|
-
def coordinates(self, value: MapLatitudeLongitude):
|
|
111
|
-
self.__coordinates = value
|
|
51
|
+
assert (
|
|
52
|
+
self.border_stroke_width >= 0
|
|
53
|
+
), "border_stroke_width must be greater than or equal to 0"
|
|
112
54
|
|
|
113
55
|
|
|
56
|
+
@ft.control("CircleLayer")
|
|
114
57
|
class CircleLayer(MapLayer):
|
|
115
58
|
"""
|
|
116
|
-
A layer to display
|
|
117
|
-
|
|
118
|
-
-----
|
|
119
|
-
|
|
120
|
-
Online docs: https://flet.dev/docs/controls/mapcirclelayer
|
|
59
|
+
A layer to display [`CircleMarker`][(p).]s.
|
|
121
60
|
"""
|
|
122
61
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
circles: List[CircleMarker],
|
|
126
|
-
#
|
|
127
|
-
# MapLayer
|
|
128
|
-
#
|
|
129
|
-
ref: Optional[Ref] = None,
|
|
130
|
-
visible: Optional[bool] = None,
|
|
131
|
-
data: Any = None,
|
|
132
|
-
):
|
|
133
|
-
|
|
134
|
-
MapLayer.__init__(
|
|
135
|
-
self,
|
|
136
|
-
ref=ref,
|
|
137
|
-
visible=visible,
|
|
138
|
-
data=data,
|
|
139
|
-
)
|
|
140
|
-
|
|
141
|
-
self.circles = circles
|
|
142
|
-
|
|
143
|
-
def _get_control_name(self):
|
|
144
|
-
return "map_circle_layer"
|
|
145
|
-
|
|
146
|
-
def _get_children(self):
|
|
147
|
-
return self.__circles
|
|
148
|
-
|
|
149
|
-
# circles
|
|
150
|
-
@property
|
|
151
|
-
def circles(self) -> List[CircleMarker]:
|
|
152
|
-
return self.__circles
|
|
153
|
-
|
|
154
|
-
@circles.setter
|
|
155
|
-
def circles(self, value: List[CircleMarker]):
|
|
156
|
-
self.__circles = value
|
|
62
|
+
circles: List[CircleMarker]
|
|
63
|
+
"""A list of [`CircleMarker`][(p).]s to display."""
|