Commit a93a4d1d authored by Adrien Pavie's avatar Adrien Pavie
Browse files

Show building footprint (closes #62)

parent ee96efc1
...@@ -61,7 +61,7 @@ OSM.prototype.download = function(bbox, success, fail) { ...@@ -61,7 +61,7 @@ OSM.prototype.download = function(bbox, success, fail) {
OSM.prototype.downloadLight = function(bbox, success, fail) { OSM.prototype.downloadLight = function(bbox, success, fail) {
this._requestOverpass( this._requestOverpass(
bbox, bbox,
'(way["indoor"~"room|area|corridor|wall"];relation["indoor"~"room|area|corridor|wall"];way["buildingpart"~"room|verticalpassage|corridor"];relation["buildingpart"~"room|verticalpassage|corridor"];node[~"amenity|shop|railway|highway|door|entrance"~"."];way[~"amenity|shop|railway|highway"~"."];relation[~"amenity|shop|railway|highway"~"."];);out body;>;out skel qt;', '(way["indoor"~"room|area|corridor|wall"];relation["indoor"~"room|area|corridor|wall"];way["buildingpart"~"room|verticalpassage|corridor"];relation["buildingpart"~"room|verticalpassage|corridor"];node[~"amenity|shop|railway|highway|door|entrance"~"."];way[~"amenity|shop|railway|highway|building:levels"~"."];relation[~"amenity|shop|railway|highway|building:levels"~"."];);out body;>;out skel qt;',
function(data) { success(this._process(data)); }.bind(this), function(data) { success(this._process(data)); }.bind(this),
fail fail
); );
......
...@@ -203,6 +203,11 @@ util.listLevels = function(tags, relations) { ...@@ -203,6 +203,11 @@ util.listLevels = function(tags, relations) {
else if(tags["buildingpart:verticalpassage:floorrange"] != undefined) { else if(tags["buildingpart:verticalpassage:floorrange"] != undefined) {
currentLevel = util.parseLevelsFloat(tags["buildingpart:verticalpassage:floorrange"]); currentLevel = util.parseLevelsFloat(tags["buildingpart:verticalpassage:floorrange"]);
} }
//Tag building:levels (and optionally building:min_level)
else if(tags["building:levels"] != undefined) {
var upperLevel = Math.ceil(parseFloat(tags["building:levels"])) - 1;
currentLevel = util.parseLevelsFloat(((tags["building:min_level"] != undefined) ? tags["building:min_level"] : "0")+"-"+upperLevel);
}
//Relations type=level //Relations type=level
else if(relations != undefined && relations.length > 0) { else if(relations != undefined && relations.length > 0) {
currentLevel = []; currentLevel = [];
......
...@@ -113,12 +113,12 @@ area[buildingpart=~/room|corridor|hall/], ...@@ -113,12 +113,12 @@ area[buildingpart=~/room|corridor|hall/],
area[room], area[room],
*[indoor=column], *[indoor=column],
area[building], area[building],
area[building:part=floor], area[building:part],
relation[type=multipolygon][indoor=~/room|corridor/], relation[type=multipolygon][indoor=~/room|corridor/],
relation[type=multipolygon][buildingpart=~/room|corridor|hall/], relation[type=multipolygon][buildingpart=~/room|corridor|hall/],
relation[type=multipolygon][room], relation[type=multipolygon][room],
relation[type=multipolygon][building], relation[type=multipolygon][building],
relation[type=multipolygon][building:part=floor] { relation[type=multipolygon][building:part] {
color: #999999; color: #999999;
opacity: 1; opacity: 1;
width: 2.5; width: 2.5;
...@@ -277,9 +277,9 @@ area[stairs=yes][access=emergency] { ...@@ -277,9 +277,9 @@ area[stairs=yes][access=emergency] {
*/ */
area[building], area[building],
area[building:part=floor], area[building:part],
relation[type=multipolygon][building], relation[type=multipolygon][building],
relation[type=multipolygon][building:part=floor] { relation[type=multipolygon][building:part] {
fill-color: #D4CACA; fill-color: #D4CACA;
fill-opacity: 1; fill-opacity: 1;
z-index: -10; z-index: -10;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment