2016-03-11 15:47:01 +00:00
|
|
|
// Manhattan
|
2016-06-17 11:19:09 +00:00
|
|
|
var coords = [40.739940, -73.988801];
|
2016-03-11 15:47:01 +00:00
|
|
|
|
2016-03-01 20:34:53 +00:00
|
|
|
var world = VIZI.world('world', {
|
2016-06-17 11:19:09 +00:00
|
|
|
skybox: false,
|
|
|
|
postProcessing: false
|
2016-03-11 15:47:01 +00:00
|
|
|
}).setView(coords);
|
2016-02-12 08:47:08 +00:00
|
|
|
|
2016-02-15 13:21:48 +00:00
|
|
|
// Add controls
|
2016-03-01 20:34:53 +00:00
|
|
|
VIZI.Controls.orbit().addTo(world);
|
2016-02-15 13:21:48 +00:00
|
|
|
|
2016-06-17 11:19:09 +00:00
|
|
|
// CartoDB basemap
|
|
|
|
VIZI.imageTileLayer('http://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png', {
|
2016-03-09 12:26:41 +00:00
|
|
|
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://cartodb.com/attributions">CartoDB</a>'
|
|
|
|
}).addTo(world);
|
2016-02-25 12:27:42 +00:00
|
|
|
|
2016-06-17 11:19:09 +00:00
|
|
|
// Buildings from Mapzen
|
|
|
|
VIZI.topoJSONTileLayer('https://vector.mapzen.com/osm/buildings/{z}/{x}/{y}.topojson?api_key=vector-tiles-NT5Emiw', {
|
2016-04-19 07:43:41 +00:00
|
|
|
interactive: false,
|
|
|
|
style: function(feature) {
|
|
|
|
var height;
|
|
|
|
|
|
|
|
if (feature.properties.height) {
|
|
|
|
height = feature.properties.height;
|
|
|
|
} else {
|
|
|
|
height = 10 + Math.random() * 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
2016-06-17 11:19:09 +00:00
|
|
|
height: height
|
2016-04-19 07:43:41 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
filter: function(feature) {
|
|
|
|
// Don't show points
|
|
|
|
return feature.geometry.type !== 'Point';
|
|
|
|
},
|
|
|
|
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="http://whosonfirst.mapzen.com#License">Who\'s On First</a>.'
|
|
|
|
}).addTo(world);
|