liquid_feedback_frontend

diff env/ui/field/location.lua @ 1519:056bccb61eee

Added object reference for geo references
author bsw
date Thu Aug 20 15:08:00 2020 +0200 (2020-08-20)
parents 32cc544d5a5b
children
line diff
     1.1 --- a/env/ui/field/location.lua	Thu Aug 20 14:36:56 2020 +0200
     1.2 +++ b/env/ui/field/location.lua	Thu Aug 20 15:08:00 2020 +0200
     1.3 @@ -13,7 +13,11 @@
     1.4          tag = "input",
     1.5          attr = { type = "hidden", name = args.name, value = args.value, id = "ui_field_location_value" }
     1.6        }
     1.7 -      ui.tag{ tag = "iframe", attr = { src = config.firstlife.inputmap_url .. "/src/index.html?domain=" .. request.get_absolute_baseurl() .. "&" .. config.firstlife.coordinates .. "&lightArea=false&contrast=false&mode=lite", id = "ui_field_location", class = "ui_field_location" }, content = "" }
     1.8 +      ui.tag{
     1.9 +        tag = "input",
    1.10 +        attr = { type = "hidden", name = args.name .. "_marker_link", value = args.value_marker_link, id = "ui_field_location_marker_link" }
    1.11 +      }
    1.12 +      ui.tag{ tag = "iframe", attr = { src = config.firstlife.inputmap_url .. "/src/index.html?domain=" .. request.get_absolute_baseurl() .. "&" .. config.firstlife.coordinates .. "&lightArea=false&contrast=false&mode=lite&onlypointer=false", id = "ui_field_location", class = "ui_field_location" }, content = "" }
    1.13        
    1.14        ui.script{ script = [[
    1.15  
    1.16 @@ -21,12 +25,14 @@
    1.17            if (e.origin !== "]] .. config.firstlife.inputmap_url .. [[") return;
    1.18            var data = e.data;
    1.19            if (data.src == "InputMap") {
    1.20 +            var feature = { "type": "Point", "coordinates": [data.lng, data.lat], "zoom_level": data.zoom_level };
    1.21 +            if (data.feature) {
    1.22 +              feature.marker_link = data.feature.marker_link;
    1.23 +            }
    1.24              var el = document.getElementById("ui_field_location_value");
    1.25 -            el.value = JSON.stringify({ "type": "Point", "coordinates": [data.lng, data.lat], "zoom_level": data.zoom_level });
    1.26 -            console.log(el.value);
    1.27 +            el.value = JSON.stringify(feature);
    1.28            }
    1.29          });
    1.30 -        
    1.31        ]] }
    1.32      end)
    1.33    end

Impressum / About Us