代码拉取完成,页面将自动刷新
-- Nodes will only be processed if one of these keys is present
node_keys = { "amenity", "shop" }
-- Initialize Lua logic
function init_function()
end
-- Finalize Lua logic()
function exit_function()
end
-- Assign nodes to a layer, and set attributes, based on OSM tags
function node_function(node)
local amenity = node:Find("amenity")
local shop = node:Find("shop")
if amenity~="" or shop~="" then
node:Layer("poi", false)
if amenity~="" then node:Attribute("class",amenity)
else node:Attribute("class",shop) end
node:Attribute("name", node:Find("name"))
end
end
-- Similarly for ways
function way_function(way)
local highway = way:Find("highway")
local waterway = way:Find("waterway")
local building = way:Find("building")
if highway~="" then
way:Layer("transportation", false)
way:Attribute("class", highway)
-- way:Attribute("id",way:Id())
-- way:AttributeNumeric("area",37)
end
if waterway~="" then
way:Layer("waterway", false)
way:Attribute("class", waterway)
end
if building~="" then
way:Layer("building", true)
end
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。