[Mapbender-commits] r10354 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Nov 22 05:37:01 PST 2019


Author: armin11
Date: 2019-11-22 05:37:00 -0800 (Fri, 22 Nov 2019)
New Revision: 10354

Modified:
   trunk/mapbender/http/plugins/mod_metadataCarouselTinySlider.php
   trunk/mapbender/http/plugins/wfsConfTree.js
   trunk/mapbender/http/plugins/wfsConfTree_single.js
Log:
Fix for loading wfs_conf dynamically, if wmc is loaded from new module metadataCarouselTinySlider.

Modified: trunk/mapbender/http/plugins/mod_metadataCarouselTinySlider.php
===================================================================
--- trunk/mapbender/http/plugins/mod_metadataCarouselTinySlider.php	2019-11-22 12:36:30 UTC (rev 10353)
+++ trunk/mapbender/http/plugins/mod_metadataCarouselTinySlider.php	2019-11-22 13:37:00 UTC (rev 10354)
@@ -140,6 +140,12 @@
         //hide during initialization
         //$('#' + options.id).hide();
 
+	//add event for loaded wmc like done in javascripts/mod_loadwmc.js
+	/*this.events = {
+		loaded: new Mapbender.Event()
+	};*/
+
+
         //add 3 dummy slides to container identified by class dummy
         this.sliderContainer.append('<div class="slider-item dummy"><div class="card"><img src="https://www.geoportal.rlp.de/mapbender/geoportal/mod_showPreview.php?resource=wmc&id=2506" alt=""><h2>Titel 1</h2><p class="card_description">Loresm ipsum dolor sit amet consectetur adipisicing elit. Dignissimos, voluptas!</p></div></div><div class="slider-item dummy"><div class="card"><img src="https://www.geoportal.rlp.de/mapbender/geoportal/mod_showPreview.php?resource=wmc&id=2506" alt=""><h2>Titel 2</h2><p class="card_description">Loresm ipsum dolor sit amet consectetur adipisicing elit. Dignissimos, voluptas!</p></div></div><div class="slider-item dummy"><div class="card"><img src="https://www.geoportal.rlp.de/mapbender/geoportal/mod_showPreview.php?resource=wmc&id=2506" alt=""><h2>Titel 3</h2><p class="card_description">Loresm ipsum dolor sit amet consectetur adipisicing elit. Dignissimos, voluptas!</p></div></div>');
     }
@@ -321,7 +327,7 @@
 						    //following will not work, because event is not defined here
 						    //that.events.loaded.trigger({
 						    //		extensionData: restoredWmcExtensionData
-						    //	});
+						    //});
                                                 //following copied from wfsConTree.js - because there it is only called via loadwmc module, which is not available in new GUI types (>2019 fullcreen with new layout. wfsConfTree.js / wfsConfTree_single.js triggers the loadwmc module!)
 						/*load wfs confs via ajax*/
                                                 if (restoredWmcExtensionData && restoredWmcExtensionData.WFSCONFIDSTRING) {
@@ -332,7 +338,11 @@
 									wfsConfIdString: restoredWmcExtensionData.WFSCONFIDSTRING
 								},
 								callback: function(result,success,message){
-									//reset(result);
+                                                                        //alert("try to reset wfsConfTree");
+									//alert(JSON.stringify(Mapbender.modules.wfsConfTree));
+									if (Mapbender.modules.wfsConfTree) {
+									    Mapbender.modules.wfsConfTree.reset(result);
+									}
 								}
 							});
 							req.send();

Modified: trunk/mapbender/http/plugins/wfsConfTree.js
===================================================================
--- trunk/mapbender/http/plugins/wfsConfTree.js	2019-11-22 12:36:30 UTC (rev 10353)
+++ trunk/mapbender/http/plugins/wfsConfTree.js	2019-11-22 13:37:00 UTC (rev 10354)
@@ -42,7 +42,7 @@
 						wfsConfIdString: obj.extensionData.WFSCONFIDSTRING
 					},
 					callback: function(result,success,message){
-						reset(result);
+						that.reset(result);
 					}
 				});
 				req.send();
@@ -69,7 +69,7 @@
 
 		}
 	});
-	var reset = function(aWFSConf){
+	this.reset = function(aWFSConf){
 		wfsconfs = [];
 		$confTree.children().remove();
 		$confTree.append("<li class='emptymessage'>"+translatedI18nObject.labelNoWfsConfAvailable+"</li>");
@@ -162,7 +162,7 @@
 						newWFSConf.push(currentWFSConf[i]);
 					}
 				}
-				reset(newWFSConf);
+				that.reset(newWFSConf);
 					
 			});
 		}
@@ -184,7 +184,7 @@
 				wfsConfIdString: wfsConfIdString
 			},
 			callback: function(result,success,message){
-				reset(result);
+				that.reset(result);
 			}
 		});
 		req.send();
@@ -201,7 +201,7 @@
 				wfsConfIdString: obj.wfsConfIdString
 			},
 			callback: function(result,success,message){
-				reset(result);
+				that.reset(result);
 			}
 		});
 		req.send();

Modified: trunk/mapbender/http/plugins/wfsConfTree_single.js
===================================================================
--- trunk/mapbender/http/plugins/wfsConfTree_single.js	2019-11-22 12:36:30 UTC (rev 10353)
+++ trunk/mapbender/http/plugins/wfsConfTree_single.js	2019-11-22 13:37:00 UTC (rev 10354)
@@ -42,7 +42,7 @@
 						wfsConfIdString: obj.extensionData.WFSCONFIDSTRING
 					},
 					callback: function(result,success,message){
-						reset(result);
+						that.reset(result);
 					}
 				});
 				req.send();
@@ -66,7 +66,7 @@
 
 		}
 	});
-	var reset = function(aWFSConf){
+	this.reset = function(aWFSConf){
 		wfsconfs = [];
 		$confTree.children().remove();
 		$confTree.append("<li class='emptymessage'>"+translatedI18nObject.labelNoWfsConfAvailable+"</li>");
@@ -161,7 +161,7 @@
 						newWFSConf.push(currentWFSConf[i]);
 					}
 				}
-				reset(newWFSConf);
+				that.reset(newWFSConf);
 					
 			});
 		}
@@ -183,7 +183,7 @@
 				wfsConfIdString: wfsConfIdString
 			},
 			callback: function(result,success,message){
-				reset(result);
+				that.reset(result);
 			}
 		});
 		req.send();
@@ -200,7 +200,7 @@
 				wfsConfIdString: obj.wfsConfIdString
 			},
 			callback: function(result,success,message){
-				reset(result);
+				that.reset(result);
 			}
 		});
 		req.send();



More information about the Mapbender_commits mailing list