diff --git a/resources/process-openmaptiles.lua b/resources/process-openmaptiles.lua index 5e7f05d8..76df41fb 100644 --- a/resources/process-openmaptiles.lua +++ b/resources/process-openmaptiles.lua @@ -334,28 +334,29 @@ end -- Process way tags function way_function() - local route = Find("route") - local highway = Find("highway") - local waterway = Find("waterway") - local water = Find("water") - local building = Find("building") - local natural = Find("natural") - local historic = Find("historic") - local landuse = Find("landuse") - local leisure = Find("leisure") - local amenity = Find("amenity") - local aeroway = Find("aeroway") - local railway = Find("railway") - local service = Find("service") - local sport = Find("sport") - local shop = Find("shop") - local tourism = Find("tourism") - local man_made = Find("man_made") - local boundary = Find("boundary") - local isClosed = IsClosed() - local housenumber = Find("addr:housenumber") - local write_name = false - local construction = Find("construction") + local route = Find("route") + local highway = Find("highway") + local waterway = Find("waterway") + local water = Find("water") + local building = Find("building") + local building_part = Find("building:part") + local natural = Find("natural") + local historic = Find("historic") + local landuse = Find("landuse") + local leisure = Find("leisure") + local amenity = Find("amenity") + local aeroway = Find("aeroway") + local railway = Find("railway") + local service = Find("service") + local sport = Find("sport") + local shop = Find("shop") + local tourism = Find("tourism") + local man_made = Find("man_made") + local boundary = Find("boundary") + local isClosed = IsClosed() + local housenumber = Find("addr:housenumber") + local write_name = false + local construction = Find("construction") -- Miscellaneous preprocessing if Find("disused") == "yes" then return end @@ -568,7 +569,7 @@ function way_function() end -- Set 'building' and associated - if building~="" then + if building~="" or building_part~="" then Layer("building", true) SetBuildingHeightAttributes() SetMinZoomByArea() @@ -773,17 +774,28 @@ end function SetBuildingHeightAttributes() local height = tonumber(Find("height"), 10) - local minHeight = tonumber(Find("min_height"), 10) - local levels = tonumber(Find("building:levels"), 10) - local minLevel = tonumber(Find("building:min_level"), 10) + local buildingHeight = tonumber(Find("building:height"), 10) + local finalHeight = height or buildingHeight + + local minHeight = tonumber(Find("min_height"), 10) + local buildingMinHeight = tonumber(Find("building:min_height"), 10) + local finalMinHeight = minHeight or buildingMinHeight + + local levels = tonumber(Find("levels"), 10) + local buildingLevels = tonumber(Find("building:levels"), 10) + local finalLevels = levels or buildingLevels + + local minLevel = tonumber(Find("min_level"), 10) + local buildingMinLevel = tonumber(Find("building:min_level"), 10) + local finalMinLevel = minLevel or buildingMinLevel local renderHeight = BUILDING_FLOOR_HEIGHT - if height or levels then - renderHeight = height or (levels * BUILDING_FLOOR_HEIGHT) + if finalHeight or finalLevels then + renderHeight = finalHeight or (finalLevels * BUILDING_FLOOR_HEIGHT) end local renderMinHeight = 0 - if minHeight or minLevel then - renderMinHeight = minHeight or (minLevel * BUILDING_FLOOR_HEIGHT) + if finalMinHeight or finalMinLevel then + renderMinHeight = finalMinHeight or (finalMinLevel * BUILDING_FLOOR_HEIGHT) end -- Fix upside-down buildings diff --git a/server/static/index.html b/server/static/index.html index efadb79e..f2133a1b 100644 --- a/server/static/index.html +++ b/server/static/index.html @@ -1,54 +1,78 @@ + - - Tilemaker example server - - - - - - + + Tilemaker example server + + + + + + + -
- - +
+ + + \ No newline at end of file diff --git a/server/static/style.json b/server/static/style.json index af6fc607..7b0b0fd5 100644 --- a/server/static/style.json +++ b/server/static/style.json @@ -366,23 +366,29 @@ "metadata": {"mapbox:group": "1444849364238.8171"}, "source": "openmaptiles", "source-layer": "building", + "minzoom": 13, + "maxzoom": 21, + "layout": { + "visibility": "visible" + }, "paint": { - "fill-antialias": true, - "fill-color": {"base": 1, "stops": [[15.5, "#f2eae2"], [16, "#dfdbd7"]]} + "fill-color": "rgba(203, 198, 198, 1)", + "fill-outline-color": {"base": 1, "stops": [[13,"rgba(131, 123, 123, 0.32)"], [14,"rgba(157, 3, 5, 1)"]]} } }, { - "id": "building-top", - "type": "fill", + "id": "building-3d", + "type": "fill-extrusion", "metadata": {"mapbox:group": "1444849364238.8171"}, "source": "openmaptiles", "source-layer": "building", + "minzoom": 14, "layout": {"visibility": "visible"}, "paint": { - "fill-color": "#f2eae2", - "fill-opacity": {"base": 1, "stops": [[13, 0], [16, 1]]}, - "fill-outline-color": "#dfdbd7", - "fill-translate": {"base": 1, "stops": [[14, [0, 0]], [16, [-2, -2]]]} + "fill-extrusion-color": "rgba(203, 198, 198, 1)", + "fill-extrusion-height": {"property": "render_height","type": "identity"}, + "fill-extrusion-base": {"property": "render_min_height","type": "identity"}, + "fill-extrusion-opacity": 0.9 } }, {