Documentation[créer] [purger]
local Tools = require('Module:Outils')
local Geo = require("Module:Géoréférencement")
local p = {}

local function setmarker(args)
	if args.marker and args.marker ~= 'non' and args.marker ~= 'Non' and args.marker ~= '0' and args.marker ~= 'no' and args.marker ~= 'No' then
		return '&crosshair=marker '
	else
		return ' '
	end
end

function p.bayernatlas(frame)
	local args = Tools.extractArgs(frame)
	local lat, lon = Geo.setRadCoord(args)
	local desc = args.desc or args.description or 'Visualisation'
	local zoom = args.zoom or 10
	local marker = setmarker(args)
	local E, N = Geo.utm(lat, lon, 32)
	local header = '[https://geoportal.bayern.de/bayernatlas/index.html?topic=bvv&lang=de&bgLayer=atkis'
	local url_coord_center = '&E=' .. E .. '&N=' .. N
	local url = header .. url_coord_center .. '&zoom=' .. zoom .. '&catalogNodes=11&layers=tk' .. marker .. desc ..'] sur Bayerische Vermessungsverwaltung.' .. Geo.footer(args['consulté le'])
	local url = Geo.noCoord(args) or url
	return url
end

return p