dash-openlayers 0.0.1__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.
Files changed (29) hide show
  1. dash_openlayers-0.0.1/LICENSE +21 -0
  2. dash_openlayers-0.0.1/PKG-INFO +125 -0
  3. dash_openlayers-0.0.1/README.md +85 -0
  4. dash_openlayers-0.0.1/dash_openlayers/DrawInteraction.py +89 -0
  5. dash_openlayers-0.0.1/dash_openlayers/ImageWMS.py +66 -0
  6. dash_openlayers-0.0.1/dash_openlayers/LayerControl.py +61 -0
  7. dash_openlayers-0.0.1/dash_openlayers/Map.py +111 -0
  8. dash_openlayers-0.0.1/dash_openlayers/ModifyInteraction.py +93 -0
  9. dash_openlayers-0.0.1/dash_openlayers/SelectInteraction.py +63 -0
  10. dash_openlayers-0.0.1/dash_openlayers/TileLayer.py +61 -0
  11. dash_openlayers-0.0.1/dash_openlayers/TileWMS.py +66 -0
  12. dash_openlayers-0.0.1/dash_openlayers/VectorLayer.py +81 -0
  13. dash_openlayers-0.0.1/dash_openlayers/VectorTileLayer.py +74 -0
  14. dash_openlayers-0.0.1/dash_openlayers/WFSLayer.py +92 -0
  15. dash_openlayers-0.0.1/dash_openlayers/WMTSLayer.py +90 -0
  16. dash_openlayers-0.0.1/dash_openlayers/__init__.py +34 -0
  17. dash_openlayers-0.0.1/dash_openlayers/_imports_.py +27 -0
  18. dash_openlayers-0.0.1/dash_openlayers/dash_openlayers.esm.js +77084 -0
  19. dash_openlayers-0.0.1/dash_openlayers/dash_openlayers.umd.js +2 -0
  20. dash_openlayers-0.0.1/dash_openlayers/metadata.json +1080 -0
  21. dash_openlayers-0.0.1/dash_openlayers/package-info.json +57 -0
  22. dash_openlayers-0.0.1/dash_openlayers.egg-info/PKG-INFO +125 -0
  23. dash_openlayers-0.0.1/dash_openlayers.egg-info/SOURCES.txt +27 -0
  24. dash_openlayers-0.0.1/dash_openlayers.egg-info/dependency_links.txt +1 -0
  25. dash_openlayers-0.0.1/dash_openlayers.egg-info/requires.txt +1 -0
  26. dash_openlayers-0.0.1/dash_openlayers.egg-info/top_level.txt +1 -0
  27. dash_openlayers-0.0.1/pyproject.toml +74 -0
  28. dash_openlayers-0.0.1/setup.cfg +4 -0
  29. dash_openlayers-0.0.1/tests/test_import.py +8 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ravi Sharma
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,125 @@
1
+ Metadata-Version: 2.4
2
+ Name: dash-openlayers
3
+ Version: 0.0.1
4
+ Summary: A Dash wrapper around OpenLayers - GIS rendering engine
5
+ Author-email: Ravi Sharma <ravikr731@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Ravi Sharma
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/rakrsh/dash-openlayers
29
+ Project-URL: Issues, https://github.com/rakrsh/dash-openlayers/issues
30
+ Classifier: Framework :: Dash
31
+ Classifier: Intended Audience :: Developers
32
+ Classifier: License :: OSI Approved :: MIT License
33
+ Classifier: Programming Language :: Python :: 3
34
+ Classifier: Topic :: Scientific/Engineering :: GIS
35
+ Requires-Python: >=3.10
36
+ Description-Content-Type: text/markdown
37
+ License-File: LICENSE
38
+ Requires-Dist: dash>=2.18.2
39
+ Dynamic: license-file
40
+
41
+ # dash-openlayers
42
+
43
+ OpenLayers mapping components for Plotly Dash. Build maps declaratively in
44
+ Python, use OpenLayers for rendering and editing, and receive map events and
45
+ feature data in Dash callbacks.
46
+
47
+ ## Install
48
+
49
+ ```bash
50
+ pip install dash-openlayers
51
+ ```
52
+
53
+ Requires Python 3.10 or newer. Dash is installed as a package dependency.
54
+
55
+ ## Quick Example
56
+
57
+ ```python
58
+ import dash
59
+ from dash import Input, Output, html
60
+ import dash_openlayers as dol
61
+
62
+ app = dash.Dash(__name__)
63
+ app.layout = html.Div(
64
+ [
65
+ dol.Map(
66
+ id="map",
67
+ center=[10, 45],
68
+ zoom=5,
69
+ children=[
70
+ dol.TileLayer(id="osm", source="OSM"),
71
+ dol.VectorLayer(
72
+ id="places",
73
+ geojson={
74
+ "type": "FeatureCollection",
75
+ "features": [
76
+ {
77
+ "type": "Feature",
78
+ "geometry": {"type": "Point", "coordinates": [10, 45]},
79
+ "properties": {"name": "Sample place"},
80
+ }
81
+ ],
82
+ },
83
+ ),
84
+ dol.SelectInteraction(id="selection", layerId="places"),
85
+ dol.LayerControl(id="layers"),
86
+ ],
87
+ style={"height": "600px"},
88
+ ),
89
+ html.Pre(id="selection-output"),
90
+ ]
91
+ )
92
+
93
+
94
+ @app.callback(Output("selection-output", "children"), Input("selection", "selectedGeoJSON"))
95
+ def show_selection(selection):
96
+ return str(selection or "Select a feature")
97
+
98
+
99
+ if __name__ == "__main__":
100
+ app.run(debug=True)
101
+ ```
102
+
103
+ ## Components
104
+
105
+ - Maps, synchronized view state, custom Proj4 projections, and click events.
106
+ - OSM/XYZ, GeoJSON vector, WMS, WMTS, MVT vector-tile, and WFS GeoJSON layers.
107
+ - Draw, select, modify, snapping, per-feature topology validation, and undo/redo.
108
+ - GeoJSON/WKT input and GeoJSON/WKT/TopoJSON edit output.
109
+ - Point clustering, decluttering, and layer visibility/opacity/order controls.
110
+
111
+ WFS-T writes are not performed by `WFSLayer`; see the guarded example in
112
+ [`tests/demos/wfs_demo.py`](tests/demos/wfs_demo.py) for an application-owned
113
+ transaction callback.
114
+
115
+ ## Documentation
116
+
117
+ - [Quickstart](docs/quickstart.md)
118
+ - [Usage guide](docs/usage.md)
119
+ - [API reference](docs/api.md)
120
+ - [Architecture](docs/architecture.md)
121
+ - [Testing](docs/testing.md)
122
+
123
+ ## Contributing
124
+
125
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and workflow.
@@ -0,0 +1,85 @@
1
+ # dash-openlayers
2
+
3
+ OpenLayers mapping components for Plotly Dash. Build maps declaratively in
4
+ Python, use OpenLayers for rendering and editing, and receive map events and
5
+ feature data in Dash callbacks.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pip install dash-openlayers
11
+ ```
12
+
13
+ Requires Python 3.10 or newer. Dash is installed as a package dependency.
14
+
15
+ ## Quick Example
16
+
17
+ ```python
18
+ import dash
19
+ from dash import Input, Output, html
20
+ import dash_openlayers as dol
21
+
22
+ app = dash.Dash(__name__)
23
+ app.layout = html.Div(
24
+ [
25
+ dol.Map(
26
+ id="map",
27
+ center=[10, 45],
28
+ zoom=5,
29
+ children=[
30
+ dol.TileLayer(id="osm", source="OSM"),
31
+ dol.VectorLayer(
32
+ id="places",
33
+ geojson={
34
+ "type": "FeatureCollection",
35
+ "features": [
36
+ {
37
+ "type": "Feature",
38
+ "geometry": {"type": "Point", "coordinates": [10, 45]},
39
+ "properties": {"name": "Sample place"},
40
+ }
41
+ ],
42
+ },
43
+ ),
44
+ dol.SelectInteraction(id="selection", layerId="places"),
45
+ dol.LayerControl(id="layers"),
46
+ ],
47
+ style={"height": "600px"},
48
+ ),
49
+ html.Pre(id="selection-output"),
50
+ ]
51
+ )
52
+
53
+
54
+ @app.callback(Output("selection-output", "children"), Input("selection", "selectedGeoJSON"))
55
+ def show_selection(selection):
56
+ return str(selection or "Select a feature")
57
+
58
+
59
+ if __name__ == "__main__":
60
+ app.run(debug=True)
61
+ ```
62
+
63
+ ## Components
64
+
65
+ - Maps, synchronized view state, custom Proj4 projections, and click events.
66
+ - OSM/XYZ, GeoJSON vector, WMS, WMTS, MVT vector-tile, and WFS GeoJSON layers.
67
+ - Draw, select, modify, snapping, per-feature topology validation, and undo/redo.
68
+ - GeoJSON/WKT input and GeoJSON/WKT/TopoJSON edit output.
69
+ - Point clustering, decluttering, and layer visibility/opacity/order controls.
70
+
71
+ WFS-T writes are not performed by `WFSLayer`; see the guarded example in
72
+ [`tests/demos/wfs_demo.py`](tests/demos/wfs_demo.py) for an application-owned
73
+ transaction callback.
74
+
75
+ ## Documentation
76
+
77
+ - [Quickstart](docs/quickstart.md)
78
+ - [Usage guide](docs/usage.md)
79
+ - [API reference](docs/api.md)
80
+ - [Architecture](docs/architecture.md)
81
+ - [Testing](docs/testing.md)
82
+
83
+ ## Contributing
84
+
85
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and workflow.
@@ -0,0 +1,89 @@
1
+ # AUTO GENERATED FILE - DO NOT EDIT
2
+
3
+ import typing # noqa: F401
4
+ from typing_extensions import TypedDict, NotRequired, Literal # noqa: F401
5
+ from dash.development.base_component import Component, _explicitize_args
6
+ try:
7
+ from dash.types import NumberType # noqa: F401
8
+ except ImportError:
9
+ # Backwards compatibility for dash<=4.1.0
10
+ if typing.TYPE_CHECKING:
11
+ raise
12
+ NumberType = typing.Union[ # noqa: F401
13
+ typing.SupportsFloat, typing.SupportsInt, typing.SupportsComplex
14
+ ]
15
+
16
+ ComponentSingleType = typing.Union[str, int, float, Component, None]
17
+ ComponentType = typing.Union[
18
+ ComponentSingleType,
19
+ typing.Sequence[ComponentSingleType],
20
+ ]
21
+
22
+
23
+ class DrawInteraction(Component):
24
+ """A DrawInteraction component.
25
+ Draw and validate OpenLayers features, then publish their serialized geometry to Dash.
26
+
27
+ Keyword arguments:
28
+
29
+ - id (string; optional):
30
+ The ID used to identify this component in Dash callbacks.
31
+
32
+ - geometryType (a value equal to: 'Point', 'LineString', 'Polygon', 'Circle'; default 'Polygon'):
33
+ Geometry type drawn by this interaction.
34
+
35
+ - drawnGeoJSON (dict; optional):
36
+ Read-only GeoJSON Feature emitted only when geometry validation
37
+ succeeds.
38
+
39
+ - drawnWKT (string; optional):
40
+ Read-only WKT geometry emitted only when geometry validation
41
+ succeeds.
42
+
43
+ - drawnTopoJSON (dict; optional):
44
+ Read-only TopoJSON topology emitted only when geometry validation
45
+ succeeds.
46
+
47
+ - geometryValidation (dict; optional):
48
+ Read-only validity, topology errors, and repair suggestions from
49
+ the last draw.
50
+
51
+ - snapToVertex (boolean; default True):
52
+ Whether drawing snaps to existing vector vertices.
53
+
54
+ - snapToEdge (boolean; default True):
55
+ Whether drawing snaps to existing vector edges.
56
+
57
+ - snapTolerance (number; default 10):
58
+ Maximum snap distance in screen pixels."""
59
+ _children_props: typing.List[str] = []
60
+ _base_nodes = ['children']
61
+ _namespace = 'dash_openlayers'
62
+ _type = 'DrawInteraction'
63
+
64
+
65
+ def __init__(
66
+ self,
67
+ id: typing.Optional[typing.Union[str, dict]] = None,
68
+ geometryType: typing.Optional[Literal["Point", "LineString", "Polygon", "Circle"]] = None,
69
+ drawnGeoJSON: typing.Optional[dict] = None,
70
+ drawnWKT: typing.Optional[str] = None,
71
+ drawnTopoJSON: typing.Optional[dict] = None,
72
+ geometryValidation: typing.Optional[dict] = None,
73
+ snapToVertex: typing.Optional[bool] = None,
74
+ snapToEdge: typing.Optional[bool] = None,
75
+ snapTolerance: typing.Optional[NumberType] = None,
76
+ **kwargs
77
+ ):
78
+ self._prop_names = ['id', 'geometryType', 'drawnGeoJSON', 'drawnWKT', 'drawnTopoJSON', 'geometryValidation', 'snapToVertex', 'snapToEdge', 'snapTolerance']
79
+ self._valid_wildcard_attributes = []
80
+ self.available_properties = ['id', 'geometryType', 'drawnGeoJSON', 'drawnWKT', 'drawnTopoJSON', 'geometryValidation', 'snapToVertex', 'snapToEdge', 'snapTolerance']
81
+ self.available_wildcard_properties = []
82
+ _explicit_args = kwargs.pop('_explicit_args')
83
+ _locals = locals()
84
+ _locals.update(kwargs) # For wildcard attrs and excess named props
85
+ args = {k: _locals[k] for k in _explicit_args}
86
+
87
+ super(DrawInteraction, self).__init__(**args)
88
+
89
+ setattr(DrawInteraction, "__init__", _explicitize_args(DrawInteraction.__init__))
@@ -0,0 +1,66 @@
1
+ # AUTO GENERATED FILE - DO NOT EDIT
2
+
3
+ import typing # noqa: F401
4
+ from typing_extensions import TypedDict, NotRequired, Literal # noqa: F401
5
+ from dash.development.base_component import Component, _explicitize_args
6
+ try:
7
+ from dash.types import NumberType # noqa: F401
8
+ except ImportError:
9
+ # Backwards compatibility for dash<=4.1.0
10
+ if typing.TYPE_CHECKING:
11
+ raise
12
+ NumberType = typing.Union[ # noqa: F401
13
+ typing.SupportsFloat, typing.SupportsInt, typing.SupportsComplex
14
+ ]
15
+
16
+ ComponentSingleType = typing.Union[str, int, float, Component, None]
17
+ ComponentType = typing.Union[
18
+ ComponentSingleType,
19
+ typing.Sequence[ComponentSingleType],
20
+ ]
21
+
22
+
23
+ class ImageWMS(Component):
24
+ """An ImageWMS component.
25
+ Render a single-image OGC Web Map Service layer.
26
+
27
+ Keyword arguments:
28
+
29
+ - id (string; optional):
30
+ Component ID used to identify this layer in the Dash layout.
31
+
32
+ - url (string; optional):
33
+ OGC WMS endpoint URL.
34
+
35
+ - params (dict; optional):
36
+ WMS request parameters, including LAYERS; changes refresh the
37
+ source.
38
+
39
+ - serverType (a value equal to: 'carmentaserver', 'geoserver', 'mapserver', 'qgis'; optional):
40
+ WMS server type used for vendor-specific HiDPI request parameters."""
41
+ _children_props: typing.List[str] = []
42
+ _base_nodes = ['children']
43
+ _namespace = 'dash_openlayers'
44
+ _type = 'ImageWMS'
45
+
46
+
47
+ def __init__(
48
+ self,
49
+ id: typing.Optional[typing.Union[str, dict]] = None,
50
+ url: typing.Optional[str] = None,
51
+ params: typing.Optional[dict] = None,
52
+ serverType: typing.Optional[Literal["carmentaserver", "geoserver", "mapserver", "qgis"]] = None,
53
+ **kwargs
54
+ ):
55
+ self._prop_names = ['id', 'url', 'params', 'serverType']
56
+ self._valid_wildcard_attributes = []
57
+ self.available_properties = ['id', 'url', 'params', 'serverType']
58
+ self.available_wildcard_properties = []
59
+ _explicit_args = kwargs.pop('_explicit_args')
60
+ _locals = locals()
61
+ _locals.update(kwargs) # For wildcard attrs and excess named props
62
+ args = {k: _locals[k] for k in _explicit_args}
63
+
64
+ super(ImageWMS, self).__init__(**args)
65
+
66
+ setattr(ImageWMS, "__init__", _explicitize_args(ImageWMS.__init__))
@@ -0,0 +1,61 @@
1
+ # AUTO GENERATED FILE - DO NOT EDIT
2
+
3
+ import typing # noqa: F401
4
+ from typing_extensions import TypedDict, NotRequired, Literal # noqa: F401
5
+ from dash.development.base_component import Component, _explicitize_args
6
+ try:
7
+ from dash.types import NumberType # noqa: F401
8
+ except ImportError:
9
+ # Backwards compatibility for dash<=4.1.0
10
+ if typing.TYPE_CHECKING:
11
+ raise
12
+ NumberType = typing.Union[ # noqa: F401
13
+ typing.SupportsFloat, typing.SupportsInt, typing.SupportsComplex
14
+ ]
15
+
16
+ ComponentSingleType = typing.Union[str, int, float, Component, None]
17
+ ComponentType = typing.Union[
18
+ ComponentSingleType,
19
+ typing.Sequence[ComponentSingleType],
20
+ ]
21
+
22
+
23
+ class LayerControl(Component):
24
+ """A LayerControl component.
25
+ Layer visibility, opacity, and stacking-order controls for map layers.
26
+
27
+ Keyword arguments:
28
+
29
+ - id (string; optional):
30
+ The ID used to identify this component in Dash callbacks.
31
+
32
+ - position (a value equal to: 'top-left', 'top-right', 'bottom-left', 'bottom-right'; default 'top-right'):
33
+ Corner of the map where the control is displayed.
34
+
35
+ - title (string; default 'Layers'):
36
+ Heading displayed above the layer controls."""
37
+ _children_props: typing.List[str] = []
38
+ _base_nodes = ['children']
39
+ _namespace = 'dash_openlayers'
40
+ _type = 'LayerControl'
41
+
42
+
43
+ def __init__(
44
+ self,
45
+ id: typing.Optional[typing.Union[str, dict]] = None,
46
+ position: typing.Optional[Literal["top-left", "top-right", "bottom-left", "bottom-right"]] = None,
47
+ title: typing.Optional[str] = None,
48
+ **kwargs
49
+ ):
50
+ self._prop_names = ['id', 'position', 'title']
51
+ self._valid_wildcard_attributes = []
52
+ self.available_properties = ['id', 'position', 'title']
53
+ self.available_wildcard_properties = []
54
+ _explicit_args = kwargs.pop('_explicit_args')
55
+ _locals = locals()
56
+ _locals.update(kwargs) # For wildcard attrs and excess named props
57
+ args = {k: _locals[k] for k in _explicit_args}
58
+
59
+ super(LayerControl, self).__init__(**args)
60
+
61
+ setattr(LayerControl, "__init__", _explicitize_args(LayerControl.__init__))
@@ -0,0 +1,111 @@
1
+ # AUTO GENERATED FILE - DO NOT EDIT
2
+
3
+ import typing # noqa: F401
4
+ from typing_extensions import TypedDict, NotRequired, Literal # noqa: F401
5
+ from dash.development.base_component import Component, _explicitize_args
6
+ try:
7
+ from dash.types import NumberType # noqa: F401
8
+ except ImportError:
9
+ # Backwards compatibility for dash<=4.1.0
10
+ if typing.TYPE_CHECKING:
11
+ raise
12
+ NumberType = typing.Union[ # noqa: F401
13
+ typing.SupportsFloat, typing.SupportsInt, typing.SupportsComplex
14
+ ]
15
+
16
+ ComponentSingleType = typing.Union[str, int, float, Component, None]
17
+ ComponentType = typing.Union[
18
+ ComponentSingleType,
19
+ typing.Sequence[ComponentSingleType],
20
+ ]
21
+
22
+
23
+ class Map(Component):
24
+ """A Map component.
25
+ Create an OpenLayers map and synchronize its view and click events with Dash.
26
+
27
+ Keyword arguments:
28
+
29
+ - id (string; optional):
30
+ The ID used to identify this component in Dash callbacks.
31
+
32
+ - children (a list of or a singular dash component, string or number; optional):
33
+ OpenLayers layer and interaction components rendered inside this
34
+ map.
35
+
36
+ - center (list of numbers; default [0, 0]):
37
+ Map view center as [x, y] in projection units; bidirectional with
38
+ the rendered view.
39
+
40
+ - zoom (number; default 2):
41
+ Map zoom level; bidirectional with the rendered view.
42
+
43
+ - projection (string; default 'EPSG:3857'):
44
+ EPSG code used for the map view.
45
+
46
+ - proj4Defs (list of dicts; optional):
47
+ Custom proj4 definitions registered before the map view is
48
+ created.
49
+
50
+ `proj4Defs` is a list of dicts with keys:
51
+
52
+ - code (string; required)
53
+
54
+ - def (string; required)
55
+
56
+ - clickData (dict; optional):
57
+ Read-only click position with raw projected coordinates and
58
+ [latitude, longitude].
59
+
60
+ - undo (number; default 0):
61
+ Increment to undo the latest Draw or Modify operation.
62
+
63
+ - redo (number; default 0):
64
+ Increment to redo the latest undone operation.
65
+
66
+ - canUndo (boolean; optional):
67
+ Read-only; whether an operation is available to undo.
68
+
69
+ - canRedo (boolean; optional):
70
+ Read-only; whether an operation is available to redo."""
71
+ _children_props: typing.List[str] = []
72
+ _base_nodes = ['children']
73
+ _namespace = 'dash_openlayers'
74
+ _type = 'Map'
75
+ Proj4Defs = TypedDict(
76
+ "Proj4Defs",
77
+ {
78
+ "code": str,
79
+ "def": str
80
+ }
81
+ )
82
+
83
+
84
+ def __init__(
85
+ self,
86
+ children: typing.Optional[ComponentType] = None,
87
+ id: typing.Optional[typing.Union[str, dict]] = None,
88
+ center: typing.Optional[typing.Sequence[NumberType]] = None,
89
+ zoom: typing.Optional[NumberType] = None,
90
+ projection: typing.Optional[str] = None,
91
+ proj4Defs: typing.Optional[typing.Sequence["Proj4Defs"]] = None,
92
+ style: typing.Optional[typing.Any] = None,
93
+ clickData: typing.Optional[dict] = None,
94
+ undo: typing.Optional[NumberType] = None,
95
+ redo: typing.Optional[NumberType] = None,
96
+ canUndo: typing.Optional[bool] = None,
97
+ canRedo: typing.Optional[bool] = None,
98
+ **kwargs
99
+ ):
100
+ self._prop_names = ['id', 'children', 'center', 'zoom', 'projection', 'proj4Defs', 'style', 'clickData', 'undo', 'redo', 'canUndo', 'canRedo']
101
+ self._valid_wildcard_attributes = []
102
+ self.available_properties = ['id', 'children', 'center', 'zoom', 'projection', 'proj4Defs', 'style', 'clickData', 'undo', 'redo', 'canUndo', 'canRedo']
103
+ self.available_wildcard_properties = []
104
+ _explicit_args = kwargs.pop('_explicit_args')
105
+ _locals = locals()
106
+ _locals.update(kwargs) # For wildcard attrs and excess named props
107
+ args = {k: _locals[k] for k in _explicit_args if k != 'children'}
108
+
109
+ super(Map, self).__init__(children=children, **args)
110
+
111
+ setattr(Map, "__init__", _explicitize_args(Map.__init__))
@@ -0,0 +1,93 @@
1
+ # AUTO GENERATED FILE - DO NOT EDIT
2
+
3
+ import typing # noqa: F401
4
+ from typing_extensions import TypedDict, NotRequired, Literal # noqa: F401
5
+ from dash.development.base_component import Component, _explicitize_args
6
+ try:
7
+ from dash.types import NumberType # noqa: F401
8
+ except ImportError:
9
+ # Backwards compatibility for dash<=4.1.0
10
+ if typing.TYPE_CHECKING:
11
+ raise
12
+ NumberType = typing.Union[ # noqa: F401
13
+ typing.SupportsFloat, typing.SupportsInt, typing.SupportsComplex
14
+ ]
15
+
16
+ ComponentSingleType = typing.Union[str, int, float, Component, None]
17
+ ComponentType = typing.Union[
18
+ ComponentSingleType,
19
+ typing.Sequence[ComponentSingleType],
20
+ ]
21
+
22
+
23
+ class ModifyInteraction(Component):
24
+ """A ModifyInteraction component.
25
+ Allow editing vertices in a VectorLayer and report the updated features.
26
+
27
+ Keyword arguments:
28
+
29
+ - id (string; optional):
30
+ The ID used to identify this component in Dash callbacks.
31
+
32
+ - layerId (string; optional):
33
+ Dash ID of the VectorLayer to modify; defaults to the first vector
34
+ layer on the map.
35
+
36
+ - snapToVertex (boolean; default True):
37
+ Whether editing snaps to vector vertices.
38
+
39
+ - snapToEdge (boolean; default True):
40
+ Whether editing snaps to vector edges.
41
+
42
+ - snapTolerance (number; default 10):
43
+ Maximum snap distance in screen pixels.
44
+
45
+ - preserveTopology (boolean; default True):
46
+ Revert polygon edits that introduce invalid topology.
47
+
48
+ - modifiedGeoJSON (dict; optional):
49
+ Read-only: GeoJSON FeatureCollection of the target layer after a
50
+ modify operation.
51
+
52
+ - modifiedWKT (string; optional):
53
+ Read-only: WKT geometry collection of the target layer after
54
+ modification.
55
+
56
+ - modifiedTopoJSON (dict; optional):
57
+ Read-only: TopoJSON topology of the target layer after
58
+ modification.
59
+
60
+ - geometryValidation (dict; optional):
61
+ Read-only: topology validation result from the last modification."""
62
+ _children_props: typing.List[str] = []
63
+ _base_nodes = ['children']
64
+ _namespace = 'dash_openlayers'
65
+ _type = 'ModifyInteraction'
66
+
67
+
68
+ def __init__(
69
+ self,
70
+ id: typing.Optional[typing.Union[str, dict]] = None,
71
+ layerId: typing.Optional[str] = None,
72
+ snapToVertex: typing.Optional[bool] = None,
73
+ snapToEdge: typing.Optional[bool] = None,
74
+ snapTolerance: typing.Optional[NumberType] = None,
75
+ preserveTopology: typing.Optional[bool] = None,
76
+ modifiedGeoJSON: typing.Optional[dict] = None,
77
+ modifiedWKT: typing.Optional[str] = None,
78
+ modifiedTopoJSON: typing.Optional[dict] = None,
79
+ geometryValidation: typing.Optional[dict] = None,
80
+ **kwargs
81
+ ):
82
+ self._prop_names = ['id', 'layerId', 'snapToVertex', 'snapToEdge', 'snapTolerance', 'preserveTopology', 'modifiedGeoJSON', 'modifiedWKT', 'modifiedTopoJSON', 'geometryValidation']
83
+ self._valid_wildcard_attributes = []
84
+ self.available_properties = ['id', 'layerId', 'snapToVertex', 'snapToEdge', 'snapTolerance', 'preserveTopology', 'modifiedGeoJSON', 'modifiedWKT', 'modifiedTopoJSON', 'geometryValidation']
85
+ self.available_wildcard_properties = []
86
+ _explicit_args = kwargs.pop('_explicit_args')
87
+ _locals = locals()
88
+ _locals.update(kwargs) # For wildcard attrs and excess named props
89
+ args = {k: _locals[k] for k in _explicit_args}
90
+
91
+ super(ModifyInteraction, self).__init__(**args)
92
+
93
+ setattr(ModifyInteraction, "__init__", _explicitize_args(ModifyInteraction.__init__))