Op den Inhalt sprangen

Modul:NiceMap

Vu Wikipedia
Dokumentatioun vum Modul:NiceMap [liesen] [änneren] [Versioune weisen]

D'Dokumentatioun fir dëst Modul steet hei ënnendrënner an ass vun der Säit Modul:NiceMap/doc hei agebonne ginn. All Froe sollen och op där hirer Diskussiounssäit gestallt ginn. Kuckt och: Hëllef:Moduler.

local p = {}

function p.getMapframe(frame)
    local entity = mw.wikibase.getEntity()
    if not entity or not entity.claims or not entity.claims.P625 then
        return "⛔ Keng Koordinaten op Wikidata fonnt."
    end

    local coord = entity.claims.P625[1].mainsnak.datavalue.value
    local latitude = coord.latitude
    local longitude = coord.longitude

	local mapframe = string.format([[
	<mapframe latitude=%f longitude=%f lang="lb" zoom="14" align="center" width="260" height="300">
	{
	  "type": "FeatureCollection",
	  "features": [
	    {
	      "type": "Feature",
	      "geometry": {
	        "type": "Point",
	        "coordinates": [%f, %f]
	      },
	      "properties": {
	        "title": "Standuert",
	        "marker-symbol": "marker",
	        "marker-color": "#006699"
	      }
	    }
	  ]
	}
	</mapframe>
	]], latitude, longitude, longitude, latitude)
    return frame:preprocess(mapframe)
end

return p