do not show listing where sqm is not available when we vizualive sqm-based metrics
This commit is contained in:
parent
20ab7fde95
commit
abf06be0a7
2 changed files with 4 additions and 235 deletions
|
|
@ -31,33 +31,15 @@ function update() {
|
|||
|
||||
// init heatmap
|
||||
heatmap = new HexgridHeatmap(map, "hexgrid-heatmap", "waterway-label");
|
||||
// heatmap = new HexgridHeatmap(map, {
|
||||
// id: 'hexgrid-heatmap',
|
||||
// data: data,
|
||||
// radius: 500, // meters
|
||||
// colorRange: [
|
||||
// [0, '#ffffcc'],
|
||||
// [0.5, '#fd8d3c'],
|
||||
// [1, '#bd0026']
|
||||
// ],
|
||||
// showPoints: true
|
||||
// });
|
||||
heatmap.setIntensity(9); // dunno yet
|
||||
heatmap.setSpread(0.05); // dunno yet
|
||||
heatmap.setCellDensity(0.5); // small value == bigger hexagons
|
||||
heatmap.setPropertyName(filter.mode);
|
||||
|
||||
// // Add click handler
|
||||
// heatmap.onClick((event) => {
|
||||
// new mapboxgl.Popup()
|
||||
// .setLngLat(event.coordinates)
|
||||
// .setHTML(`
|
||||
// <h3>Hexagon Data</h3>
|
||||
// <p>Points: ${event.properties.count}</p>
|
||||
// <p>Density: ${event.properties.normalizedValue.toFixed(2)}</p>
|
||||
// `)
|
||||
// .addTo(map);
|
||||
// });
|
||||
if (filter.mode === 'qmprice') {
|
||||
// if we visualize sqm based data, remove properties where we have no data
|
||||
qmDim.filter(function (d) { return d > 0; });
|
||||
}
|
||||
|
||||
|
||||
// set filter
|
||||
|
|
@ -252,64 +234,3 @@ function getPropertyHTML(property) {
|
|||
`;
|
||||
|
||||
}
|
||||
|
||||
// END ORIGINAL BLOCK
|
||||
|
||||
|
||||
|
||||
// // Initialize map
|
||||
// const map = new mapboxgl.Map({
|
||||
// container: 'map',
|
||||
// style: 'mapbox://styles/mapbox/light-v10',
|
||||
// center: [13.38032, 49.994210],
|
||||
// zoom: 5
|
||||
// });
|
||||
|
||||
|
||||
// // Create heatmap when map loads
|
||||
// map.on('load', () => {
|
||||
// const heatmap = new HexgridHeatmap(map, {
|
||||
// id: 'lon-hexgrid',
|
||||
// data: data,
|
||||
// radius: 500, // meters
|
||||
// colorRange: [
|
||||
// [0, '#ffffcc'],
|
||||
// [0.5, '#fd8d3c'],
|
||||
// [1, '#bd0026']
|
||||
// ],
|
||||
// showPoints: true
|
||||
// });
|
||||
|
||||
// var crossData = data.features.map(function (d, i) {
|
||||
// //clone properties
|
||||
// var props = clone(d['properties']);
|
||||
// props['index'] = i;
|
||||
// return props;
|
||||
// });
|
||||
// cf = crossfilter(crossData);
|
||||
// qmDim = cf.dimension(function (d) { return d.qm; });
|
||||
// cityDim = cf.dimension(function (d) { return d.city; });
|
||||
// countryDim = cf.dimension(function (d) { return d.country; });
|
||||
// rentDim = cf.dimension(function (d) { return d.total_price; });
|
||||
// roomsDim = cf.dimension(function (d) { return d.rooms; });
|
||||
// indexDim = cf.dimension(function (d) { return d.index; });
|
||||
|
||||
// // // Add click handler
|
||||
// // heatmap.onClick((event) => {
|
||||
// // new mapboxgl.Popup()
|
||||
// // .setLngLat(event.coordinates)
|
||||
// // .setHTML(`
|
||||
// // <h3>Hexagon Data</h3>
|
||||
// // <p>Points: ${event.properties.count}</p>
|
||||
// // <p>Density: ${event.properties.normalizedValue.toFixed(2)}</p>
|
||||
// // `)
|
||||
// // .addTo(map);
|
||||
// // });
|
||||
|
||||
// // Example of updating data later
|
||||
// // document.getElementById('update-btn').addEventListener('click', () => {
|
||||
// // fetch('new-data.json')
|
||||
// // .then(res => res.json())
|
||||
// // .then(newData => heatmap.updateData(newData));
|
||||
// // });
|
||||
// });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue