···500500 minzoom = 11
501501 end
502502 write_to_transportation_layer(minzoom, class, railway, false, service, true, false, is_closed)
503503+ if not is_closed then AttributeNumeric("mz", minzoom) end
503504504505 if HasNames() then
505506 Layer("transportation_name", false)
···553554 if waterwayClasses[waterway] and not is_closed then
554555 if waterway == "river" and Holds("name") then
555556 Layer("waterway", false)
557557+ AttributeNumeric("mz", 8)
556558 else
557559 Layer("waterway_detail", false)
560560+ AttributeNumeric("mz", 12)
558561 end
559562 if Find("intermittent")=="yes" then AttributeNumeric("intermittent", 1) else AttributeNumeric("intermittent", 0) end
560563 Attribute("class", waterway)
···721724 AttributeNumeric("mz", mz)
722725end
723726724724--- Set minimum zoom level by area but not below given minzoom
727727+-- Set minimum zoom level by area but not below given minzoom.
728728+-- Writes "mz" attribute so the style can fade features in smoothly.
725729function SetMinZoomByAreaWithLimit(minzoom)
726730 local area=Area()
727727- if minzoom <= 6 and area>ZRES5^2 then MinZoom(6)
728728- elseif minzoom <= 7 and area>ZRES6^2 then MinZoom(7)
729729- elseif minzoom <= 8 and area>ZRES7^2 then MinZoom(8)
730730- elseif minzoom <= 9 and area>ZRES8^2 then MinZoom(9)
731731- elseif minzoom <= 10 and area>ZRES9^2 then MinZoom(10)
732732- elseif minzoom <= 11 and area>ZRES10^2 then MinZoom(11)
733733- elseif minzoom <= 12 and area>ZRES11^2 then MinZoom(12)
734734- elseif minzoom <= 13 and area>ZRES12^2 then MinZoom(13)
735735- else MinZoom(14) end
731731+ local mz
732732+ if minzoom <= 6 and area>ZRES5^2 then mz=6
733733+ elseif minzoom <= 7 and area>ZRES6^2 then mz=7
734734+ elseif minzoom <= 8 and area>ZRES7^2 then mz=8
735735+ elseif minzoom <= 9 and area>ZRES8^2 then mz=9
736736+ elseif minzoom <= 10 and area>ZRES9^2 then mz=10
737737+ elseif minzoom <= 11 and area>ZRES10^2 then mz=11
738738+ elseif minzoom <= 12 and area>ZRES11^2 then mz=12
739739+ elseif minzoom <= 13 and area>ZRES12^2 then mz=13
740740+ else mz=14 end
741741+ MinZoom(mz)
742742+ AttributeNumeric("mz", mz)
736743end
737744738745-- Calculate POIs (typically rank 1-4 go to 'poi' z12-14, rank 5+ to 'poi_detail' z14)