[Mapbender-commits] r10353 - trunk/mapbender/http/plugins
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Nov 22 04:36:31 PST 2019
Author: armin11
Date: 2019-11-22 04:36:30 -0800 (Fri, 22 Nov 2019)
New Revision: 10353
Modified:
trunk/mapbender/http/plugins/mod_metadataCarouselTinySlider.php
Log:
Fix for loading wmc from metadataCarouselTinySlider - also loads the wfs_conf elements
Modified: trunk/mapbender/http/plugins/mod_metadataCarouselTinySlider.php
===================================================================
--- trunk/mapbender/http/plugins/mod_metadataCarouselTinySlider.php 2019-11-22 10:19:26 UTC (rev 10352)
+++ trunk/mapbender/http/plugins/mod_metadataCarouselTinySlider.php 2019-11-22 12:36:30 UTC (rev 10353)
@@ -201,6 +201,7 @@
this.fillInitialMetadata = function() {
//initialize slider from first request to search interface
var initialResult = $.ajax({url: searchUrl+"searchText=*&searchResources=wmc&maxResults="+maxResults+that.resourceFilterString, async: false, success: function(result){
+ //var initialResult = $.ajax({url: searchUrl+"searchText=*&searchResources=wmc&maxResults="+maxResults+that.resourceFilterString, async: true, success: function(result){
if (result.valid)
return true;
else
@@ -258,7 +259,10 @@
this.removeEvent = function(){
that.mainSlider.events.off('indexChanged', that.customizedFunction);
}
-
+ //wait some time?
+ //setTimeout(that.fillInitialMetadata(), 3000);
+ //workaround
+ var kml = $('#mapframe1').data('kml');
that.fillInitialMetadata();
that.addEvent();
@@ -314,10 +318,27 @@
// just ignore the exception for now
}
}
- that.events.loaded.trigger({
- extensionData: restoredWmcExtensionData
+ //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) {
+ var req = Mapbender.Ajax.Request({
+ url: "../php/mod_wfs_conf_server.php",
+ method: "getWfsConfsFromId",
+ parameters: {
+ wfsConfIdString: restoredWmcExtensionData.WFSCONFIDSTRING
+ },
+ callback: function(result,success,message){
+ //reset(result);
+ }
});
+ req.send();
}
+ /*end load wfs confs via ajax*/
+ }
}
that.hide();
new Mapbender.Notice(args.message);
@@ -331,6 +352,8 @@
};
}
//register object in mapbender!
+
+
Mapbender.events.init.register(function() {
Mapbender.modules[options.id] = $.extend(new metadataCarouselTinySlider(),Mapbender.modules[options.id]);
});
More information about the Mapbender_commits
mailing list