Commit c368b682 authored by Amon's avatar Amon
Browse files

Study types can be hidden/shown

parent 7d699c1d
......@@ -1011,3 +1011,12 @@ header {
max-height: 25px !important;
max-width: 65px !important;
}
.studyLegend {
cursor: pointer;
}
.studyLegend i {
color: black;
font-style: normal;
padding-left: 3px;
}
......@@ -156,10 +156,10 @@ function makeCumPlot(geojsonData, cumPlotDiv) {
}
console.log(cumFreqATMP);
console.log(cumFreqVaccines);
console.log(cumFreqTradChin);
console.log(cumFreqImpHelpers);
// console.log(cumFreqATMP);
// console.log(cumFreqVaccines);
// console.log(cumFreqTradChin);
// console.log(cumFreqImpHelpers);
//----------------------------------------
......@@ -320,4 +320,4 @@ function makeCumPlot(geojsonData, cumPlotDiv) {
var maxDate = regDates[regDates.length - 1]
return maxDate
};
\ No newline at end of file
};
This diff is collapsed.
L.TimeDimension.Layer.GeoJsonByType = L.TimeDimension.Layer.GeoJson.extend({
initialize: function (geoJsonLayer, options) {
this.geoJsonLayer = geoJsonLayer
L.TimeDimension.Layer.GeoJson.prototype.initialize.call(this, geoJsonLayer, options);
},
/**
* Overwrites the _update method to implement the
* clustering feature to the map items vizualization
*/
_update: function () {
if (!this._map)
return;
if (!this._loaded) {
return;
}
var maxTime = this._timeDimension.getCurrentTime(), minTime = 0;
if (this._duration) {
var date = new Date(maxTime);
L.TimeDimension.Util.subtractTimeDuration(date, this._duration, true);
minTime = date.getTime();
}
// new coordinates:
var layer = L.geoJson(null, this._baseLayer.options);
var layers = this._baseLayer.getLayers();
for (var i = 0, l = layers.length; i < l; i++) {
var feature = this._getFeatureBetweenDates(layers[i].feature, minTime, maxTime);
if (feature && this.disabledTypes.indexOf(feature.properties.classification) === -1) {
layer.addData(feature);
if (this._addlastPoint && feature.geometry.type == "LineString") {
if (feature.geometry.coordinates.length > 0) {
var properties = feature.properties;
properties.last = true;
let coordinates = feature.geometry.coordinates[feature.geometry.coordinates.length - 1]
layer.addData({ type: 'Feature', properties: properties, geometry: {type: 'Point', coordinates: coordinates }});
}
}
}
}
if (this._currentLayer) {
this._map.removeLayer(this._currentLayer);
}
if (layer.getLayers().length) {
layer.addTo(this._map);
this._currentLayer = layer;
}
},
});
L.timeDimension.layer.geoJsonByType = function (geoJsonLayer, options) {
return new L.TimeDimension.Layer.GeoJsonByType(geoJsonLayer, options);
};
......@@ -41,6 +41,7 @@ crossorigin=""></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/iso8601-js-period@0.2.1/iso8601.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/leaflet-timedimension@1.1.1/dist/leaflet.timedimension.min.js"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script src="assets/js/time-dimension-by-type.js" ></script>
<!-- Add Bootstrap -->
<link rel="stylesheet" href="assets/css/bootstrap-tables.css">
......
Supports Markdown
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