gluon/package/gluon-config-mode-geo-location-osm/luasrc/usr/lib/lua/gluon/config-mode/geo-location-osm.lua
Matthias Schiffer a8d736ac7b
gluon-config-mode-geo-location-osm: add OSM-based location picker
gluon-config-mode-geo-location-osm extends the
gluon-config-mode-geo-location with a location picker based on
OpenStreetMaps.

Based-on-patch-by: Jan-Tarek Butt <tarek@ring0.de>
2018-09-01 11:35:39 +02:00

27 lines
598 B
Lua

local osm = require 'gluon.web.model.osm'
local site = require 'gluon.site'
local tonumber = tonumber
module 'gluon.config-mode.geo-location-osm'
MapValue = osm.MapValue
function help(i18n)
local pkg_i18n = i18n 'gluon-config-mode-geo-location-osm'
return pkg_i18n.translate(
'You may also select the position on the map displayed below if your computer is connected to the internet at the moment.'
)
end
function options()
local config = site.config_mode.geo_location.osm
return {
openlayers_url = config.openlayers_url(),
zoom = config.zoom(12),
pos = config.center(),
}
end