Web Google Maps =============== [![Demo](https://i.ytimg.com/vi/2UdG5ILDtiY/3.jpg)](https://youtu.be/5hvAubXgUnc "Demo") This module contains three new features: - New view type and mode `map` - New widget `gplaces_address_autocomplete` - New widget `gplaces_autocomplete` # Map view `"map"` Basically, this new view `map` will integrate Google Maps into Odoo. Enable you to display `res.partner` geolocation on map or any model contains geolocation. This feature will work seamlessly with Odoo means you can search your partner location using Odoo search feature. There are five available attributes that you can customize - `lat` : an attritube to tell the map the latitude field on the object __[mandatory]__ - `lng` : an attritute to tell the map the longitude field on the object __[mandatory]__ - `color` : an attribute to modify marker color (optional) any given color will set all markers color __[optional]__. - `colors` : work like attribute `color` but more configurable (you can set marker color depends on it's value) this attribute works similar to `colors` of tree view on Odoo 9.0 __[optional]__ - `library` : an attribute to tell map which map that will be loaded __[mandatory]__. This options has two values: 1. `geometry` 2. `drawing` How to create the view? Example > view.res.partner.map res.partner
  • at
  • ,
... form tree,form,map ... The view looks familiar? Yes, you're right. The marker infowindow will use `kanban-box` kanban card style. ### How to setup color for marker on map? There are two attributes: - `colors` - `color` Example: > ... ... # New widget `"gplaces_address_autocomplete"` New widget to integrate [Place Autocomplete Address Form](https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform) in Odoo. The widget has four options that can be modify: - `component_form` - `fillfields` - `lat` - `lng` ### Component form `component_form` Is an option used to modify which value you want to take from an objects returned by the geocoder. Full documentation about Google component types can be found [here](https://developers.google.com/maps/documentation/geocoding/intro#Types) By default this option are configured like the following value > { 'street_number': 'long_name', 'route': 'long_name', 'intersection': 'short_name', 'political': 'short_name', 'country': 'short_name', 'administrative_area_level_1': 'short_name', 'administrative_area_level_2': 'short_name', 'administrative_area_level_3': 'short_name', 'administrative_area_level_4': 'short_name', 'administrative_area_level_5': 'short_name', 'colloquial_area': 'short_name', 'locality': 'short_name', 'ward': 'short_name', 'sublocality_level_1': 'short_name', 'sublocality_level_2': 'short_name', 'sublocality_level_3': 'short_name', 'sublocality_level_5': 'short_name', 'neighborhood': 'short_name', 'premise': 'short_name', 'postal_code': 'short_name', 'natural_feature': 'short_name', 'airport': 'short_name', 'park': 'short_name', 'point_of_interest': 'long_name' } This configuration can be modify into view field definition. Example: > ... ... ... ### Fill fields `fillfields` Is an option that will be influenced by `gplaces_address_autocomplete` widget. This options should contains known `fields` that you want the widget to fulfill a value for each given field automatically. A field can contains one or multiple elements of component form By default this options are configured like the following > { 'street': ['street_number', 'route'], 'street2': ['administrative_area_level_3', 'administrative_area_level_4', 'administrative_area_level_5'], 'city': ['locality', 'administrative_area_level_2'], 'zip': 'postal_code', 'state_id': 'administrative_area_level_1', 'country_id': 'country', } This configuration can be modify into view field definition as well Example: > ... ... ... ### Latitude `lat` and Longitude `lng` This options tell the widget the fields geolocation, in order to have this fields filled automatically. # New widget `"gplaces_autocomplete"` New widget to integrate [Place Autocomplete](https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete) in Odoo. This widget have similar configuration to `gplaces_address_autocomplete`. ### Component form `component_form` ### Same configuration of `gplaces_address_autocomplete` component form ### Fill fields `fillfields` This configuration works similar to `gplaces_address_autocomplete`. By default this options are configured like following value: > { general: { name: 'name', website: 'website', phone: ['international_phone_number', 'formatted_phone_number'] }, geolocation: { partner_latitude: 'latitude', partner_longitude: 'longitude' }, address: { street: ['street_number', 'route'], street2: ['administrative_area_level_3', 'administrative_area_level_4', 'administrative_area_level_5'], city: ['locality', 'administrative_area_level_2'], zip: 'postal_code', state_id: 'administrative_area_level_1', country_id: 'country' } }; # Technical This module will install `base_setup` and `base_geolocalize`. *I recommend you to setup __Google Maps Key API__ and add it into Odoo `Settings > General` Settings when you installed this module* *__List of Google APIs & services required in order to make all features works__* - Geocoding API - Maps JavaScript API - Places API for Web The goal of this module is to bring the power of Google Maps into Odoo This module has tested on Odoo Version 11.0c [![ko-fi](https://www.ko-fi.com/img/donate_sm.png)](https://ko-fi.com/P5P4FOM0) *if you want to support me to keep this project maintained. Thanks :)*