flet-map 0.0.1__py3-none-any.whl → 0.1.0__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 -1
- flet_map/circle_layer.py +156 -0
- flet_map/map.py +674 -0
- flet_map/map_layer.py +26 -0
- flet_map/marker_layer.py +183 -0
- flet_map/polygon_layer.py +262 -0
- flet_map/polyline_layer.py +292 -0
- flet_map/rich_attribution.py +141 -0
- flet_map/simple_attribution.py +86 -0
- flet_map/text_source_attribution.py +87 -0
- flet_map/tile_layer.py +278 -0
- flet_map-0.1.0.dist-info/METADATA +168 -0
- flet_map-0.1.0.dist-info/RECORD +34 -0
- {flet_map-0.0.1.dist-info → flet_map-0.1.0.dist-info}/WHEEL +2 -1
- flet_map-0.1.0.dist-info/top_level.txt +2 -0
- flutter/flet_map/CHANGELOG.md +3 -0
- flutter/flet_map/LICENSE +201 -0
- flutter/flet_map/README.md +3 -0
- flutter/flet_map/analysis_options.yaml +4 -0
- flutter/flet_map/lib/flet_map.dart +3 -0
- flutter/flet_map/lib/src/circle_layer.dart +43 -0
- flutter/flet_map/lib/src/create_control.dart +70 -0
- flutter/flet_map/lib/src/map.dart +140 -0
- flutter/flet_map/lib/src/marker_layer.dart +50 -0
- flutter/flet_map/lib/src/polygon_layer.dart +68 -0
- flutter/flet_map/lib/src/polyline_layer.dart +80 -0
- flutter/flet_map/lib/src/rich_attribution.dart +61 -0
- flutter/flet_map/lib/src/simple_attribution.dart +37 -0
- flutter/flet_map/lib/src/text_source_attribution.dart +29 -0
- flutter/flet_map/lib/src/tile_layer.dart +80 -0
- flutter/flet_map/lib/src/utils/attribution_alignment.dart +12 -0
- flutter/flet_map/lib/src/utils/map.dart +280 -0
- flutter/flet_map/pubspec.lock +831 -0
- flutter/flet_map/pubspec.yaml +21 -0
- .DS_Store +0 -0
- flet_map/.DS_Store +0 -0
- flet_map-0.0.1.dist-info/.DS_Store +0 -0
- flet_map-0.0.1.dist-info/METADATA +0 -14
- flet_map-0.0.1.dist-info/RECORD +0 -7
flet_map/__init__.py
CHANGED
|
@@ -1 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
from flet_map.circle_layer import CircleLayer, CircleMarker
|
|
2
|
+
from flet_map.map import (
|
|
3
|
+
Map,
|
|
4
|
+
MapEvent,
|
|
5
|
+
MapEventSource,
|
|
6
|
+
MapHoverEvent,
|
|
7
|
+
MapInteractionConfiguration,
|
|
8
|
+
MapInteractiveFlag,
|
|
9
|
+
MapLatitudeLongitude,
|
|
10
|
+
MapLatitudeLongitudeBounds,
|
|
11
|
+
MapMultiFingerGesture,
|
|
12
|
+
MapPointerDeviceType,
|
|
13
|
+
MapPointerEvent,
|
|
14
|
+
MapPositionChangeEvent,
|
|
15
|
+
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,
|
|
22
|
+
PatternFit,
|
|
23
|
+
PolylineLayer,
|
|
24
|
+
PolylineMarker,
|
|
25
|
+
SolidStrokePattern,
|
|
26
|
+
)
|
|
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
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
from typing import Any, List, Optional, Union
|
|
2
|
+
|
|
3
|
+
from flet.core.control import Control, OptionalNumber
|
|
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
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class CircleMarker(Control):
|
|
11
|
+
"""
|
|
12
|
+
A circular marker displayed on the Map at the specified location through the CircleLayer.
|
|
13
|
+
|
|
14
|
+
-----
|
|
15
|
+
|
|
16
|
+
Online docs: https://flet.dev/docs/controls/mapcirclemarker
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def __init__(
|
|
20
|
+
self,
|
|
21
|
+
radius: Union[int, float],
|
|
22
|
+
coordinates: MapLatitudeLongitude,
|
|
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"
|
|
51
|
+
|
|
52
|
+
def before_update(self):
|
|
53
|
+
super().before_update()
|
|
54
|
+
self._set_attr_json("coordinates", self.__coordinates)
|
|
55
|
+
|
|
56
|
+
# use_radius_in_meter
|
|
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
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class CircleLayer(MapLayer):
|
|
115
|
+
"""
|
|
116
|
+
A layer to display CircleMarkers.
|
|
117
|
+
|
|
118
|
+
-----
|
|
119
|
+
|
|
120
|
+
Online docs: https://flet.dev/docs/controls/mapcirclelayer
|
|
121
|
+
"""
|
|
122
|
+
|
|
123
|
+
def __init__(
|
|
124
|
+
self,
|
|
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
|