diff pkg/controllers/system.go @ 5423:24156a964eaa marking-single-beam

[WIP] Add support for scan marking points in geoserver.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 08 Jul 2021 12:21:55 +0200
parents 44b032028e48
children 5f47eeea988d
line wrap: on
line diff
--- a/pkg/controllers/system.go	Thu Jul 08 10:53:26 2021 +0200
+++ b/pkg/controllers/system.go	Thu Jul 08 12:21:55 2021 +0200
@@ -194,9 +194,13 @@
 		return nil, err
 	}
 
+	styles := strings.Split(which, ",")
+
 	doBoth := func(req *http.Request) {
 		log.Printf("info: Trigger re-calculation of %s.", which)
-		geoserver.ReconfigureStyle(which)
+		for _, style := range styles {
+			geoserver.ReconfigureStyle(style)
+		}
 		recalc(req)
 	}
 
@@ -228,7 +232,11 @@
 	// Only the color changed -> no expensive recalc needed.
 	if colorChanged {
 		log.Println("info: Only colors changed.")
-		return func(*http.Request) { geoserver.ReconfigureStyle(which) }, nil
+		return func(*http.Request) {
+			for _, style := range styles {
+				geoserver.ReconfigureStyle(style)
+			}
+		}, nil
 	}
 
 	return nil, nil
@@ -239,7 +247,7 @@
 		func(old sql.NullString, curr string) (func(*http.Request), error) {
 			return reconfigureClassBreaks(
 				old, curr,
-				"sounding_results_areas_geoserver",
+				"sounding_results_areas_geoserver,sounding_results_marking_points_geoserver",
 				func(req *http.Request) {
 					if s, ok := auth.GetSession(req); ok {
 						triggerSoundingResultsContoursRecalc(s.User, curr)