odoo-addon-web-view-leaflet-map 16.0.2.0.0.1__py3-none-any.whl → 18.0.1.0.0.3__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.
- odoo/addons/web_view_leaflet_map/README.rst +74 -76
- odoo/addons/web_view_leaflet_map/__manifest__.py +4 -5
- odoo/addons/web_view_leaflet_map/hooks.py +4 -4
- odoo/addons/web_view_leaflet_map/i18n/fr.po +1 -0
- odoo/addons/web_view_leaflet_map/i18n/it.po +1 -0
- odoo/addons/web_view_leaflet_map/i18n/web_view_leaflet_map.pot +1 -8
- odoo/addons/web_view_leaflet_map/models/ir_ui_view.py +3 -0
- odoo/addons/web_view_leaflet_map/readme/CONFIGURE.md +1 -0
- odoo/addons/web_view_leaflet_map/readme/CONTRIBUTORS.md +1 -0
- odoo/addons/web_view_leaflet_map/readme/DESCRIPTION.md +13 -0
- odoo/addons/web_view_leaflet_map/readme/DEVELOP.md +53 -0
- odoo/addons/web_view_leaflet_map/readme/ROADMAP.md +8 -0
- odoo/addons/web_view_leaflet_map/static/description/index.html +82 -92
- odoo/addons/web_view_leaflet_map/static/src/components/map-component/map_view.esm.js +329 -0
- odoo/addons/web_view_leaflet_map/static/src/components/map-component/map_view.xml +19 -0
- {odoo_addon_web_view_leaflet_map-16.0.2.0.0.1.dist-info → odoo_addon_web_view_leaflet_map-18.0.1.0.0.3.dist-info}/METADATA +81 -82
- odoo_addon_web_view_leaflet_map-18.0.1.0.0.3.dist-info/RECORD +26 -0
- {odoo_addon_web_view_leaflet_map-16.0.2.0.0.1.dist-info → odoo_addon_web_view_leaflet_map-18.0.1.0.0.3.dist-info}/WHEEL +1 -1
- odoo_addon_web_view_leaflet_map-18.0.1.0.0.3.dist-info/top_level.txt +1 -0
- odoo/addons/web_view_leaflet_map/readme/CONFIGURE.rst +0 -1
- odoo/addons/web_view_leaflet_map/readme/CONTRIBUTORS.rst +0 -1
- odoo/addons/web_view_leaflet_map/readme/DESCRIPTION.rst +0 -11
- odoo/addons/web_view_leaflet_map/readme/DEVELOP.rst +0 -62
- odoo/addons/web_view_leaflet_map/readme/ROADMAP.rst +0 -8
- odoo/addons/web_view_leaflet_map/static/src/js/view/map/map_renderer.js +0 -178
- odoo/addons/web_view_leaflet_map/static/src/js/view/map/map_view.js +0 -34
- odoo/addons/web_view_leaflet_map/static/src/js/view/view_registry.js +0 -8
- odoo_addon_web_view_leaflet_map-16.0.2.0.0.1.dist-info/RECORD +0 -27
- odoo_addon_web_view_leaflet_map-16.0.2.0.0.1.dist-info/top_level.txt +0 -1
- /odoo/addons/web_view_leaflet_map/static/src/{css → components/map-component}/web_view_leaflet_map.css +0 -0
|
@@ -7,7 +7,7 @@ Leaflet Map View (OpenStreetMap)
|
|
|
7
7
|
!! This file is generated by oca-gen-addon-readme !!
|
|
8
8
|
!! changes will be overwritten. !!
|
|
9
9
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
10
|
-
!! source digest: sha256:
|
|
10
|
+
!! source digest: sha256:52ae60ed2032c73f0ba6fc8ca70e2a2fc73bb12745aeeda793042efb1175c1b9
|
|
11
11
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
12
|
|
|
13
13
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
|
|
@@ -17,28 +17,34 @@ Leaflet Map View (OpenStreetMap)
|
|
|
17
17
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
|
18
18
|
:alt: License: AGPL-3
|
|
19
19
|
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fgeospatial-lightgray.png?logo=github
|
|
20
|
-
:target: https://github.com/OCA/geospatial/tree/
|
|
20
|
+
:target: https://github.com/OCA/geospatial/tree/18.0/web_view_leaflet_map
|
|
21
21
|
:alt: OCA/geospatial
|
|
22
22
|
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
|
23
|
-
:target: https://translation.odoo-community.org/projects/geospatial-
|
|
23
|
+
:target: https://translation.odoo-community.org/projects/geospatial-18-0/geospatial-18-0-web_view_leaflet_map
|
|
24
24
|
:alt: Translate me on Weblate
|
|
25
25
|
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
|
26
|
-
:target: https://runboat.odoo-community.org/builds?repo=OCA/geospatial&target_branch=
|
|
26
|
+
:target: https://runboat.odoo-community.org/builds?repo=OCA/geospatial&target_branch=18.0
|
|
27
27
|
:alt: Try me on Runboat
|
|
28
28
|
|
|
29
29
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|
30
30
|
|
|
31
|
-
This module extends odoo views, to add a new kind of view, named
|
|
32
|
-
that is using the Leaflet javascript library to use
|
|
33
|
-
This library is for exemple, used in the
|
|
31
|
+
This module extends odoo views, to add a new kind of view, named
|
|
32
|
+
``leaflet_map`` that is using the Leaflet javascript library to use
|
|
33
|
+
maps. (https://leafletjs.com/) This library is for exemple, used in the
|
|
34
|
+
OpenStreetMap project. (https://www.openstreetmap.org/)
|
|
34
35
|
|
|
35
|
-
You can see a simple usage in the module
|
|
36
|
-
same OCA repository that
|
|
37
|
-
|
|
36
|
+
You can see a simple usage in the module
|
|
37
|
+
``web_view_leaflet_map_partner`` in the same OCA repository that
|
|
38
|
+
displays your contact in a map, if latitude and longitude are defined.
|
|
39
|
+
(To define latitude and longitude, refer to the Odoo module
|
|
40
|
+
``base_geolocalize``)
|
|
38
41
|
|
|
39
|
-
|
|
42
|
+
|image1|
|
|
40
43
|
|
|
41
|
-
|
|
44
|
+
|image2|
|
|
45
|
+
|
|
46
|
+
.. |image1| image:: https://raw.githubusercontent.com/OCA/geospatial/18.0/web_view_leaflet_map/static/description/view_res_partner_map_1.png
|
|
47
|
+
.. |image2| image:: https://raw.githubusercontent.com/OCA/geospatial/18.0/web_view_leaflet_map/static/description/view_res_partner_map_2.png
|
|
42
48
|
|
|
43
49
|
.. IMPORTANT::
|
|
44
50
|
This is an alpha version, the data model and design can change at any time without warning.
|
|
@@ -53,85 +59,77 @@ defined. (To define latitude and longitude, refer to the Odoo module ``base_geol
|
|
|
53
59
|
Configuration
|
|
54
60
|
=============
|
|
55
61
|
|
|
56
|
-
|
|
62
|
+
- See configuration of the module ``web_leaflet_lib``.
|
|
57
63
|
|
|
58
64
|
Development
|
|
59
65
|
===========
|
|
60
66
|
|
|
61
67
|
Create a new view :
|
|
62
68
|
|
|
63
|
-
.. code
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
1. FIELD_LATITUDE and FIELD_LONGITUDE are the name of the fields that
|
|
69
|
+
.. code:: xml
|
|
70
|
+
|
|
71
|
+
<record id="view_my_model_map" model="ir.ui.view">
|
|
72
|
+
<field name="model">my.model</field>
|
|
73
|
+
<field name="arch" type="xml">
|
|
74
|
+
<leaflet_map
|
|
75
|
+
field_latitude="FIELD_LATITUDE"
|
|
76
|
+
field_longitude="FIELD_LONGITUDE"
|
|
77
|
+
field_title="FIELD_TITLE"
|
|
78
|
+
field_address="FIELD_ADDRESS"
|
|
79
|
+
field_marker_icon_image="FIELD_MARKER_ICON_IMAGE"
|
|
80
|
+
>
|
|
81
|
+
<field name="__last_update"/>
|
|
82
|
+
<field name="FIELD_LATITUDE"/>
|
|
83
|
+
<field name="FIELD_LONGITUDE"/>
|
|
84
|
+
<field name="FIELD_TITLE"/>
|
|
85
|
+
<field name="FIELD_ADDRESS"/>
|
|
86
|
+
</leaflet_map>
|
|
87
|
+
</field>
|
|
88
|
+
</record>
|
|
89
|
+
|
|
90
|
+
1. FIELD_LATITUDE and FIELD_LONGITUDE are the name of the fields that
|
|
91
|
+
contains GPS coordinates of the model.
|
|
85
92
|
2. FIELD_TITLE will be used when the popup is displayed, as a title.
|
|
86
|
-
3. FIELD_ADDRESS will be used when the popup is displayed to display the
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
Note: You can set extra settings
|
|
90
|
-
|
|
91
|
-
the
|
|
93
|
+
3. FIELD_ADDRESS will be used when the popup is displayed to display the
|
|
94
|
+
adress.
|
|
95
|
+
4. (optional) FIELD_MARKER_ICON_IMAGE, is the name of the image field to
|
|
96
|
+
place as an icon of the marker. Note: You can set extra settings
|
|
97
|
+
``marker_icon_size_x``, ``marker_icon_size_y``, to define the size of
|
|
98
|
+
the image, and ``marker_popup_anchor_x``, ``marker_popup_anchor_y``
|
|
99
|
+
to define the position of the popup.
|
|
92
100
|
|
|
93
101
|
Map options :
|
|
94
102
|
|
|
95
103
|
- ``default_zoom`` : define the default zoom value. (7 if not defined)
|
|
96
104
|
- ``max_zoom`` : define the max zoom value. (19 if not defined)
|
|
97
|
-
- ``zoom_snap`` : define the zoom level in each change. (1 if not
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
.. code-block:: xml
|
|
102
|
-
|
|
103
|
-
<record id="my_module.action_my_model" model="ir.actions.act_window">
|
|
104
|
-
<field name="view_mode">tree,form,leaflet_map</field>
|
|
105
|
-
</record>
|
|
105
|
+
- ``zoom_snap`` : define the zoom level in each change. (1 if not
|
|
106
|
+
defined)
|
|
107
|
+
- Create or update an action for the model
|
|
106
108
|
|
|
107
|
-
|
|
109
|
+
.. code:: xml
|
|
108
110
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
- please download it here https://leafletjs.com/download.html
|
|
114
|
-
- update the javascript, css and images, present in the folder ``static/lib/leaflet``
|
|
115
|
-
- test the features
|
|
116
|
-
- make a Pull Request
|
|
111
|
+
<record id="my_module.action_my_model" model="ir.actions.act_window">
|
|
112
|
+
<field name="view_mode">tree,form,leaflet_map</field>
|
|
113
|
+
</record>
|
|
117
114
|
|
|
118
115
|
**Default position in the map**
|
|
119
116
|
|
|
120
|
-
By default, the position of the map is defined by the user, in the
|
|
121
|
-
``get_default_leaflet_position``. It returns the position of
|
|
122
|
-
you can overload this function
|
|
117
|
+
By default, the position of the map is defined by the user, in the
|
|
118
|
+
function ``get_default_leaflet_position``. It returns the position of
|
|
119
|
+
the current company, if defined. you can overload this function
|
|
120
|
+
globally, or per model.
|
|
123
121
|
|
|
124
122
|
Known issues / Roadmap
|
|
125
123
|
======================
|
|
126
124
|
|
|
127
|
-
|
|
128
|
-
is required. We should investigate why and try to
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
if longitude and latitude are available. We could imagine other
|
|
133
|
-
with Polylines, Polygons, etc...
|
|
134
|
-
|
|
125
|
+
- For the time being, at the start of the map loading, the call of
|
|
126
|
+
``invalidateSize()`` is required. We should investigate why and try to
|
|
127
|
+
remove that call. see
|
|
128
|
+
https://github.com/Leaflet/Leaflet/issues/3002#issuecomment-93836022
|
|
129
|
+
- For the time being, the map has "Markers" and allow to display odoo
|
|
130
|
+
items if longitude and latitude are available. We could imagine other
|
|
131
|
+
kind of usages, with Polylines, Polygons, etc... See all the leaflet
|
|
132
|
+
options : https://leafletjs.com/reference.html
|
|
135
133
|
|
|
136
134
|
Bug Tracker
|
|
137
135
|
===========
|
|
@@ -139,7 +137,7 @@ Bug Tracker
|
|
|
139
137
|
Bugs are tracked on `GitHub Issues <https://github.com/OCA/geospatial/issues>`_.
|
|
140
138
|
In case of trouble, please check there if your issue has already been reported.
|
|
141
139
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
142
|
-
`feedback <https://github.com/OCA/geospatial/issues/new?body=module:%20web_view_leaflet_map%0Aversion:%
|
|
140
|
+
`feedback <https://github.com/OCA/geospatial/issues/new?body=module:%20web_view_leaflet_map%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
|
143
141
|
|
|
144
142
|
Do not contact contributors directly about support or help with technical issues.
|
|
145
143
|
|
|
@@ -147,17 +145,17 @@ Credits
|
|
|
147
145
|
=======
|
|
148
146
|
|
|
149
147
|
Authors
|
|
150
|
-
|
|
148
|
+
-------
|
|
151
149
|
|
|
152
150
|
* GRAP
|
|
153
151
|
|
|
154
152
|
Contributors
|
|
155
|
-
|
|
153
|
+
------------
|
|
156
154
|
|
|
157
|
-
|
|
155
|
+
- Sylvain LE GAL (https://www.twitter.com/legalsylvain)
|
|
158
156
|
|
|
159
157
|
Maintainers
|
|
160
|
-
|
|
158
|
+
-----------
|
|
161
159
|
|
|
162
160
|
This module is maintained by the OCA.
|
|
163
161
|
|
|
@@ -177,6 +175,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
|
|
177
175
|
|
|
178
176
|
|maintainer-legalsylvain|
|
|
179
177
|
|
|
180
|
-
This module is part of the `OCA/geospatial <https://github.com/OCA/geospatial/tree/
|
|
178
|
+
This module is part of the `OCA/geospatial <https://github.com/OCA/geospatial/tree/18.0/web_view_leaflet_map>`_ project on GitHub.
|
|
181
179
|
|
|
182
180
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
{
|
|
6
6
|
"name": "Leaflet Map View (OpenStreetMap)",
|
|
7
7
|
"summary": "Add new 'leaflet_map' view, to display markers.",
|
|
8
|
-
"version": "
|
|
8
|
+
"version": "18.0.1.0.0",
|
|
9
9
|
"development_status": "Alpha",
|
|
10
10
|
"author": "GRAP, Odoo Community Association (OCA)",
|
|
11
11
|
"maintainers": ["legalsylvain"],
|
|
@@ -18,10 +18,9 @@
|
|
|
18
18
|
],
|
|
19
19
|
"assets": {
|
|
20
20
|
"web.assets_backend": [
|
|
21
|
-
"web_view_leaflet_map/static/src/
|
|
22
|
-
"web_view_leaflet_map/static/src/
|
|
23
|
-
"web_view_leaflet_map/static/src/
|
|
24
|
-
"web_view_leaflet_map/static/src/css/web_view_leaflet_map.css",
|
|
21
|
+
"web_view_leaflet_map/static/src/components/map-component/map_view.esm.js",
|
|
22
|
+
"web_view_leaflet_map/static/src/components/map-component/map_view.xml",
|
|
23
|
+
"web_view_leaflet_map/static/src/components/map-component/web_view_leaflet_map.css",
|
|
25
24
|
],
|
|
26
25
|
},
|
|
27
26
|
"installable": True,
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
def uninstall_hook(
|
|
8
|
-
cr.execute(
|
|
7
|
+
def uninstall_hook(env):
|
|
8
|
+
env.cr.execute(
|
|
9
9
|
"UPDATE ir_act_window "
|
|
10
10
|
"SET view_mode=replace(view_mode, ',leaflet_map', '')"
|
|
11
11
|
"WHERE view_mode LIKE '%,leaflet_map%';"
|
|
12
12
|
)
|
|
13
|
-
cr.execute(
|
|
13
|
+
env.cr.execute(
|
|
14
14
|
"UPDATE ir_act_window "
|
|
15
15
|
"SET view_mode=replace(view_mode, 'leaflet_map,', '')"
|
|
16
16
|
"WHERE view_mode LIKE '%leaflet_map,%';"
|
|
17
17
|
)
|
|
18
|
-
cr.execute("DELETE FROM ir_act_window " "WHERE view_mode = 'leaflet_map';")
|
|
18
|
+
env.cr.execute("DELETE FROM ir_act_window " "WHERE view_mode = 'leaflet_map';")
|
|
@@ -47,6 +47,7 @@ msgstr "Vue"
|
|
|
47
47
|
#. module: web_view_leaflet_map
|
|
48
48
|
#: model:ir.model.fields,field_description:web_view_leaflet_map.field_ir_actions_act_window_view__view_mode
|
|
49
49
|
#: model:ir.model.fields,field_description:web_view_leaflet_map.field_ir_ui_view__type
|
|
50
|
+
#: model:ir.model.fields,field_description:web_view_leaflet_map.field_website_page__type
|
|
50
51
|
msgid "View Type"
|
|
51
52
|
msgstr "Type de Vue"
|
|
52
53
|
|
|
@@ -47,5 +47,6 @@ msgstr "Vista"
|
|
|
47
47
|
#. module: web_view_leaflet_map
|
|
48
48
|
#: model:ir.model.fields,field_description:web_view_leaflet_map.field_ir_actions_act_window_view__view_mode
|
|
49
49
|
#: model:ir.model.fields,field_description:web_view_leaflet_map.field_ir_ui_view__type
|
|
50
|
+
#: model:ir.model.fields,field_description:web_view_leaflet_map.field_website_page__type
|
|
50
51
|
msgid "View Type"
|
|
51
52
|
msgstr "Tipo vista"
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#
|
|
5
5
|
msgid ""
|
|
6
6
|
msgstr ""
|
|
7
|
-
"Project-Id-Version: Odoo Server
|
|
7
|
+
"Project-Id-Version: Odoo Server 18.0\n"
|
|
8
8
|
"Report-Msgid-Bugs-To: \n"
|
|
9
9
|
"Last-Translator: \n"
|
|
10
10
|
"Language-Team: \n"
|
|
@@ -24,13 +24,6 @@ msgstr ""
|
|
|
24
24
|
msgid "Leaflet Map"
|
|
25
25
|
msgstr ""
|
|
26
26
|
|
|
27
|
-
#. module: web_view_leaflet_map
|
|
28
|
-
#. odoo-javascript
|
|
29
|
-
#: code:addons/web_view_leaflet_map/static/src/js/view/map/map_view.js:0
|
|
30
|
-
#, python-format
|
|
31
|
-
msgid "Map"
|
|
32
|
-
msgstr ""
|
|
33
|
-
|
|
34
27
|
#. module: web_view_leaflet_map
|
|
35
28
|
#: model:ir.model,name:web_view_leaflet_map.model_res_users
|
|
36
29
|
msgid "User"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
- See configuration of the module `web_leaflet_lib`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
- Sylvain LE GAL (<https://www.twitter.com/legalsylvain>)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
This module extends odoo views, to add a new kind of view, named
|
|
2
|
+
`leaflet_map` that is using the Leaflet javascript library to use maps.
|
|
3
|
+
(<https://leafletjs.com/>) This library is for exemple, used in the
|
|
4
|
+
OpenStreetMap project. (<https://www.openstreetmap.org/>)
|
|
5
|
+
|
|
6
|
+
You can see a simple usage in the module `web_view_leaflet_map_partner`
|
|
7
|
+
in the same OCA repository that displays your contact in a map, if
|
|
8
|
+
latitude and longitude are defined. (To define latitude and longitude,
|
|
9
|
+
refer to the Odoo module `base_geolocalize`)
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+

|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Create a new view :
|
|
2
|
+
|
|
3
|
+
``` xml
|
|
4
|
+
<record id="view_my_model_map" model="ir.ui.view">
|
|
5
|
+
<field name="model">my.model</field>
|
|
6
|
+
<field name="arch" type="xml">
|
|
7
|
+
<leaflet_map
|
|
8
|
+
field_latitude="FIELD_LATITUDE"
|
|
9
|
+
field_longitude="FIELD_LONGITUDE"
|
|
10
|
+
field_title="FIELD_TITLE"
|
|
11
|
+
field_address="FIELD_ADDRESS"
|
|
12
|
+
field_marker_icon_image="FIELD_MARKER_ICON_IMAGE"
|
|
13
|
+
>
|
|
14
|
+
<field name="__last_update"/>
|
|
15
|
+
<field name="FIELD_LATITUDE"/>
|
|
16
|
+
<field name="FIELD_LONGITUDE"/>
|
|
17
|
+
<field name="FIELD_TITLE"/>
|
|
18
|
+
<field name="FIELD_ADDRESS"/>
|
|
19
|
+
</leaflet_map>
|
|
20
|
+
</field>
|
|
21
|
+
</record>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
1. FIELD_LATITUDE and FIELD_LONGITUDE are the name of the fields that
|
|
25
|
+
contains GPS coordinates of the model.
|
|
26
|
+
2. FIELD_TITLE will be used when the popup is displayed, as a title.
|
|
27
|
+
3. FIELD_ADDRESS will be used when the popup is displayed to display
|
|
28
|
+
the adress.
|
|
29
|
+
4. (optional) FIELD_MARKER_ICON_IMAGE, is the name of the image field
|
|
30
|
+
to place as an icon of the marker. Note: You can set extra settings
|
|
31
|
+
`marker_icon_size_x`, `marker_icon_size_y`, to define the size of
|
|
32
|
+
the image, and `marker_popup_anchor_x`, `marker_popup_anchor_y` to
|
|
33
|
+
define the position of the popup.
|
|
34
|
+
|
|
35
|
+
Map options :
|
|
36
|
+
|
|
37
|
+
- `default_zoom` : define the default zoom value. (7 if not defined)
|
|
38
|
+
- `max_zoom` : define the max zoom value. (19 if not defined)
|
|
39
|
+
- `zoom_snap` : define the zoom level in each change. (1 if not defined)
|
|
40
|
+
- Create or update an action for the model
|
|
41
|
+
|
|
42
|
+
``` xml
|
|
43
|
+
<record id="my_module.action_my_model" model="ir.actions.act_window">
|
|
44
|
+
<field name="view_mode">tree,form,leaflet_map</field>
|
|
45
|
+
</record>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Default position in the map**
|
|
49
|
+
|
|
50
|
+
By default, the position of the map is defined by the user, in the
|
|
51
|
+
function `get_default_leaflet_position`. It returns the position of the
|
|
52
|
+
current company, if defined. you can overload this function globally, or
|
|
53
|
+
per model.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
- For the time being, at the start of the map loading, the call of
|
|
2
|
+
`invalidateSize()` is required. We should investigate why and try to
|
|
3
|
+
remove that call. see
|
|
4
|
+
<https://github.com/Leaflet/Leaflet/issues/3002#issuecomment-93836022>
|
|
5
|
+
- For the time being, the map has "Markers" and allow to display odoo
|
|
6
|
+
items if longitude and latitude are available. We could imagine other
|
|
7
|
+
kind of usages, with Polylines, Polygons, etc... See all the leaflet
|
|
8
|
+
options : <https://leafletjs.com/reference.html>
|