Skip to content
back to search

OCA/geospatial · 19.0

Google Map View

web_view_google_map

AGPL-3Extra Toolsv19.0.1.0.0237updated about 11 hours ago

Odoo Community Association

Google Map View

Beta License: AGPL-3 OCA/geospatial Translate me on Weblate Try me on Runboat

This module adds a Google Maps view type and Places autocomplete field widgets to the Odoo web client.

Features:

  • google_map view mode to display geolocated records on Google Maps
  • Marker colors from view attributes (color / colors)
  • Marker clustering
  • Field widgets gplaces_autocomplete and gplaces_address_form

Table of contents

Configuration

  1. Install Google Maps Integration (base_google_map).
  2. Go to Settings → Google Maps Integration.
  3. Set your Google Maps API key and enable the Places / Geometry libraries as needed.
  4. Restrict the key in Google Cloud Console to your Odoo origins and the Maps JavaScript API / Places API.

Usage

Google Map view

Add a google_map view on any model that stores latitude/longitude:

<record id="view_partner_google_map" model="ir.ui.view">
    <field name="name">res.partner.google_map</field>
    <field name="model">res.partner</field>
    <field name="arch" type="xml">
        <google_map
            string="Map"
            lat="partner_latitude"
            lng="partner_longitude"
            colors="blue:company_type=='person';green:company_type=='company';"
        >
            <field name="partner_latitude" />
            <field name="partner_longitude" />
            <field name="display_name" />
            <field name="company_type" />
        </google_map>
    </field>
</record>

Include google_map in the action view_mode, for example list,form,google_map.

Contacts already expose a Google Map mode on the partner action.

Places widgets

<field
    name="street"
    widget="gplaces_address_form"
    options="{'lat': 'partner_latitude', 'lng': 'partner_longitude'}"
/>
<field
    name="name"
    widget="gplaces_autocomplete"
    options="{'lat': 'partner_latitude', 'lng': 'partner_longitude'}"
/>

Bug Tracker

Bugs are tracked on GitHub 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.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Open Source Integrators
  • Gray Matter Logic

Contributors

  • Yopi Angi <<yopiangi@gmail.com>>
  • Wolfgang Hall <<whall@opensourceintegrators.com>>
  • Serpent Consulting Services Pvt. Ltd. <<support@serpentcs.com>>
  • Ammar Officewala <<aofficewala@opensourceintegrators.com>>
  • Gray Matter Logic:
    • Maxime Chambreuil <<maxime.chambreuil@graymatterlogic.com>>

Maintainers

This module is maintained by the OCA.

Odoo Community Association

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.

Current maintainers:

gityopie wolfhall

This module is part of the OCA/geospatial project on GitHub.

You are welcome to contribute. To learn how please visit <https://odoo-community.org/page/Contribute>.