跳至內容
選單
此問題已被標幟
2 回覆
5096 瀏覽次數

I have added two fields 'latitude' and 'longitude' in project form view. The user needs to fill these two fields by clicking on a button inside the form view and to select the place from pop up displaying google map. What is the best way to implement this?

頭像
捨棄
最佳答案

Hello GopaKumar N G,

latitude and longitude in form view from Google Map

Place one button in form view and click method call from js 

like this,

<button string ="Geo-Location" id="geolocation_id">

this._super.apply(this, arguments);

            var self = this;

            $el.click(function(ev) {

                if (node.attrs.id === "geolocation_id") {

# Here You can Open Google map

# and get latitude and longitude values and pass it to python and update your form view field.

Thank You!

Regards,




Email:      odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari

   

頭像
捨棄
作者

Could you explain in detail

最佳答案

Hi,


Please check this: https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_geolocation

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
11月 20
7295
2
9月 25
1019
1
9月 24
3459
4
5月 24
13816
1
4月 24
4192