================================
Leaflet Map View (OpenStreetMap)
================================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f494ec35cbd29ae4bcc5e46a7a30bf5b2261bd449a3b0ba08a95a70d45dbea12
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fgeospatial-lightgray.png?logo=github
:target: https://github.com/OCA/geospatial/tree/16.0/web_view_leaflet_map
:alt: OCA/geospatial
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/geospatial-16-0/geospatial-16-0-web_view_leaflet_map
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/geospatial&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This module extends odoo views, to add a new kind of view, named ``leaflet_map``
that is using the Leaflet javascript library to use maps. (https://leafletjs.com/)
This library is for exemple, used in the OpenStreetMap project. (https://www.openstreetmap.org/)
You can see a simple usage in the module ``web_view_leaflet_map_partner`` in the
same OCA repository that displays your contact in a map, if latitude and longitude are
defined. (To define latitude and longitude, refer to the Odoo module ``base_geolocalize``)
.. figure:: https://raw.githubusercontent.com/OCA/geospatial/16.0/web_view_leaflet_map/static/description/view_res_partner_map_1.png
.. figure:: https://raw.githubusercontent.com/OCA/geospatial/16.0/web_view_leaflet_map/static/description/view_res_partner_map_2.png
.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_
**Table of contents**
.. contents::
:local:
Configuration
=============
* See configuration of the module ``web_leaflet_lib``.
Development
===========
Create a new view :
.. code-block:: xml
<record id="view_my_model_map" model="ir.ui.view">
<field name="model">my.model</field>
<field name="arch" type="xml">
<leaflet_map
field_latitude="FIELD_LATITUDE"
field_longitude="FIELD_LONGITUDE"
field_title="FIELD_TITLE"
field_address="FIELD_ADDRESS"
field_marker_icon_image="FIELD_MARKER_ICON_IMAGE"
>
<field name="__last_update"/>
<field name="FIELD_LATITUDE"/>
<field name="FIELD_LONGITUDE"/>
<field name="FIELD_TITLE"/>
<field name="FIELD_ADDRESS"/>
</leaflet_map>
</field>
</record>
1. FIELD_LATITUDE and FIELD_LONGITUDE are the name of the fields that contains GPS coordinates of the model.
2. FIELD_TITLE will be used when the popup is displayed, as a title.
3. FIELD_ADDRESS will be used when the popup is displayed to display the adress.
4. (optional) FIELD_MARKER_ICON_IMAGE, is the name of the image field to place as an icon
of the marker.
Note: You can set extra settings ``marker_icon_size_x``, ``marker_icon_size_y``, to define
the size of the image, and ``marker_popup_anchor_x``, ``marker_popup_anchor_y`` to define
the position of the popup.
Map options :
- ``default_zoom`` : define the default zoom value. (7 if not defined)
- ``max_zoom`` : define the max zoom value. (19 if not defined)
- ``zoom_snap`` : define the zoom level in each change. (1 if not defined)
* Create or update an action for the model
.. code-block:: xml
<record id="my_module.action_my_model" model="ir.actions.act_window">
<field name="view_mode">tree,form,leaflet_map</field>
</record>
**Library Update**
For the time being, the module embed the lealflet.js library version 1.8.0 ( released on April 18, 2022.)
If a new release is out:
- please download it here https://leafletjs.com/download.html
- update the javascript, css and images, present in the folder ``static/lib/leaflet``
- test the features
- make a Pull Request
**Default position in the map**
By default, the position of the map is defined by the user, in the function
``get_default_leaflet_position``. It returns the position of the current company, if defined.
you can overload this function globally, or per model.
Known issues / Roadmap
======================
* For the time being, at the start of the map loading, the call of ``invalidateSize()``
is required. We should investigate why and try to remove that call.
see https://github.com/Leaflet/Leaflet/issues/3002#issuecomment-93836022
* For the time being, the map has "Markers" and allow to display odoo items
if longitude and latitude are available. We could imagine other kind of usages,
with Polylines, Polygons, etc...
See all the leaflet options : https://leafletjs.com/reference.html
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/geospatial/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/geospatial/issues/new?body=module:%20web_view_leaflet_map%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* GRAP
Contributors
~~~~~~~~~~~~
* Sylvain LE GAL (https://www.twitter.com/legalsylvain)
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px
:target: https://github.com/legalsylvain
:alt: legalsylvain
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-legalsylvain|
This module is part of the `OCA/geospatial <https://github.com/OCA/geospatial/tree/16.0/web_view_leaflet_map>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Raw data
{
"_id": null,
"home_page": "https://github.com/OCA/geospatial",
"name": "odoo-addon-web-view-leaflet-map",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": "GRAP, Odoo Community Association (OCA)",
"author_email": "support@odoo-community.org",
"download_url": null,
"platform": null,
"description": "================================\nLeaflet Map View (OpenStreetMap)\n================================\n\n.. \n !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n !! This file is generated by oca-gen-addon-readme !!\n !! changes will be overwritten. !!\n !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n !! source digest: sha256:f494ec35cbd29ae4bcc5e46a7a30bf5b2261bd449a3b0ba08a95a70d45dbea12\n !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png\n :target: https://odoo-community.org/page/development-status\n :alt: Alpha\n.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png\n :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html\n :alt: License: AGPL-3\n.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fgeospatial-lightgray.png?logo=github\n :target: https://github.com/OCA/geospatial/tree/16.0/web_view_leaflet_map\n :alt: OCA/geospatial\n.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png\n :target: https://translation.odoo-community.org/projects/geospatial-16-0/geospatial-16-0-web_view_leaflet_map\n :alt: Translate me on Weblate\n.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png\n :target: https://runboat.odoo-community.org/builds?repo=OCA/geospatial&target_branch=16.0\n :alt: Try me on Runboat\n\n|badge1| |badge2| |badge3| |badge4| |badge5|\n\nThis module extends odoo views, to add a new kind of view, named ``leaflet_map``\nthat is using the Leaflet javascript library to use maps. (https://leafletjs.com/)\nThis library is for exemple, used in the OpenStreetMap project. (https://www.openstreetmap.org/)\n\nYou can see a simple usage in the module ``web_view_leaflet_map_partner`` in the\nsame OCA repository that displays your contact in a map, if latitude and longitude are\ndefined. (To define latitude and longitude, refer to the Odoo module ``base_geolocalize``)\n\n.. figure:: https://raw.githubusercontent.com/OCA/geospatial/16.0/web_view_leaflet_map/static/description/view_res_partner_map_1.png\n\n.. figure:: https://raw.githubusercontent.com/OCA/geospatial/16.0/web_view_leaflet_map/static/description/view_res_partner_map_2.png\n\n.. IMPORTANT::\n This is an alpha version, the data model and design can change at any time without warning.\n Only for development or testing purpose, do not use in production.\n `More details on development status <https://odoo-community.org/page/development-status>`_\n\n**Table of contents**\n\n.. contents::\n :local:\n\nConfiguration\n=============\n\n* See configuration of the module ``web_leaflet_lib``.\n\nDevelopment\n===========\n\nCreate a new view :\n\n.. code-block:: xml\n\n <record id=\"view_my_model_map\" model=\"ir.ui.view\">\n <field name=\"model\">my.model</field>\n <field name=\"arch\" type=\"xml\">\n <leaflet_map\n field_latitude=\"FIELD_LATITUDE\"\n field_longitude=\"FIELD_LONGITUDE\"\n field_title=\"FIELD_TITLE\"\n field_address=\"FIELD_ADDRESS\"\n field_marker_icon_image=\"FIELD_MARKER_ICON_IMAGE\"\n >\n <field name=\"__last_update\"/>\n <field name=\"FIELD_LATITUDE\"/>\n <field name=\"FIELD_LONGITUDE\"/>\n <field name=\"FIELD_TITLE\"/>\n <field name=\"FIELD_ADDRESS\"/>\n </leaflet_map>\n </field>\n </record>\n\n1. FIELD_LATITUDE and FIELD_LONGITUDE are the name of the fields that contains GPS coordinates of the model.\n2. FIELD_TITLE will be used when the popup is displayed, as a title.\n3. FIELD_ADDRESS will be used when the popup is displayed to display the adress.\n4. (optional) FIELD_MARKER_ICON_IMAGE, is the name of the image field to place as an icon\n of the marker.\n Note: You can set extra settings ``marker_icon_size_x``, ``marker_icon_size_y``, to define\n the size of the image, and ``marker_popup_anchor_x``, ``marker_popup_anchor_y`` to define\n the position of the popup.\n\nMap options :\n\n- ``default_zoom`` : define the default zoom value. (7 if not defined)\n- ``max_zoom`` : define the max zoom value. (19 if not defined)\n- ``zoom_snap`` : define the zoom level in each change. (1 if not defined)\n\n* Create or update an action for the model\n\n.. code-block:: xml\n\n <record id=\"my_module.action_my_model\" model=\"ir.actions.act_window\">\n <field name=\"view_mode\">tree,form,leaflet_map</field>\n </record>\n\n**Library Update**\n\nFor the time being, the module embed the lealflet.js library version 1.8.0 ( released on April 18, 2022.)\n\nIf a new release is out:\n\n- please download it here https://leafletjs.com/download.html\n- update the javascript, css and images, present in the folder ``static/lib/leaflet``\n- test the features\n- make a Pull Request\n\n**Default position in the map**\n\nBy default, the position of the map is defined by the user, in the function\n``get_default_leaflet_position``. It returns the position of the current company, if defined.\nyou can overload this function globally, or per model.\n\nKnown issues / Roadmap\n======================\n\n* For the time being, at the start of the map loading, the call of ``invalidateSize()``\n is required. We should investigate why and try to remove that call.\n see https://github.com/Leaflet/Leaflet/issues/3002#issuecomment-93836022\n\n* For the time being, the map has \"Markers\" and allow to display odoo items\n if longitude and latitude are available. We could imagine other kind of usages,\n with Polylines, Polygons, etc...\n See all the leaflet options : https://leafletjs.com/reference.html\n\nBug Tracker\n===========\n\nBugs are tracked on `GitHub Issues <https://github.com/OCA/geospatial/issues>`_.\nIn case of trouble, please check there if your issue has already been reported.\nIf you spotted it first, help us to smash it by providing a detailed and welcomed\n`feedback <https://github.com/OCA/geospatial/issues/new?body=module:%20web_view_leaflet_map%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.\n\nDo not contact contributors directly about support or help with technical issues.\n\nCredits\n=======\n\nAuthors\n~~~~~~~\n\n* GRAP\n\nContributors\n~~~~~~~~~~~~\n\n* Sylvain LE GAL (https://www.twitter.com/legalsylvain)\n\nMaintainers\n~~~~~~~~~~~\n\nThis module is maintained by the OCA.\n\n.. image:: https://odoo-community.org/logo.png\n :alt: Odoo Community Association\n :target: https://odoo-community.org\n\nOCA, or the Odoo Community Association, is a nonprofit organization whose\nmission is to support the collaborative development of Odoo features and\npromote its widespread use.\n\n.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px\n :target: https://github.com/legalsylvain\n :alt: legalsylvain\n\nCurrent `maintainer <https://odoo-community.org/page/maintainer-role>`__:\n\n|maintainer-legalsylvain| \n\nThis module is part of the `OCA/geospatial <https://github.com/OCA/geospatial/tree/16.0/web_view_leaflet_map>`_ project on GitHub.\n\nYou are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.\n",
"bugtrack_url": null,
"license": "AGPL-3",
"summary": "Add new 'leaflet_map' view, to display markers.",
"version": "16.0.2.0.0.3",
"project_urls": {
"Homepage": "https://github.com/OCA/geospatial"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "35940886c7b18c8c2c82ddf36b46cb099f922dbcc844b6bf6620bd7cf3c2c793",
"md5": "c7019e1054efb58556b0a40f8ec8e2d5",
"sha256": "672c32f468fb18399a278aaac59da263a4a8fa5c01bf05ab0e012f7e108c300e"
},
"downloads": -1,
"filename": "odoo_addon_web_view_leaflet_map-16.0.2.0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c7019e1054efb58556b0a40f8ec8e2d5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 426114,
"upload_time": "2024-10-31T03:09:16",
"upload_time_iso_8601": "2024-10-31T03:09:16.979311Z",
"url": "https://files.pythonhosted.org/packages/35/94/0886c7b18c8c2c82ddf36b46cb099f922dbcc844b6bf6620bd7cf3c2c793/odoo_addon_web_view_leaflet_map-16.0.2.0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-31 03:09:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "OCA",
"github_project": "geospatial",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "geojson",
"specs": []
},
{
"name": "requests",
"specs": []
},
{
"name": "shapely",
"specs": []
},
{
"name": "simplejson",
"specs": []
}
],
"lcname": "odoo-addon-web-view-leaflet-map"
}