proper train display

This commit is contained in:
Thomas Rudin 2019-04-03 21:31:36 +02:00
parent 798cdb4d0a
commit ace90fe432
3 changed files with 16 additions and 2 deletions

View File

@ -43,10 +43,14 @@ var AbstractGeoJsonOverlay = L.LayerGroup.extend({
return geoJsonLayer;
},
getMaxDisplayedZoom: function(){
return 7;
},
reDraw: function(){
var self = this;
if (this.map.getZoom() < 10) {
if (this.map.getZoom() < this.getMaxDisplayedZoom()) {
this.clearLayers();
return;
}

View File

@ -137,7 +137,7 @@ var TrainOverlay = L.LayerGroup.extend({
var mapLayer = this.layerMgr.getCurrentLayer()
this.trains.forEach(function(train){
if (!self.isPlayerInCurrentLayer(train)){
if (!self.isTrainInCurrentLayer(train)){
//not in current layer
return;
}

View File

@ -15,6 +15,16 @@ var TrainlineOverlay = AbstractGeoJsonOverlay.extend({
}
},
pointToLayer: function (feature, latlng) {
var geojsonMarkerOptions = {
radius: 8,
fillColor: "#ff7800",
color: "#000",
weight: 1,
opacity: 1,
fillOpacity: 0.8
};
return L.circleMarker(latlng, geojsonMarkerOptions);
}
});