Availability |
Odoo Online
Odoo.sh
On Premise
|
Lines of code | 264 |
Technical Name |
dh_map_widget |
License | LGPL-3 |
Website | https://digitalharbor.com.sa |
Versions | 17.0 18.0 |
Availability |
Odoo Online
Odoo.sh
On Premise
|
Lines of code | 264 |
Technical Name |
dh_map_widget |
License | LGPL-3 |
Website | https://digitalharbor.com.sa |
Versions | 17.0 18.0 |
Overview
This widget adds an interactive map to any form view. Users can click to set coordinates or search an address and have the latitude/longitude written to your model fields. Works out‑of‑the‑box with OpenStreetMap tiles and optionally uses Mapbox if a token is available.
Usage
- Add two fields to your model: one for latitude (Float) and one for longitude (Float).
- In your form view, use the widget on a
char
field and point the widget to your lat/long fields via options.
<field name="x_latitude"/> <field name="x_longitude"/> <field name="x_map_holder" widget="map" options="{'latitude_field': 'x_latitude', # required 'longitude_field': 'x_longitude', # required 'enable_search': true, # optional 'readonly': false # optional }"/>
Notes:
Search can be disabled by setting enable_search
to false
. Setting readonly
to true
makes the map read‑only.
Support
Digital Harbor —
digitalharbor.com.sa
Email: support@digitalharbor.com.sa
Please log in to comment on this module