odooimagemapodoo-14

How to use image map in Odoo?


I am trying to use image map in Odoo 14 CE.

This is my attempt to do a proof-of-concept, which is not working (mapping does not happen in the image, and the <img> in the client-side page does not contain usermap="#workmap" attribute).

<field name="image_parts" widget="image" usemap="#workmap"/>
<map name="workmap">
  <area shape="rect" coords="34,44,270,350" alt="Computer" href="computer.htm"/>
  <area shape="rect" coords="290,172,333,250" alt="Phone" href="phone.htm"/>
  <area shape="circle" coords="337,300,44" alt="Coffee" href="coffee.htm"/>
</map>

I am trying to make a feature that display image from field image_parts (customized) and it enables users to hover and see information in a small dialog popup. Moreover, the area can also be clicked to do some other methods further on.

Is there any possible solution for this or some parts of this?


Solution

  • To do this kind of changes, you will have to review the Map View / Map Rendered / Map Controller and Map Model JS classes.

    You can find them here /enterprise/web_map/static/src/js/.

    It's always tricky wanting to do this kind of big changes in Odoo standard views ^^

    You'll need some Owl knowledge, in case you don't know you can find documentation/references/trainings/notes on the Odoo Owl github.

    Courage