Commit a4aaa34c authored by Jonas Heinrich's avatar Jonas Heinrich

further modelling museum building

parent d589f223
...@@ -4,6 +4,7 @@ body { ...@@ -4,6 +4,7 @@ body {
font-size: 14px; font-size: 14px;
line-height: 25px; line-height: 25px;
color: white; color: white;
background: #142736;
} }
p { p {
......
This diff is collapsed.
{
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {
"description": "<strong>Take a long break I, II</strong><p>von Marijke van Warmerdam (2006), ZKM</p>",
"icon": "theatre",
"link": "video/video1.html"
},
"geometry": {
"type": "Point",
"coordinates": [8.40444, 49.01445]
}
}, {
"type": "Feature",
"properties": {
"description": "<strong>Großes Stillleben mit Kerzen und Spiegel</strong><p>von Max Beckmann (1930), Orangerie</p>",
"icon": "music",
"link": "video/video2.html"
},
"geometry": {
"type": "Point",
"coordinates": [8.40454, 49.01455]
}
}]
}
This diff is collapsed.
...@@ -8,7 +8,7 @@ var bounds = [ ...@@ -8,7 +8,7 @@ var bounds = [
mapboxgl.accessToken = 'pk.eyJ1Ijoib25ueSIsImEiOiJjajhvdnc1eTgwOTM3MnFudG81MXlpZGJrIn0.lDC0PwJDf704okmeI6w61g'; mapboxgl.accessToken = 'pk.eyJ1Ijoib25ueSIsImEiOiJjajhvdnc1eTgwOTM3MnFudG81MXlpZGJrIn0.lDC0PwJDf704okmeI6w61g';
var map = new mapboxgl.Map({ var map = new mapboxgl.Map({
container: 'map', container: 'map',
style: 'mapbox://styles/mapbox/light-v9', style: 'mapbox://styles/mapbox/streets-v9',
center: [8.404, 49.0150], center: [8.404, 49.0150],
zoom: 14, zoom: 14,
pitch: 0, pitch: 0,
...@@ -34,6 +34,44 @@ map.on('load', function() { ...@@ -34,6 +34,44 @@ map.on('load', function() {
map.setMaxBounds(bounds); map.setMaxBounds(bounds);
}); });
map.addLayer({
'id': '3d-buildings',
'source': 'composite',
'source-layer': 'building',
'filter': ['==', 'extrude', 'true'],
'type': 'fill-extrusion',
'minzoom': 15,
'paint': {
'fill-extrusion-color': '#aaa',
// use an 'interpolate' expression to add a smooth transition effect to the
// buildings as the user zooms in
'fill-extrusion-height': [
"interpolate", ["linear"], ["zoom"],
15, 0,
15.05, ["get", "height"]
],
'fill-extrusion-base': [
"interpolate", ["linear"], ["zoom"],
15, 0,
15.05, ["get", "min_height"]
],
'fill-extrusion-opacity': .6
}
}, labelLayerId);
map.addSource('museum', { type: 'geojson', data: 'geojson/museum.geojson' });
map.addLayer({
"id": "exhibits",
"type": "circle",
"source": 'museum',
"paint": {
"circle-radius": 6,
"circle-color": "#B42222"
},
"filter": ["==", "$type", "Point"],
});
// Insert the layer beneath any symbol layer. // Insert the layer beneath any symbol layer.
var layers = map.getStyle().layers; var layers = map.getStyle().layers;
...@@ -46,16 +84,15 @@ map.on('load', function() { ...@@ -46,16 +84,15 @@ map.on('load', function() {
} }
map.addLayer({ map.addLayer({
"id": "exhibits", 'id': 'museum-building',
"type": "symbol", 'type': 'fill-extrusion',
"source": { 'source': 'museum',
"type": "geojson", 'paint': {
"data": "geojson/exhibits.geojson" 'fill-extrusion-color': ['get', 'color'],
}, 'fill-extrusion-height': ['get', 'height'],
"layout": { 'fill-extrusion-base': ['get', 'base_height'],
"icon-image": "{icon}-15", 'fill-extrusion-opacity': 0.5
"icon-allow-overlap": true }
}
}); });
var popup = new mapboxgl.Popup({ var popup = new mapboxgl.Popup({
...@@ -78,47 +115,7 @@ map.on('load', function() { ...@@ -78,47 +115,7 @@ map.on('load', function() {
map.on('click', 'exhibits', function (e) { map.on('click', 'exhibits', function (e) {
var link = e.features[0].properties.link; var link = e.features[0].properties.link;
$( "content" ).empty(); $( "content" ).empty();
$( "content" ).load( link ); $("content").hide().load(link).fadeIn('slow');
});
map.addLayer({
'id': '3d-buildings',
'source': 'composite',
'source-layer': 'building',
'filter': ['==', 'extrude', 'true'],
'type': 'fill-extrusion',
'minzoom': 15,
'paint': {
'fill-extrusion-color': '#aaa',
// use an 'interpolate' expression to add a smooth transition effect to the
// buildings as the user zooms in
'fill-extrusion-height': [
"interpolate", ["linear"], ["zoom"],
15, 0,
15.05, ["get", "height"]
],
'fill-extrusion-base': [
"interpolate", ["linear"], ["zoom"],
15, 0,
15.05, ["get", "min_height"]
],
'fill-extrusion-opacity': .6
}
}, labelLayerId);
map.addLayer({
'id': 'room-extrusion',
'type': 'fill-extrusion',
'source': {
'type': 'geojson',
'data': 'geojson/museum.geojson'
},
'paint': {
'fill-extrusion-color': ['get', 'color'],
'fill-extrusion-height': ['get', 'height'],
'fill-extrusion-base': ['get', 'base_height'],
'fill-extrusion-opacity': 0.5
}
}); });
}); });
This diff is collapsed.
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