diff --git a/geolocation_map_widget/README.rst b/geolocation_map_widget/README.rst new file mode 100644 index 000000000..f28a0fc57 --- /dev/null +++ b/geolocation_map_widget/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/licenses-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +GeoLocation Map widget +======================= +The GeoLocation Map widget allows users to obtain the address of the selected location on the map. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Gnu Affero General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: (V17) Ayana K P, +Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/geolocation_map_widget/__init__.py b/geolocation_map_widget/__init__.py new file mode 100644 index 000000000..01a159cdb --- /dev/null +++ b/geolocation_map_widget/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ayana K P (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### diff --git a/geolocation_map_widget/__manifest__.py b/geolocation_map_widget/__manifest__.py new file mode 100644 index 000000000..018a10601 --- /dev/null +++ b/geolocation_map_widget/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ayana K P (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +{ + 'name': 'GeoLocation Map widget', + 'version': '17.0.1.0.0', + 'category': 'Tools', + 'summary': """The GeoLocation Map widget allows users to obtain the address + of the selected location on the map.""", + 'description': """The GeoLocation Map widget enables users to pinpoint + a location on the map and retrieve the corresponding address. This feature + provides an easy way to identify and display the address of any selected + location directly within the map view.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base'], + 'data': [ + ], + 'assets': { + 'web.assets_backend': [ + "https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" , + 'https://unpkg.com/leaflet@1.7.1/dist/leaflet.js', + 'geolocation_map_widget/static/src/css/goelocation_map.css', + 'geolocation_map_widget/static/src/js/geolocation_map.js', + 'geolocation_map_widget/static/src/xml/geolocation_map_templates.xml', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/geolocation_map_widget/doc/RELEASE_NOTES.md b/geolocation_map_widget/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..233a1e63c --- /dev/null +++ b/geolocation_map_widget/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 13.08.2024 +#### Version 17.0.1.0.0 +#### ADD +- Initial commit for GeoLocation Map widget diff --git a/geolocation_map_widget/static/description/assets/icons/check.png b/geolocation_map_widget/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/check.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/chevron.png b/geolocation_map_widget/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/chevron.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/cogs.png b/geolocation_map_widget/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/cogs.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/consultation.png b/geolocation_map_widget/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/consultation.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/ecom-black.png b/geolocation_map_widget/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/ecom-black.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/education-black.png b/geolocation_map_widget/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/education-black.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/hotel-black.png b/geolocation_map_widget/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/hotel-black.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/license.png b/geolocation_map_widget/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/license.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/lifebuoy.png b/geolocation_map_widget/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/lifebuoy.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/manufacturing-black.png b/geolocation_map_widget/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/manufacturing-black.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/pos-black.png b/geolocation_map_widget/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/pos-black.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/puzzle.png b/geolocation_map_widget/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/puzzle.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/restaurant-black.png b/geolocation_map_widget/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/restaurant-black.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/service-black.png b/geolocation_map_widget/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/service-black.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/trading-black.png b/geolocation_map_widget/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/trading-black.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/training.png b/geolocation_map_widget/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/training.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/update.png b/geolocation_map_widget/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/update.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/user.png b/geolocation_map_widget/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/user.png differ diff --git a/geolocation_map_widget/static/description/assets/icons/wrench.png b/geolocation_map_widget/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/geolocation_map_widget/static/description/assets/icons/wrench.png differ diff --git a/geolocation_map_widget/static/description/assets/misc/Cybrosys R.png b/geolocation_map_widget/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/misc/Cybrosys R.png differ diff --git a/geolocation_map_widget/static/description/assets/misc/categories.png b/geolocation_map_widget/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/misc/categories.png differ diff --git a/geolocation_map_widget/static/description/assets/misc/check-box.png b/geolocation_map_widget/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/misc/check-box.png differ diff --git a/geolocation_map_widget/static/description/assets/misc/compass.png b/geolocation_map_widget/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/geolocation_map_widget/static/description/assets/misc/compass.png differ diff --git a/geolocation_map_widget/static/description/assets/misc/corporate.png b/geolocation_map_widget/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/geolocation_map_widget/static/description/assets/misc/corporate.png differ diff --git a/geolocation_map_widget/static/description/assets/misc/customer-support.png b/geolocation_map_widget/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/geolocation_map_widget/static/description/assets/misc/customer-support.png differ diff --git a/geolocation_map_widget/static/description/assets/misc/cybrosys-logo.png b/geolocation_map_widget/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/geolocation_map_widget/static/description/assets/misc/cybrosys-logo.png differ diff --git a/geolocation_map_widget/static/description/assets/misc/email.svg b/geolocation_map_widget/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/geolocation_map_widget/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/geolocation_map_widget/static/description/assets/misc/features.png b/geolocation_map_widget/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/misc/features.png differ diff --git a/geolocation_map_widget/static/description/assets/misc/logo.png b/geolocation_map_widget/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/geolocation_map_widget/static/description/assets/misc/logo.png differ diff --git a/geolocation_map_widget/static/description/assets/misc/phone.svg b/geolocation_map_widget/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/geolocation_map_widget/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/geolocation_map_widget/static/description/assets/misc/pictures.png b/geolocation_map_widget/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/misc/pictures.png differ diff --git a/geolocation_map_widget/static/description/assets/misc/pie-chart.png b/geolocation_map_widget/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/misc/pie-chart.png differ diff --git a/geolocation_map_widget/static/description/assets/misc/right-arrow.png b/geolocation_map_widget/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/misc/right-arrow.png differ diff --git a/geolocation_map_widget/static/description/assets/misc/star (1) 2.svg b/geolocation_map_widget/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/geolocation_map_widget/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/geolocation_map_widget/static/description/assets/misc/star.png b/geolocation_map_widget/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/geolocation_map_widget/static/description/assets/misc/star.png differ diff --git a/geolocation_map_widget/static/description/assets/misc/support (1) 1.svg b/geolocation_map_widget/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/geolocation_map_widget/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/geolocation_map_widget/static/description/assets/misc/support-email.svg b/geolocation_map_widget/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/geolocation_map_widget/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/geolocation_map_widget/static/description/assets/misc/support.png b/geolocation_map_widget/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/misc/support.png differ diff --git a/geolocation_map_widget/static/description/assets/misc/tick-mark.svg b/geolocation_map_widget/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/geolocation_map_widget/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/geolocation_map_widget/static/description/assets/misc/whatsapp 1.svg b/geolocation_map_widget/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/geolocation_map_widget/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/geolocation_map_widget/static/description/assets/misc/whatsapp.png b/geolocation_map_widget/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/misc/whatsapp.png differ diff --git a/geolocation_map_widget/static/description/assets/misc/whatsapp.svg b/geolocation_map_widget/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/geolocation_map_widget/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/geolocation_map_widget/static/description/assets/modules/module_image (1).jpeg b/geolocation_map_widget/static/description/assets/modules/module_image (1).jpeg new file mode 100644 index 000000000..5ae24843e Binary files /dev/null and b/geolocation_map_widget/static/description/assets/modules/module_image (1).jpeg differ diff --git a/geolocation_map_widget/static/description/assets/modules/module_image (1).png b/geolocation_map_widget/static/description/assets/modules/module_image (1).png new file mode 100644 index 000000000..0dea4f332 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/modules/module_image (1).png differ diff --git a/geolocation_map_widget/static/description/assets/modules/module_image (2).png b/geolocation_map_widget/static/description/assets/modules/module_image (2).png new file mode 100644 index 000000000..a5dc79613 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/modules/module_image (2).png differ diff --git a/geolocation_map_widget/static/description/assets/modules/module_image-1.jpeg b/geolocation_map_widget/static/description/assets/modules/module_image-1.jpeg new file mode 100644 index 000000000..31f066e9c Binary files /dev/null and b/geolocation_map_widget/static/description/assets/modules/module_image-1.jpeg differ diff --git a/geolocation_map_widget/static/description/assets/modules/module_image.jpeg b/geolocation_map_widget/static/description/assets/modules/module_image.jpeg new file mode 100644 index 000000000..0cbac311c Binary files /dev/null and b/geolocation_map_widget/static/description/assets/modules/module_image.jpeg differ diff --git a/geolocation_map_widget/static/description/assets/modules/module_image.png b/geolocation_map_widget/static/description/assets/modules/module_image.png new file mode 100644 index 000000000..612be4b77 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/modules/module_image.png differ diff --git a/geolocation_map_widget/static/description/assets/screenshots/1.png b/geolocation_map_widget/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..acf5b5a75 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/screenshots/1.png differ diff --git a/geolocation_map_widget/static/description/assets/screenshots/2.png b/geolocation_map_widget/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..e2888e017 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/screenshots/2.png differ diff --git a/geolocation_map_widget/static/description/assets/screenshots/3.png b/geolocation_map_widget/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..6e40735f3 Binary files /dev/null and b/geolocation_map_widget/static/description/assets/screenshots/3.png differ diff --git a/geolocation_map_widget/static/description/assets/screenshots/hero-v17.gif b/geolocation_map_widget/static/description/assets/screenshots/hero-v17.gif new file mode 100644 index 000000000..615e584ba Binary files /dev/null and b/geolocation_map_widget/static/description/assets/screenshots/hero-v17.gif differ diff --git a/geolocation_map_widget/static/description/banner.jpg b/geolocation_map_widget/static/description/banner.jpg new file mode 100644 index 000000000..4f85a9bb6 Binary files /dev/null and b/geolocation_map_widget/static/description/banner.jpg differ diff --git a/geolocation_map_widget/static/description/icon.png b/geolocation_map_widget/static/description/icon.png new file mode 100644 index 000000000..e50c57b0c Binary files /dev/null and b/geolocation_map_widget/static/description/icon.png differ diff --git a/geolocation_map_widget/static/description/index.html b/geolocation_map_widget/static/description/index.html new file mode 100644 index 000000000..440074761 --- /dev/null +++ b/geolocation_map_widget/static/description/index.html @@ -0,0 +1,722 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ GeoLocation Map widget

+

+ The GeoLocation Map widget allows users to obtain the address of the selected location on the map. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Address Retrieval

+

Users can obtain the address of the selected location directly from the map, simplifying the process of identifying and displaying addresses. +

+
+
+
+
+
+
+ +
+
+

+ Interactive Map

+

The widget provides an interactive map interface that allows users to pinpoint locations easily. +

+
+
+
+
+
+
+ +
+
+

+ Real-time Address Display

+

As users select a location on the map, the widget dynamically retrieves and displays the corresponding address. +

+
+
+
+
+
+
+ +
+
+

+ User-Friendly Interface

+

Designed to be intuitive and straightforward, the widget integrates seamlessly into the map view, making address identification and retrieval easy for users. +

+
+
+
+ +
+
+
+ +
+
+
+
+

+ Configuration

+

+ Add the 'geolocation_map' widget to a Char field and ensure that location permissions are granted in both the browser and site settings.

+
+
+
+
+
+ + +
+
+

+ Choose a location on the map, and the address for that location will automatically populate the character field.

+
+
+
+
+
+
+ + +
+
+

+ Clicking the location marker button will open a new browser tab with the location displayed on the map.

+
+
+
+
+
+
+ +
+
+

+ The selected location can be viewed in a new browser tab.

+
+
+
+
+
+
+
    +
  • + Interactive Map +
  • +
  • + Real-time Address Display +
  • +
  • + Enterprise and Community compatible. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:09th August 2024 +
+

+ Initial Commit for GeoLocation Map widget.

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ + +
+
+

+ Our Services

+
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Licensing Consultancy

+
+
+
+
+
+
+

+ Our Industries

+
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

+ Education

+

A platform for educational management

+
+
+
+
+ +

+ Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & + Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service + Management

+

Keep track of services and invoice

+
+
+
+
+ +

+ Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel + Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

+ Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got + questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/geolocation_map_widget/static/src/css/goelocation_map.css b/geolocation_map_widget/static/src/css/goelocation_map.css new file mode 100644 index 000000000..f85381159 --- /dev/null +++ b/geolocation_map_widget/static/src/css/goelocation_map.css @@ -0,0 +1,16 @@ +.o_input_map{ + position: relative; +} +#open_map{ + color: blue; + font-size: 20px; + position: absolute; + top: -5px; + right: 13px; +} +.o_leaftlet_preview_open{ + position: relative; + height: 200px; + width: 100%; + top: 9px; +} \ No newline at end of file diff --git a/geolocation_map_widget/static/src/js/geolocation_map.js b/geolocation_map_widget/static/src/js/geolocation_map.js new file mode 100644 index 000000000..9d0c486b0 --- /dev/null +++ b/geolocation_map_widget/static/src/js/geolocation_map.js @@ -0,0 +1,123 @@ +/** @odoo-module **/ + +import { _t } from "@web/core/l10n/translation"; +import { useService } from "@web/core/utils/hooks"; +import { CharField, charField } from "@web/views/fields/char/char_field"; +import { useRef, useState, onMounted } from "@odoo/owl"; +import { registry } from "@web/core/registry"; +/** + * GeoLocationMap class extends CharField to provide a map with geolocation features. + */ +export class GeoLocationMap extends CharField { + /** + * Sets up the component by initializing services, references, and state. + */ + setup() { + super.setup(); + this.orm = useService('orm'); + this.mapContainerRef = useRef('mapContainer'); + this.state = useState({ + latitude: '51.505', + longitude: '-0.09', + address: '', + currentMarker: null, + }); + onMounted(() => this._initializeMap()); + } + /** + * Initializes the Leaflet map and sets up event handlers. + * - Configures the map and tile layer. + * - Adds a click event listener to handle map clicks. + */ + async _initializeMap() { + const mapContainer = this.mapContainerRef.el; + const value = this.input.el.value + if (value){ + await this.getLatLngFromAddress(value) + } + if (!mapContainer) { + console.error('Map container not found.'); + return; + } + // Initialize the map + const map = L.map(mapContainer,{zoomControl: true,zoom:1,zoomAnimation:false,fadeAnimation:true,markerZoomAnimation:true}).setView([this.state.latitude, this.state.longitude], 13); + // Add tile layer + L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 15 }).addTo(map); + this.state.currentMarker = L.marker([this.state.latitude, this.state.longitude]) + .addTo(map) + .bindPopup('Selected Location') + .openPopup(); + // Handle map clicks + map.on('click', async (event) => { + const { lat, lng } = event.latlng; + this.state.latitude = lat; + this.state.longitude = lng; + try { + const address = await this.getAddressFromLatLng(lat, lng); + await this.props.record.update({ [this.props.name]: address }); + } catch (error) { + console.error('Error fetching address:', error); + } + if (this.state.currentMarker) { + map.removeLayer(this.state.currentMarker); + } + const newMarker = L.marker([lat, lng]) + .addTo(map) + .bindPopup('Selected Location') + .openPopup(); + this.state.currentMarker = newMarker; + }); + } + /** + * Retrieves the address for the given latitude and longitude using the Nominatim API. + * @param {number} latitude - Latitude of the location. + * @param {number} longitude - Longitude of the location. + * @returns {Promise} The formatted address or null if an error occurs. + */ + async getAddressFromLatLng(latitude, longitude) { + try { + const response = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${latitude}&lon=${longitude}&format=json`); + const data = await response.json(); + return `${data.address.village || ''}, ${data.address.county || ''}, ${data.address.state || ''}, ${data.address.country || ''}`; + } catch (error) { + console.error('Error fetching address:', error); + return null; + } + } + /** + * Converts an address into latitude and longitude using Nominatim. + * @param {string} address - The address to geocode. + * @returns {Promise<{lat: number, lon: number} | null>} The latitude and longitude, or null if an error occurs. + */ + async getLatLngFromAddress(address) { + try { + const response = await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(address)}`); + const data = await response.json(); + if (data.length > 0) { + this.state.latitude = parseFloat(data[0].lat); + this.state.longitude = parseFloat(data[0].lon); + } + return null; + } catch (error) { + console.error('Error fetching coordinates:', errlatitudeor); + return null; + } + } + /** + * Opens a Google Maps view for the current location. + * The location is determined by the state’s latitude and longitude. + */ + async _OpenMapview() { + const { longitude, latitude } = this.state; + if (latitude && longitude) { + window.open(`https://www.google.com/maps/search/?api=1&query=${latitude},${longitude}`, '_blank'); + } + } +} +GeoLocationMap.template = 'GeoLocation'; +export const geoLocationMap = { + ...charField, + component: GeoLocationMap, + displayName: _t("GeoLocation Map Viewer"), +}; +registry.category("fields").add("geolocation_map", geoLocationMap); diff --git a/geolocation_map_widget/static/src/xml/geolocation_map_templates.xml b/geolocation_map_widget/static/src/xml/geolocation_map_templates.xml new file mode 100644 index 000000000..510237f6f --- /dev/null +++ b/geolocation_map_widget/static/src/xml/geolocation_map_templates.xml @@ -0,0 +1,35 @@ + + + + + +
+ + +
+
+ +
+ +
+
+ + +