[missions] Bugfix: plugin would break and show weird dialogs if the mission markers aren't enabled
This commit is contained in:
		| @@ -785,12 +785,15 @@ window.plugin.missions = { | ||||
| 	}, | ||||
|  | ||||
| 	highlightMissionLayers: function(markers) { | ||||
| 		// layer.bringToFront() will break if the layer is not visible | ||||
| 		var bringToFront = map.hasLayer(plugin.missions.missionLayer); | ||||
| 		 | ||||
| 		this.missionLayer.eachLayer(function(layer) { | ||||
| 			var active = (markers.indexOf(layer) !== -1); | ||||
| 			layer.setStyle({ | ||||
| 				color: active ? this.MISSION_COLOR_ACTIVE : this.MISSION_COLOR, | ||||
| 			}); | ||||
| 			if(active) layer.bringToFront(); | ||||
| 			if(active && bringToFront) layer.bringToFront(); | ||||
| 		}, this); | ||||
| 	}, | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user