Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
5092 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

   

Ảnh đại diện
Huỷ bỏ
Tác giả

Could you explain in detail

Câu trả lời hay nhất

Hi,


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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 20
7285
2
thg 9 25
1006
1
thg 9 24
3450
4
thg 5 24
13806
1
thg 4 24
4185