Skip to content

Commit

Permalink
Improve building style
Browse files Browse the repository at this point in the history
  • Loading branch information
bchapuis committed Nov 9, 2023
1 parent 6dfc7dc commit f9313b9
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 11 deletions.
7 changes: 6 additions & 1 deletion .run/basemap-dev.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
<configuration default="false" name="basemap-dev" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="org.apache.baremaps.cli.Baremaps" />
<module name="baremaps-cli" />
<option name="PROGRAM_PARAMETERS" value="map dev --tileset tileset.js --style style.js" />
<option name="PROGRAM_PARAMETERS" value="map dev --tileset tileset.js --style style.js --log-level DEBUG" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/basemap" />
<extension name="software.aws.toolkits.jetbrains.core.execution.JavaAwsConnectionExtension">
<option name="credential" />
<option name="region" />
<option name="useCurrentConnection" value="false" />
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import org.apache.baremaps.tilestore.TileCoord;
import org.apache.baremaps.tilestore.TileStore;
import org.apache.baremaps.tilestore.TileStoreException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* A resource that provides access to the tiles.
Expand All @@ -37,6 +39,8 @@
@javax.ws.rs.Path("/")
public class TileResource {

private static final Logger logger = LoggerFactory.getLogger(TileResource.class);

public static final String TILE_ENCODING = "gzip";

public static final String TILE_TYPE = "application/vnd.mapbox-vector-tile";
Expand Down Expand Up @@ -68,6 +72,7 @@ public Response getTile(@PathParam("z") int z, @PathParam("x") int x, @PathParam
return Response.status(204).build();
}
} catch (TileStoreException ex) {
logger.error("Error while reading tile.", ex);
return Response.status(404).build();
}
}
Expand Down
14 changes: 7 additions & 7 deletions basemap/layers/building/extrusion.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default {
layout: {
visibility: 'visible',
},
minzoom: 16,
minzoom: 15,
paint: {
"fill-extrusion-color": [
"case",
Expand All @@ -37,27 +37,27 @@ export default {
'interpolate',
['linear'],
['zoom'],
16,
15,
0,
17,
16,
['get', "extrusion:base"]
],
"fill-extrusion-height": [
'interpolate',
['linear'],
['zoom'],
16,
15,
0,
17,
16,
['get', "extrusion:height"]
],
"fill-extrusion-opacity": [
'interpolate',
['linear'],
['zoom'],
16,
15,
0,
17,
16,
0.8
]
},
Expand Down
7 changes: 7 additions & 0 deletions basemap/layers/building/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,12 @@ export default {
'fill-antialias': false,
'fill-color': theme.buildingShapeFillColor,
'fill-outline-color': theme.buildingShapeFillOutlineColor,
'fill-opacity': [
'interpolate',
['linear'],
['zoom'],
13, 0,
13.5, 1
]
},
}
4 changes: 2 additions & 2 deletions basemap/layers/building/tileset.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default {
THEN tags ->> 'building:height'
WHEN tags ->> 'building:levels' ~ '^[0-9\\\\\\\\.]+$'
THEN tags ->> 'building:levels'
ELSE '2' END)::real * 3),
ELSE '2' END)::real * 3) as tags,
geom
FROM osm_ways
WHERE tags ? 'building'`,
Expand All @@ -59,7 +59,7 @@ export default {
THEN tags ->> 'building:height'
WHEN tags ->> 'building:levels' ~ '^[0-9\\\\\\\\.]+$'
THEN tags ->> 'building:levels'
ELSE '2' END)::real * 3),
ELSE '2' END)::real * 3) as tags,
geom
FROM osm_relations
WHERE tags ? 'building'`,
Expand Down
2 changes: 1 addition & 1 deletion basemap/tileset.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ export default {
power,
railway,
route,
//waterway,
waterway,
]
}

0 comments on commit f9313b9

Please sign in to comment.