[Mapbender-commits] r8632 - in trunk/mapbender/http/extensions/mobilemap: _build js mod_mapbender
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed May 29 06:33:15 PDT 2013
Author: armin11
Date: 2013-05-29 06:33:15 -0700 (Wed, 29 May 2013)
New Revision: 8632
Modified:
trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.js
trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.min.js
trunk/mapbender/http/extensions/mobilemap/js/ngms_event.min.js
trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js
Log:
Remove layers without name from search table - they cannot be invoked ;-)
Modified: trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.js 2013-05-29 10:35:34 UTC (rev 8631)
+++ trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.js 2013-05-29 13:33:15 UTC (rev 8632)
@@ -685,6 +685,7 @@
//
if(querylayer.length>0){
// Abfrage des ausgewählten Layers
+ //if abfrage ob ? vorkommt dann & sonst Fragezeichen
var featureurl = querylayer.attr('getmapurl')
+ '&SERVICE=WMS&REQUEST=getFeatureInfo&VERSION=1.1.1'
+ '&mapfile='+ querylayer.attr('name')
@@ -1112,12 +1113,17 @@
}
// Layer aufnehmen
$.each(srv.layer, function(index, grplayer){
- if(grplayer.layer){
+ if(grplayer.layer){ //wenn sublayer existiert
+ //layer rausnehmen, die keinen namen haben
$.each(grplayer.layer, function(index, lyr){
- layers.push([srv.id,lyr]);
+ if (lyr.name != "") {
+ layers.push([srv.id,lyr]);
+ }
});
} else {
- layers.push([srv.id,grplayer]);
+ if (grplayer.name != "") {
+ layers.push([srv.id,grplayer]);
+ }
}
});
}
Modified: trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.min.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.min.js 2013-05-29 10:35:34 UTC (rev 8631)
+++ trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.min.js 2013-05-29 13:33:15 UTC (rev 8632)
@@ -41,7 +41,8 @@
function switchVisibility(a){$(a).hasClass("layer")?($(a).find(".layer_visibility").toggleClass("layer_checked").toggleClass("layer_unchecked"),selectOpenlayer($(a).attr("layerid"),$(a).find(".layer_visibility").hasClass("layer_checked"))):($("#baselayers").find(".base_checked").addClass("base_unchecked").removeClass("base_checked"),$(a).addClass("base_checked").removeClass("base_unchecked"),setOpenBaselayer($(a).attr("layerids")))}
function base_check(a){$("#baselayers").find(".base_checked").addClass("base_unchecked").removeClass("base_checked");$(a).addClass("base_checked").removeClass("base_unchecked")}
function searchMaps(a){$.mobile.showPageLoadingMsg();$("#search_results").empty();$.getJSON(a,function(a){a=parseMapBenderJson(a);appendData(a.services,a.layers,a.nresults);$.mobile.hidePageLoadingMsg();a.nresults>maxresults&&getInfo("Es gab "+a.nresults+" Treffer, es k\u00f6nnen aber nur "+maxresults+" Ergebnisse angezeigt werden.</br><b>Schr\u00e4nken Sie Ihre Suche weiter ein.</b>")})}
-function searchWmc(a){$.mobile.showPageLoadingMsg();$("#search_results").empty();$.getJSON(a,function(a){appendWmc(a);$.mobile.hidePageLoadingMsg()})}function parseMapBenderJson(a){var b=[],c=[];$.each(a.wms.srv,function(a,e){for(var f=!1,g=0;g<b.length;g++)if(b[g].id==e.id){f=!0;break}!e.logged&&!e.nwaccess&&(f||b.push(e),$.each(e.layer,function(a,b){b.layer?$.each(b.layer,function(a,b){c.push([e.id,b])}):c.push([e.id,b])}))});return{services:b,layers:c,nresults:a.wms.md.nresults}}
+function searchWmc(a){$.mobile.showPageLoadingMsg();$("#search_results").empty();$.getJSON(a,function(a){appendWmc(a);$.mobile.hidePageLoadingMsg()})}
+function parseMapBenderJson(a){var b=[],c=[];$.each(a.wms.srv,function(a,e){for(var f=!1,g=0;g<b.length;g++)if(b[g].id==e.id){f=!0;break}!e.logged&&!e.nwaccess&&(f||b.push(e),$.each(e.layer,function(a,b){b.layer?$.each(b.layer,function(a,b){""!=b.name&&c.push([e.id,b])}):""!=b.name&&c.push([e.id,b])}))});return{services:b,layers:c,nresults:a.wms.md.nresults}}
function appendData(a,b,c){$("#resultlist").empty();for(var d=0;d<a.length;d++){var e=a[d];service=Service(e.id,e.title,$(e).attr("abstract"),e.getMapUrl,e.status,""==e.logoUrl?"mod_mapbender/img/defaulicon.png":e.logoUrl,e.symbolLink,e.avail);for(var f=0;f<b.length;f++){var g=b[f],h=g[1];g[0]==e.id&&service.append(ResultLayer(h.id,h.title,h.name,$(h).attr("abstract"),h.previewURL,"1"==h.queryable,e.getMapUrl,h.bbox))}$("#resultlist").append(service)}$("#resultlist").prepend('<li data-theme="b">Suchergebnis: '+
numServices()+" Dienste, "+numResultLayers($("#resultlist"))+" Layer ("+c+" Treffer) </li>");validateLayers();refresh()}
function appendWmcData(a,b,c,d,e){$("#ownlist").empty();for(var f=[],g=0;g<a.length;g++)for(var h=a[g],j=0;j<b.length;j++){var k=b[j],l=k[1];k[0]==h.id&&f.push(OwnLayer(l.id,l.title,l.name,$(l).attr("abstract"),h.title,$(h).attr("abstract"),l.previewURL,"1"==l.queryable,h.getMapUrl,l.bbox,h.avail))}for(g=0;g<c.length;g++)for(j=0;j<f.length;j++)if(c[g].layerId==f[j].attr("layerid")){k=f[j];$("#ownlist").append(k);addOpenlayer(k.attr("layerid"),k.attr("name"),k.attr("getMapUrl"));c[g].active||switchVisibility(k);
Modified: trunk/mapbender/http/extensions/mobilemap/js/ngms_event.min.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/js/ngms_event.min.js 2013-05-29 10:35:34 UTC (rev 8631)
+++ trunk/mapbender/http/extensions/mobilemap/js/ngms_event.min.js 2013-05-29 13:33:15 UTC (rev 8632)
@@ -41,7 +41,8 @@
function switchVisibility(a){$(a).hasClass("layer")?($(a).find(".layer_visibility").toggleClass("layer_checked").toggleClass("layer_unchecked"),selectOpenlayer($(a).attr("layerid"),$(a).find(".layer_visibility").hasClass("layer_checked"))):($("#baselayers").find(".base_checked").addClass("base_unchecked").removeClass("base_checked"),$(a).addClass("base_checked").removeClass("base_unchecked"),setOpenBaselayer($(a).attr("layerids")))}
function base_check(a){$("#baselayers").find(".base_checked").addClass("base_unchecked").removeClass("base_checked");$(a).addClass("base_checked").removeClass("base_unchecked")}
function searchMaps(a){$.mobile.showPageLoadingMsg();$("#search_results").empty();$.getJSON(a,function(a){a=parseMapBenderJson(a);appendData(a.services,a.layers,a.nresults);$.mobile.hidePageLoadingMsg();a.nresults>maxresults&&getInfo("Es gab "+a.nresults+" Treffer, es k\u00f6nnen aber nur "+maxresults+" Ergebnisse angezeigt werden.</br><b>Schr\u00e4nken Sie Ihre Suche weiter ein.</b>")})}
-function searchWmc(a){$.mobile.showPageLoadingMsg();$("#search_results").empty();$.getJSON(a,function(a){appendWmc(a);$.mobile.hidePageLoadingMsg()})}function parseMapBenderJson(a){var b=[],c=[];$.each(a.wms.srv,function(a,e){for(var f=!1,g=0;g<b.length;g++)if(b[g].id==e.id){f=!0;break}!e.logged&&!e.nwaccess&&(f||b.push(e),$.each(e.layer,function(a,b){b.layer?$.each(b.layer,function(a,b){c.push([e.id,b])}):c.push([e.id,b])}))});return{services:b,layers:c,nresults:a.wms.md.nresults}}
+function searchWmc(a){$.mobile.showPageLoadingMsg();$("#search_results").empty();$.getJSON(a,function(a){appendWmc(a);$.mobile.hidePageLoadingMsg()})}
+function parseMapBenderJson(a){var b=[],c=[];$.each(a.wms.srv,function(a,e){for(var f=!1,g=0;g<b.length;g++)if(b[g].id==e.id){f=!0;break}!e.logged&&!e.nwaccess&&(f||b.push(e),$.each(e.layer,function(a,b){b.layer?$.each(b.layer,function(a,b){""!=b.name&&c.push([e.id,b])}):""!=b.name&&c.push([e.id,b])}))});return{services:b,layers:c,nresults:a.wms.md.nresults}}
function appendData(a,b,c){$("#resultlist").empty();for(var d=0;d<a.length;d++){var e=a[d];service=Service(e.id,e.title,$(e).attr("abstract"),e.getMapUrl,e.status,""==e.logoUrl?"mod_mapbender/img/defaulicon.png":e.logoUrl,e.symbolLink,e.avail);for(var f=0;f<b.length;f++){var g=b[f],h=g[1];g[0]==e.id&&service.append(ResultLayer(h.id,h.title,h.name,$(h).attr("abstract"),h.previewURL,"1"==h.queryable,e.getMapUrl,h.bbox))}$("#resultlist").append(service)}$("#resultlist").prepend('<li data-theme="b">Suchergebnis: '+
numServices()+" Dienste, "+numResultLayers($("#resultlist"))+" Layer ("+c+" Treffer) </li>");validateLayers();refresh()}
function appendWmcData(a,b,c,d,e){$("#ownlist").empty();for(var f=[],g=0;g<a.length;g++)for(var h=a[g],j=0;j<b.length;j++){var k=b[j],l=k[1];k[0]==h.id&&f.push(OwnLayer(l.id,l.title,l.name,$(l).attr("abstract"),h.title,$(h).attr("abstract"),l.previewURL,"1"==l.queryable,h.getMapUrl,l.bbox,h.avail))}for(g=0;g<c.length;g++)for(j=0;j<f.length;j++)if(c[g].layerId==f[j].attr("layerid")){k=f[j];$("#ownlist").append(k);addOpenlayer(k.attr("layerid"),k.attr("name"),k.attr("getMapUrl"));c[g].active||switchVisibility(k);
Modified: trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js 2013-05-29 10:35:34 UTC (rev 8631)
+++ trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js 2013-05-29 13:33:15 UTC (rev 8632)
@@ -93,6 +93,7 @@
//
if(querylayer.length>0){
// Abfrage des ausgewählten Layers
+ //if abfrage ob ? vorkommt dann & sonst Fragezeichen
var featureurl = querylayer.attr('getmapurl')
+ '&SERVICE=WMS&REQUEST=getFeatureInfo&VERSION=1.1.1'
+ '&mapfile='+ querylayer.attr('name')
@@ -520,12 +521,17 @@
}
// Layer aufnehmen
$.each(srv.layer, function(index, grplayer){
- if(grplayer.layer){
+ if(grplayer.layer){ //wenn sublayer existiert
+ //layer rausnehmen, die keinen namen haben
$.each(grplayer.layer, function(index, lyr){
- layers.push([srv.id,lyr]);
+ if (lyr.name != "") {
+ layers.push([srv.id,lyr]);
+ }
});
} else {
- layers.push([srv.id,grplayer]);
+ if (grplayer.name != "") {
+ layers.push([srv.id,grplayer]);
+ }
}
});
}
More information about the Mapbender_commits
mailing list