cone.maps 0.2__tar.gz → 1.1.0__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.
- cone_maps-1.1.0/.gitignore +14 -0
- cone_maps-1.1.0/CHANGES.rst +45 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/LICENSE.rst +1 -1
- {cone_maps-0.2 → cone_maps-1.1.0}/PKG-INFO +70 -32
- {cone_maps-0.2 → cone_maps-1.1.0}/README.rst +20 -6
- cone_maps-1.1.0/pyproject.toml +67 -0
- cone_maps-1.1.0/src/cone/maps/__init__.py +20 -0
- cone_maps-1.1.0/src/cone/maps/browser/__init__.py +203 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/map.py +73 -39
- cone_maps-1.1.0/src/cone/maps/browser/static/leaflet-editable/Leaflet.Editable.js +1946 -0
- cone_maps-1.1.0/src/cone/maps/browser/static/leaflet-pathdrag/Path.Drag.js +138 -0
- {cone_maps-0.2/src/cone/maps/browser/static → cone_maps-1.1.0/src/cone/maps/browser/static/maps}/cone.maps.js +48 -31
- cone_maps-1.1.0/src/cone/maps/browser/static/maps/cone.maps.min.js +1 -0
- cone_maps-1.1.0/src/cone/maps/locale/de/LC_MESSAGES/cone.maps.po +0 -0
- cone_maps-1.1.0/src/cone/maps/locale/en/LC_MESSAGES/cone.maps.po +0 -0
- cone_maps-1.1.0/src/cone/maps/tests/test_maps.py +319 -0
- cone_maps-0.2/CHANGES.rst +0 -15
- cone_maps-0.2/MANIFEST.in +0 -5
- cone_maps-0.2/setup.cfg +0 -4
- cone_maps-0.2/setup.py +0 -56
- cone_maps-0.2/src/cone/__init__.py +0 -1
- cone_maps-0.2/src/cone/maps/__init__.py +0 -64
- cone_maps-0.2/src/cone/maps/browser/__init__.py +0 -4
- cone_maps-0.2/src/cone/maps/browser/static/cone.maps.min.js +0 -1
- cone_maps-0.2/src/cone/maps/tests.py +0 -54
- cone_maps-0.2/src/cone.maps.egg-info/PKG-INFO +0 -179
- cone_maps-0.2/src/cone.maps.egg-info/SOURCES.txt +0 -45
- cone_maps-0.2/src/cone.maps.egg-info/dependency_links.txt +0 -1
- cone_maps-0.2/src/cone.maps.egg-info/namespace_packages.txt +0 -1
- cone_maps-0.2/src/cone.maps.egg-info/not-zip-safe +0 -1
- cone_maps-0.2/src/cone.maps.egg-info/requires.txt +0 -6
- cone_maps-0.2/src/cone.maps.egg-info/top_level.txt +0 -1
- {cone_maps-0.2 → cone_maps-1.1.0}/LICENSE_LEAFLET.rst +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet/images/layers-2x.png +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet/images/layers.png +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet/images/marker-icon-2x.png +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet/images/marker-icon.png +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet/images/marker-shadow.png +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet/leaflet-src.js +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet/leaflet-src.js.map +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet/leaflet.css +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet/leaflet.js +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet/leaflet.js.map +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet-activearea/leaflet.activearea.js +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet-geosearch/geosearch.css +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet-geosearch/geosearch.umd.js +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet-geosearch/geosearch.umd.js.map +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet-markercluster/MarkerCluster.Default.css +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet-markercluster/MarkerCluster.css +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet-markercluster/leaflet.markercluster-src.js +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet-markercluster/leaflet.markercluster-src.js.map +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet-markercluster/leaflet.markercluster.js +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet-markercluster/leaflet.markercluster.js.map +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet-nogap/L.TileLayer.NoGap.js +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/leaflet-proj4/proj4leaflet.js +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/proj4js/proj4-src.js +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/browser/static/proj4js/proj4.js +0 -0
- {cone_maps-0.2 → cone_maps-1.1.0}/src/cone/maps/locale/cone.maps.pot +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Changes
|
|
2
|
+
=======
|
|
3
|
+
|
|
4
|
+
1.1.0 (2026-02-03)
|
|
5
|
+
------------------
|
|
6
|
+
|
|
7
|
+
- Refactor package layout to use ``pyproject.toml`` and implicit namespace packages.
|
|
8
|
+
[rnix]
|
|
9
|
+
|
|
10
|
+
- Setup Makefile.
|
|
11
|
+
[lenadax]
|
|
12
|
+
|
|
13
|
+
- Run tests with pytest.
|
|
14
|
+
[lenadax]
|
|
15
|
+
|
|
16
|
+
- Add ``Path.Drag.js`` to resources.
|
|
17
|
+
[rnix]
|
|
18
|
+
|
|
19
|
+
- Add ``Leaflet.Editable`` to resources.
|
|
20
|
+
[rnix]
|
|
21
|
+
|
|
22
|
+
- Map settings are defined via ``MapTile.map_settings`` property.
|
|
23
|
+
[rnix]
|
|
24
|
+
|
|
25
|
+
- Map settings gets rendered as single data attribute.
|
|
26
|
+
[rnix]
|
|
27
|
+
|
|
28
|
+
- Add ``MapTile.map_bounds`` property.
|
|
29
|
+
[rnix]
|
|
30
|
+
|
|
31
|
+
- Fix control layers creation in ``Map.create_controls``.
|
|
32
|
+
[rnix]
|
|
33
|
+
|
|
34
|
+
- Implement map markers from JSON source.
|
|
35
|
+
[rnix]
|
|
36
|
+
|
|
37
|
+
- Implement static map markers.
|
|
38
|
+
[rnix]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
0.1 (2021-11-21)
|
|
42
|
+
----------------
|
|
43
|
+
|
|
44
|
+
- Initial release.
|
|
45
|
+
[rnix]
|
|
@@ -1,33 +1,27 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cone.maps
|
|
3
|
-
Version: 0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: Maps integration into cone using leaflet.js.
|
|
5
|
-
|
|
6
|
-
Author: Cone Contributors
|
|
7
|
-
Author-email: dev@conestack.org
|
|
5
|
+
Project-URL: Homepage, http://github.com/conestack/cone.maps
|
|
6
|
+
Author-email: Cone Contributors <dev@conestack.org>
|
|
8
7
|
License: Simplified BSD
|
|
9
|
-
|
|
8
|
+
License-File: LICENSE.rst
|
|
9
|
+
License-File: LICENSE_LEAFLET.rst
|
|
10
|
+
Keywords: cone,node,pyramid,web
|
|
10
11
|
Classifier: Environment :: Web Environment
|
|
11
12
|
Classifier: Programming Language :: Python
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
12
18
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Requires-Dist:
|
|
16
|
-
Requires-Dist: cone.app<1.1.0
|
|
17
|
-
Requires-Dist: yafowil.widget.location<2.0.0
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Requires-Dist: cone-app>1.0.99
|
|
21
|
+
Requires-Dist: yafowil-widget-location>1.99
|
|
18
22
|
Provides-Extra: test
|
|
19
|
-
Requires-Dist:
|
|
20
|
-
|
|
21
|
-
Dynamic: author-email
|
|
22
|
-
Dynamic: classifier
|
|
23
|
-
Dynamic: description
|
|
24
|
-
Dynamic: home-page
|
|
25
|
-
Dynamic: keywords
|
|
26
|
-
Dynamic: license
|
|
27
|
-
Dynamic: license-file
|
|
28
|
-
Dynamic: provides-extra
|
|
29
|
-
Dynamic: requires-dist
|
|
30
|
-
Dynamic: summary
|
|
23
|
+
Requires-Dist: cone-app[test]; extra == 'test'
|
|
24
|
+
Description-Content-Type: text/x-rst
|
|
31
25
|
|
|
32
26
|
.. image:: https://img.shields.io/pypi/v/cone.maps.svg
|
|
33
27
|
:target: https://pypi.python.org/pypi/cone.maps
|
|
@@ -37,12 +31,9 @@ Dynamic: summary
|
|
|
37
31
|
:target: https://pypi.python.org/pypi/cone.maps
|
|
38
32
|
:alt: Number of PyPI downloads
|
|
39
33
|
|
|
40
|
-
.. image:: https://github.com/conestack/cone.maps/actions/workflows/
|
|
41
|
-
:target: https://github.com/conestack/cone.maps/actions/workflows/
|
|
42
|
-
:alt:
|
|
43
|
-
|
|
44
|
-
.. image:: https://coveralls.io/repos/github/bluedynamics/cone.maps/badge.svg?branch=master
|
|
45
|
-
:target: https://coveralls.io/github/bluedynamics/cone.maps?branch=master
|
|
34
|
+
.. image:: https://github.com/conestack/cone.maps/actions/workflows/test.yml/badge.svg
|
|
35
|
+
:target: https://github.com/conestack/cone.maps/actions/workflows/test.yml
|
|
36
|
+
:alt: Test cone.maps
|
|
46
37
|
|
|
47
38
|
|
|
48
39
|
This package provides maps integration in to cone.app.
|
|
@@ -61,6 +52,14 @@ This package provides maps integration in to cone.app.
|
|
|
61
52
|
`Leaflet.markercluster <https://github.com/Leaflet/Leaflet.markercluster>`_
|
|
62
53
|
(1.5.3) is included.
|
|
63
54
|
|
|
55
|
+
* For making geometries editable in Leaflet,
|
|
56
|
+
`Leaflet.Editable <https://github.com/Leaflet/Leaflet.Editable>`_
|
|
57
|
+
(1.2.0) is included.
|
|
58
|
+
|
|
59
|
+
* For adding dragging capability to Leaflet paths,
|
|
60
|
+
`Path.Drag.js <https://github.com/Leaflet/Path.Drag.js>`_
|
|
61
|
+
(0.0.6) is included.
|
|
62
|
+
|
|
64
63
|
* For defining active map area, e.g. if parts of a map is used as background,
|
|
65
64
|
`Leaflet-active-area <https://github.com/Mappy/Leaflet-active-area>`_
|
|
66
65
|
(1.2.0) is included.
|
|
@@ -88,6 +87,9 @@ can be used as starting point for complex custom maps.
|
|
|
88
87
|
"""See ``cone.maps.browser.map`` for available tile options.
|
|
89
88
|
"""
|
|
90
89
|
|
|
90
|
+
Not that ``cone.maps`` defines by default no height for maps. This must be
|
|
91
|
+
done explicitely using CSS, or via custom JS map class.
|
|
92
|
+
|
|
91
93
|
|
|
92
94
|
Resources
|
|
93
95
|
---------
|
|
@@ -107,6 +109,12 @@ available :
|
|
|
107
109
|
- **cone.maps.markercluster**: Flag whether to include ``Leaflet.markercluster``
|
|
108
110
|
plugin. Defaults to `false`.
|
|
109
111
|
|
|
112
|
+
- **cone.maps.editable**: Flag whether to include ``Leaflet.Editable`` plugin.
|
|
113
|
+
Defaults to `false`.
|
|
114
|
+
|
|
115
|
+
- **cone.maps.pathdrag**: Flag whether to include ``Path.Drag.js`` plugin.
|
|
116
|
+
Defaults to `false`.
|
|
117
|
+
|
|
110
118
|
- **cone.maps.activearea**: Flag whether to include ``Leaflet-active-area``
|
|
111
119
|
plugin. Defaults to `false`.
|
|
112
120
|
|
|
@@ -137,10 +145,40 @@ TODO
|
|
|
137
145
|
Changes
|
|
138
146
|
=======
|
|
139
147
|
|
|
140
|
-
0
|
|
141
|
-
|
|
148
|
+
1.1.0 (2026-02-03)
|
|
149
|
+
------------------
|
|
150
|
+
|
|
151
|
+
- Refactor package layout to use ``pyproject.toml`` and implicit namespace packages.
|
|
152
|
+
[rnix]
|
|
153
|
+
|
|
154
|
+
- Setup Makefile.
|
|
155
|
+
[lenadax]
|
|
156
|
+
|
|
157
|
+
- Run tests with pytest.
|
|
158
|
+
[lenadax]
|
|
159
|
+
|
|
160
|
+
- Add ``Path.Drag.js`` to resources.
|
|
161
|
+
[rnix]
|
|
162
|
+
|
|
163
|
+
- Add ``Leaflet.Editable`` to resources.
|
|
164
|
+
[rnix]
|
|
165
|
+
|
|
166
|
+
- Map settings are defined via ``MapTile.map_settings`` property.
|
|
167
|
+
[rnix]
|
|
168
|
+
|
|
169
|
+
- Map settings gets rendered as single data attribute.
|
|
170
|
+
[rnix]
|
|
171
|
+
|
|
172
|
+
- Add ``MapTile.map_bounds`` property.
|
|
173
|
+
[rnix]
|
|
174
|
+
|
|
175
|
+
- Fix control layers creation in ``Map.create_controls``.
|
|
176
|
+
[rnix]
|
|
177
|
+
|
|
178
|
+
- Implement map markers from JSON source.
|
|
179
|
+
[rnix]
|
|
142
180
|
|
|
143
|
-
-
|
|
181
|
+
- Implement static map markers.
|
|
144
182
|
[rnix]
|
|
145
183
|
|
|
146
184
|
|
|
@@ -154,7 +192,7 @@ Changes
|
|
|
154
192
|
License
|
|
155
193
|
=======
|
|
156
194
|
|
|
157
|
-
Copyright (c) 2021, Cone Contributors
|
|
195
|
+
Copyright (c) 2021-2025, Cone Contributors
|
|
158
196
|
All rights reserved.
|
|
159
197
|
|
|
160
198
|
Redistribution and use in source and binary forms, with or without
|
|
@@ -6,12 +6,9 @@
|
|
|
6
6
|
:target: https://pypi.python.org/pypi/cone.maps
|
|
7
7
|
:alt: Number of PyPI downloads
|
|
8
8
|
|
|
9
|
-
.. image:: https://github.com/conestack/cone.maps/actions/workflows/
|
|
10
|
-
:target: https://github.com/conestack/cone.maps/actions/workflows/
|
|
11
|
-
:alt:
|
|
12
|
-
|
|
13
|
-
.. image:: https://coveralls.io/repos/github/bluedynamics/cone.maps/badge.svg?branch=master
|
|
14
|
-
:target: https://coveralls.io/github/bluedynamics/cone.maps?branch=master
|
|
9
|
+
.. image:: https://github.com/conestack/cone.maps/actions/workflows/test.yml/badge.svg
|
|
10
|
+
:target: https://github.com/conestack/cone.maps/actions/workflows/test.yml
|
|
11
|
+
:alt: Test cone.maps
|
|
15
12
|
|
|
16
13
|
|
|
17
14
|
This package provides maps integration in to cone.app.
|
|
@@ -30,6 +27,14 @@ This package provides maps integration in to cone.app.
|
|
|
30
27
|
`Leaflet.markercluster <https://github.com/Leaflet/Leaflet.markercluster>`_
|
|
31
28
|
(1.5.3) is included.
|
|
32
29
|
|
|
30
|
+
* For making geometries editable in Leaflet,
|
|
31
|
+
`Leaflet.Editable <https://github.com/Leaflet/Leaflet.Editable>`_
|
|
32
|
+
(1.2.0) is included.
|
|
33
|
+
|
|
34
|
+
* For adding dragging capability to Leaflet paths,
|
|
35
|
+
`Path.Drag.js <https://github.com/Leaflet/Path.Drag.js>`_
|
|
36
|
+
(0.0.6) is included.
|
|
37
|
+
|
|
33
38
|
* For defining active map area, e.g. if parts of a map is used as background,
|
|
34
39
|
`Leaflet-active-area <https://github.com/Mappy/Leaflet-active-area>`_
|
|
35
40
|
(1.2.0) is included.
|
|
@@ -57,6 +62,9 @@ can be used as starting point for complex custom maps.
|
|
|
57
62
|
"""See ``cone.maps.browser.map`` for available tile options.
|
|
58
63
|
"""
|
|
59
64
|
|
|
65
|
+
Not that ``cone.maps`` defines by default no height for maps. This must be
|
|
66
|
+
done explicitely using CSS, or via custom JS map class.
|
|
67
|
+
|
|
60
68
|
|
|
61
69
|
Resources
|
|
62
70
|
---------
|
|
@@ -76,6 +84,12 @@ available :
|
|
|
76
84
|
- **cone.maps.markercluster**: Flag whether to include ``Leaflet.markercluster``
|
|
77
85
|
plugin. Defaults to `false`.
|
|
78
86
|
|
|
87
|
+
- **cone.maps.editable**: Flag whether to include ``Leaflet.Editable`` plugin.
|
|
88
|
+
Defaults to `false`.
|
|
89
|
+
|
|
90
|
+
- **cone.maps.pathdrag**: Flag whether to include ``Path.Drag.js`` plugin.
|
|
91
|
+
Defaults to `false`.
|
|
92
|
+
|
|
79
93
|
- **cone.maps.activearea**: Flag whether to include ``Leaflet-active-area``
|
|
80
94
|
plugin. Defaults to `false`.
|
|
81
95
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling", "hatch-fancy-pypi-readme"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "cone.maps"
|
|
7
|
+
version = "1.1.0"
|
|
8
|
+
description = "Maps integration into cone using leaflet.js."
|
|
9
|
+
dynamic = ["readme"]
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = {text = "Simplified BSD"}
|
|
12
|
+
authors = [{name = "Cone Contributors", email = "dev@conestack.org"}]
|
|
13
|
+
keywords = ["node", "pyramid", "cone", "web"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Environment :: Web Environment",
|
|
16
|
+
"Programming Language :: Python",
|
|
17
|
+
"Programming Language :: Python :: 3.10",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"Programming Language :: Python :: 3.13",
|
|
21
|
+
"Programming Language :: Python :: 3.14",
|
|
22
|
+
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
|
|
23
|
+
]
|
|
24
|
+
dependencies = [
|
|
25
|
+
"cone.app>1.0.99",
|
|
26
|
+
"yafowil.widget.location>1.99",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.optional-dependencies]
|
|
30
|
+
test = [
|
|
31
|
+
"cone.app[test]",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Homepage = "http://github.com/conestack/cone.maps"
|
|
36
|
+
|
|
37
|
+
[tool.hatch.metadata.hooks.fancy-pypi-readme]
|
|
38
|
+
content-type = "text/x-rst"
|
|
39
|
+
fragments = [
|
|
40
|
+
{path = "README.rst"},
|
|
41
|
+
{text = "\n\n"},
|
|
42
|
+
{path = "CHANGES.rst"},
|
|
43
|
+
{text = "\n\n"},
|
|
44
|
+
{path = "LICENSE.rst"},
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[tool.hatch.build.targets.sdist]
|
|
48
|
+
exclude = [
|
|
49
|
+
"/.github/",
|
|
50
|
+
"/js/",
|
|
51
|
+
"/Makefile",
|
|
52
|
+
"/mx.ini",
|
|
53
|
+
"/package.json",
|
|
54
|
+
"/pnpm-lock.yaml",
|
|
55
|
+
"/scripts/",
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
[tool.hatch.build.targets.wheel]
|
|
59
|
+
packages = ["src/cone"]
|
|
60
|
+
|
|
61
|
+
[tool.pytest.ini_options]
|
|
62
|
+
consider_namespace_packages = true
|
|
63
|
+
addopts = ["--import-mode=importlib"]
|
|
64
|
+
pythonpath = "src"
|
|
65
|
+
|
|
66
|
+
[tool.zest-releaser]
|
|
67
|
+
create-wheel = true
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from cone.app import main_hook
|
|
2
|
+
from cone.maps.browser import configure_resources
|
|
3
|
+
import logging
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
logger = logging.getLogger('cone.maps')
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@main_hook
|
|
10
|
+
def initialize_maps(config, global_config, settings):
|
|
11
|
+
# application startup initialization
|
|
12
|
+
|
|
13
|
+
# static resources
|
|
14
|
+
configure_resources(config, settings)
|
|
15
|
+
|
|
16
|
+
# add translation
|
|
17
|
+
config.add_translation_dirs('cone.maps:locale/')
|
|
18
|
+
|
|
19
|
+
# scan browser package
|
|
20
|
+
config.scan('cone.maps.browser')
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import webresource as wr
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
resources_dir = os.path.join(os.path.dirname(__file__), 'static')
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# leaflet core
|
|
9
|
+
leaflet_resources = wr.ResourceGroup(
|
|
10
|
+
name='cone.maps-leaflet',
|
|
11
|
+
directory=os.path.join(resources_dir, 'leaflet'),
|
|
12
|
+
path='leaflet'
|
|
13
|
+
)
|
|
14
|
+
leaflet_resources.add(wr.ScriptResource(
|
|
15
|
+
name='leaflet-js',
|
|
16
|
+
resource='leaflet-src.js',
|
|
17
|
+
compressed='leaflet.js'
|
|
18
|
+
))
|
|
19
|
+
leaflet_resources.add(wr.StyleResource(
|
|
20
|
+
name='leaflet-css',
|
|
21
|
+
resource='leaflet.css'
|
|
22
|
+
))
|
|
23
|
+
|
|
24
|
+
# Leaflet.TileLayer.NoGap
|
|
25
|
+
leaflet_nogap_resources = wr.ResourceGroup(
|
|
26
|
+
name='cone.maps-leaflet-nogap',
|
|
27
|
+
directory=os.path.join(resources_dir, 'leaflet-nogap'),
|
|
28
|
+
path='leaflet-nogap'
|
|
29
|
+
)
|
|
30
|
+
leaflet_nogap_resources.add(wr.ScriptResource(
|
|
31
|
+
name='leaflet-nogap-js',
|
|
32
|
+
depends='leaflet-js',
|
|
33
|
+
resource='L.TileLayer.NoGap.js'
|
|
34
|
+
))
|
|
35
|
+
|
|
36
|
+
# leaflet-geosearch
|
|
37
|
+
leaflet_geosearch_resources = wr.ResourceGroup(
|
|
38
|
+
name='cone.maps-leaflet-geosearch',
|
|
39
|
+
directory=os.path.join(resources_dir, 'leaflet-geosearch'),
|
|
40
|
+
path='leaflet-geosearch'
|
|
41
|
+
)
|
|
42
|
+
leaflet_geosearch_resources.add(wr.ScriptResource(
|
|
43
|
+
name='leaflet-geosearch-js',
|
|
44
|
+
depends='leaflet-js',
|
|
45
|
+
resource='geosearch.umd.js'
|
|
46
|
+
))
|
|
47
|
+
leaflet_geosearch_resources.add(wr.StyleResource(
|
|
48
|
+
name='leaflet-geosearch-css',
|
|
49
|
+
depends='leaflet-css',
|
|
50
|
+
resource='geosearch.css'
|
|
51
|
+
))
|
|
52
|
+
|
|
53
|
+
# Leaflet.markercluster
|
|
54
|
+
leaflet_markercluster_resources = wr.ResourceGroup(
|
|
55
|
+
name='cone.maps-leaflet-markercluster',
|
|
56
|
+
directory=os.path.join(resources_dir, 'leaflet-markercluster'),
|
|
57
|
+
path='leaflet-markercluster'
|
|
58
|
+
)
|
|
59
|
+
leaflet_markercluster_resources.add(wr.ScriptResource(
|
|
60
|
+
name='leaflet-markercluster-js',
|
|
61
|
+
depends='leaflet-js',
|
|
62
|
+
resource='leaflet.markercluster-src.js',
|
|
63
|
+
compressed='leaflet.markercluster.js'
|
|
64
|
+
))
|
|
65
|
+
leaflet_markercluster_resources.add(wr.StyleResource(
|
|
66
|
+
name='leaflet-markercluster-css',
|
|
67
|
+
depends='leaflet-css',
|
|
68
|
+
resource='MarkerCluster.css'
|
|
69
|
+
))
|
|
70
|
+
leaflet_markercluster_resources.add(wr.StyleResource(
|
|
71
|
+
name='leaflet-markercluster-default-css',
|
|
72
|
+
depends='leaflet-markercluster-css',
|
|
73
|
+
resource='MarkerCluster.Default.css'
|
|
74
|
+
))
|
|
75
|
+
|
|
76
|
+
# Leaflet.Editable
|
|
77
|
+
leaflet_editable_resources = wr.ResourceGroup(
|
|
78
|
+
name='cone.maps-leaflet-editable',
|
|
79
|
+
directory=os.path.join(resources_dir, 'leaflet-editable'),
|
|
80
|
+
path='leaflet-editable'
|
|
81
|
+
)
|
|
82
|
+
leaflet_editable_resources.add(wr.ScriptResource(
|
|
83
|
+
name='leaflet-editable-js',
|
|
84
|
+
depends='leaflet-js',
|
|
85
|
+
resource='Leaflet.Editable.js'
|
|
86
|
+
))
|
|
87
|
+
|
|
88
|
+
# Leaflet Path.Drag.js
|
|
89
|
+
leaflet_pathdrag_resources = wr.ResourceGroup(
|
|
90
|
+
name='cone.maps-leaflet-pathdrag',
|
|
91
|
+
directory=os.path.join(resources_dir, 'leaflet-pathdrag'),
|
|
92
|
+
path='leaflet-pathdrag'
|
|
93
|
+
)
|
|
94
|
+
leaflet_pathdrag_resources.add(wr.ScriptResource(
|
|
95
|
+
name='leaflet-pathdrag-js',
|
|
96
|
+
depends='leaflet-js',
|
|
97
|
+
resource='Path.Drag.js'
|
|
98
|
+
))
|
|
99
|
+
|
|
100
|
+
# Leaflet-active-area
|
|
101
|
+
leaflet_activearea_resources = wr.ResourceGroup(
|
|
102
|
+
name='cone.maps-leaflet-activearea',
|
|
103
|
+
directory=os.path.join(resources_dir, 'leaflet-activearea'),
|
|
104
|
+
path='leaflet-activearea'
|
|
105
|
+
)
|
|
106
|
+
leaflet_activearea_resources.add(wr.ScriptResource(
|
|
107
|
+
name='leaflet-activearea-js',
|
|
108
|
+
depends='leaflet-js',
|
|
109
|
+
resource='leaflet.activearea.js'
|
|
110
|
+
))
|
|
111
|
+
|
|
112
|
+
# proj4js
|
|
113
|
+
proj4_resources = wr.ResourceGroup(
|
|
114
|
+
name='cone.maps-proj4',
|
|
115
|
+
directory=os.path.join(resources_dir, 'proj4js'),
|
|
116
|
+
path='proj4js'
|
|
117
|
+
)
|
|
118
|
+
proj4_resources.add(wr.ScriptResource(
|
|
119
|
+
name='proj4-js',
|
|
120
|
+
resource='proj4-src.js',
|
|
121
|
+
compressed='proj4.js'
|
|
122
|
+
))
|
|
123
|
+
|
|
124
|
+
# Proj4Leaflet
|
|
125
|
+
leaflet_proj4_resources = wr.ResourceGroup(
|
|
126
|
+
name='cone.maps-leaflet-proj4',
|
|
127
|
+
directory=os.path.join(resources_dir, 'leaflet-proj4'),
|
|
128
|
+
path='leaflet-proj4'
|
|
129
|
+
)
|
|
130
|
+
leaflet_proj4_resources.add(wr.ScriptResource(
|
|
131
|
+
name='leaflet-proj4-js',
|
|
132
|
+
depends=['leaflet-js', 'proj4-js'],
|
|
133
|
+
resource='proj4leaflet.js'
|
|
134
|
+
))
|
|
135
|
+
|
|
136
|
+
# cone maps
|
|
137
|
+
cone_maps_resources = wr.ResourceGroup(
|
|
138
|
+
name='cone.maps-maps',
|
|
139
|
+
directory=os.path.join(resources_dir, 'maps'),
|
|
140
|
+
path='maps'
|
|
141
|
+
)
|
|
142
|
+
cone_maps_resources.add(wr.ScriptResource(
|
|
143
|
+
name='cone-maps-js',
|
|
144
|
+
depends='leaflet-js',
|
|
145
|
+
resource='cone.maps.js',
|
|
146
|
+
compressed='cone.maps.min.js'
|
|
147
|
+
))
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def configure_resources(config, settings):
|
|
151
|
+
def included(name):
|
|
152
|
+
return settings.get(name, 'false') == 'true'
|
|
153
|
+
|
|
154
|
+
include = True if included('cone.maps.public') else 'authenticated'
|
|
155
|
+
|
|
156
|
+
# Leaflet core
|
|
157
|
+
config.register_resource(leaflet_resources)
|
|
158
|
+
config.set_resource_include('leaflet-js', include)
|
|
159
|
+
config.set_resource_include('leaflet-css', include)
|
|
160
|
+
|
|
161
|
+
# Leaflet.TileLayer.NoGap
|
|
162
|
+
config.register_resource(leaflet_nogap_resources)
|
|
163
|
+
nogap_include = include if included('cone.maps.nogap') else False
|
|
164
|
+
config.set_resource_include('leaflet-nogap-js', nogap_include)
|
|
165
|
+
|
|
166
|
+
# leaflet-geosearch
|
|
167
|
+
config.register_resource(leaflet_geosearch_resources)
|
|
168
|
+
geosearch_include = include if included('cone.maps.geosearch') else False
|
|
169
|
+
config.set_resource_include('leaflet-geosearch-js', geosearch_include)
|
|
170
|
+
config.set_resource_include('leaflet-geosearch-css', geosearch_include)
|
|
171
|
+
|
|
172
|
+
# Leaflet.markercluster
|
|
173
|
+
config.register_resource(leaflet_markercluster_resources)
|
|
174
|
+
mc_include = include if included('cone.maps.markercluster') else False
|
|
175
|
+
config.set_resource_include('leaflet-markercluster-js', mc_include)
|
|
176
|
+
config.set_resource_include('leaflet-markercluster-css', mc_include)
|
|
177
|
+
config.set_resource_include('leaflet-markercluster-default-css', mc_include)
|
|
178
|
+
|
|
179
|
+
# Leaflet.Editable
|
|
180
|
+
config.register_resource(leaflet_editable_resources)
|
|
181
|
+
editable_include = include if included('cone.maps.editable') else False
|
|
182
|
+
config.set_resource_include('leaflet-editable-js', editable_include)
|
|
183
|
+
|
|
184
|
+
# Leaflet Path.Drag.js
|
|
185
|
+
config.register_resource(leaflet_pathdrag_resources)
|
|
186
|
+
pathdrag_include = include if included('cone.maps.pathdrag') else False
|
|
187
|
+
config.set_resource_include('leaflet-pathdrag-js', pathdrag_include)
|
|
188
|
+
|
|
189
|
+
# Leaflet-active-area
|
|
190
|
+
config.register_resource(leaflet_activearea_resources)
|
|
191
|
+
activearea_include = include if included('cone.maps.activearea') else False
|
|
192
|
+
config.set_resource_include('leaflet-activearea-js', activearea_include)
|
|
193
|
+
|
|
194
|
+
# proj4js and Proj4Leaflet
|
|
195
|
+
config.register_resource(proj4_resources)
|
|
196
|
+
config.register_resource(leaflet_proj4_resources)
|
|
197
|
+
proj4_include = include if included('cone.maps.proj4') else False
|
|
198
|
+
config.set_resource_include('proj4-js', proj4_include)
|
|
199
|
+
config.set_resource_include('leaflet-proj4-js', proj4_include)
|
|
200
|
+
|
|
201
|
+
# cone maps
|
|
202
|
+
config.register_resource(cone_maps_resources)
|
|
203
|
+
config.set_resource_include('cone-maps-js', include)
|