[Mapbender-commits] r6462 - trunk/mapbender/http/plugins
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Jun 29 11:06:22 EDT 2010
Author: kmq
Date: 2010-06-29 15:06:22 +0000 (Tue, 29 Jun 2010)
New Revision: 6462
Added:
trunk/mapbender/http/plugins/mb_selectorwizard.js
Modified:
trunk/mapbender/http/plugins/mb_wfsGazetteer.js
Log:
new containerplugin, new gazetteer now displays search results in resultList
Added: trunk/mapbender/http/plugins/mb_selectorwizard.js
===================================================================
--- trunk/mapbender/http/plugins/mb_selectorwizard.js (rev 0)
+++ trunk/mapbender/http/plugins/mb_selectorwizard.js 2010-06-29 15:06:22 UTC (rev 6462)
@@ -0,0 +1,49 @@
+var $wizard = $(this);
+
+var WizardApi = function (o) {
+ var that = this;
+
+ this.events = {
+ onBeforeClickLink: new Mapbender.Event(),
+ onClickLink: new Mapbender.Event(),
+ onNavigate : new Mapbender.Event()
+ };
+
+ $select = $('<select></select>');
+
+ Mapbender.events.init.register(function () {
+ if (o.$target.size() > 0) {
+ $wizard.append(o.$target).wizard({
+ fade: true,
+ startWith: o.$target.eq(0),
+ onClickLink: function ($targets) {
+ that.events.onClickLink.trigger({
+ path: $targets
+ });
+ },
+ onBeforeClickLink: function (evt, $link) {
+ var proceed = that.events.onBeforeClickLink.trigger({
+ evt: evt,
+ $link: $link
+ }, "AND");
+ return proceed;
+ },
+ onNavigate: function($target){
+ $select.val($target.attr('id'));
+ }
+ });
+ }
+ });
+
+ $wizard.prepend($select);
+ o.$target.each(function(){
+ $option = $('<option></option>').attr('value',this.id).text($(this).attr('title'));
+ $select.append($option);
+ });
+ $select.change(function(){
+ $wizard.wizard('to',$('#' + $(this).val()));
+ });
+
+};
+
+$wizard.mapbender(new WizardApi(options));
Modified: trunk/mapbender/http/plugins/mb_wfsGazetteer.js
===================================================================
--- trunk/mapbender/http/plugins/mb_wfsGazetteer.js 2010-06-29 15:00:29 UTC (rev 6461)
+++ trunk/mapbender/http/plugins/mb_wfsGazetteer.js 2010-06-29 15:06:22 UTC (rev 6462)
@@ -6,7 +6,15 @@
}, function(json, status) {
var wfsConf = $.parseJSON(json);
$gazetteer.wfsGazetteer({
- wfsConf: wfsConf[options.wfsConf]
+ wfsConf: wfsConf[options.wfsConf],
+ receivefeaturecollection : function(e,data){
+ // trigger compatibility event for wfsGazeteer ?
+ var resultList = Mapbender.modules.resultList;
+ resultList.clear();
+ resultList.setTitle(data.wfsConf.wfs_conf_abstract);
+ resultList.setWFSconf(data.wfsConf);
+ resultList.addFeatureCollection(data.featureCollection);
+ resultList.show();
+ }
});
});
-
More information about the Mapbender_commits
mailing list