[Mapbender-commits] r8621 - in trunk/mapbender/http: extensions/mobilemap extensions/mobilemap/_build extensions/mobilemap/js extensions/mobilemap/mod_mapbender php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon May 20 06:58:16 PDT 2013


Author: armin11
Date: 2013-05-20 06:58:14 -0700 (Mon, 20 May 2013)
New Revision: 8621

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/map.php
   trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js
   trunk/mapbender/http/php/mod_exportWmc2Json.php
   trunk/mapbender/http/php/mod_getWmcDisclaimer.php
Log:
Possibility to set the extent for the mobile client by a http-get parameter.

Modified: trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.js	2013-05-14 14:37:38 UTC (rev 8620)
+++ trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.js	2013-05-20 13:58:14 UTC (rev 8621)
@@ -829,7 +829,7 @@
 	});
 }
 
-// Zoomen auf bestimmte Boundingbox
+// Zoomen auf bestimmte Boundingbox (in WGS84 gegeben!)
 function zoomToBbox(bbox){
 	var extend=bbox.split(',');
 	var p1 = new OpenLayers.LonLat(extend[0],extend[1]).transform(wgs84Proj,mapProj);
@@ -1105,7 +1105,7 @@
 }
 
 // Fügt die WMC-Layer in das DOM ein
-function appendWmcData(services,layers,layerlist){
+function appendWmcData(services,layers,layerlist,bbox,crs){
 	$("#ownlist").empty();
 	var ownlayers = [];
 	for(var i=0; i<services.length; i++){
@@ -1139,6 +1139,11 @@
 	}
 	validateLayers();
 	validateArrows();
+	//zoom to wmc extent
+	var extend=bbox.split(',');
+	var p1 = new OpenLayers.LonLat(extend[0],extend[1]).transform(crs,mapProj);
+	var p2 = new OpenLayers.LonLat(extend[2],extend[3]).transform(crs,mapProj);
+	map.zoomToExtent(new OpenLayers.Bounds(p1.lon, p1.lat, p2.lon, p2.lat));
 	
 }
 
@@ -1166,7 +1171,9 @@
 			}
 		}
 	}
-
+	// Parsen der bbox aus wmc 
+	//var bbox = json.wmc.bbox;
+	//var crs = json.wmc.crs;
 	// Alle ausgewählten overlays entfernen
 	clearOwnlist();
 
@@ -1181,7 +1188,7 @@
 	$.getJSON(searchUrl+'&resourceIds='+layerids, function(data){	
 		// Informationen sammeln und Parsen
 		var datacollection=parseMapBenderJson(data);
-		appendWmcData(datacollection.services,datacollection.layers,json.layerList);
+		appendWmcData(datacollection.services,datacollection.layers,json.layerList,json.wmc.bbox,json.wmc.crs);
 		$.mobile.hidePageLoadingMsg();
 	});
 }

Modified: trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.min.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.min.js	2013-05-14 14:37:38 UTC (rev 8620)
+++ trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.min.js	2013-05-20 13:58:14 UTC (rev 8621)
@@ -5,7 +5,7 @@
 function loadFeature(a){$.ajax({type:"GET",url:a,success:function(a){a&&(5>a.length&&(a=window.lang.convert("Kein Ergebnis!")),setMarkerhint(window.lang.convert("Abfrageergebnis:"),a))}})}
 OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,geodesic:!1,draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.eTop||(this.eTop=document.createElement("div"),this.eTop.className=this.displayClass+"Top",this.div.appendChild(this.eTop),this.eTop.style.visibility=""==this.topOutUnits||""==this.topInUnits?"hidden":"visible",this.eBottom=document.createElement("div"),
 this.eBottom.className=this.displayClass+"Bottom",this.div.appendChild(this.eBottom),this.eBottom.style.visibility=""==this.bottomOutUnits||""==this.bottomInUnits?"hidden":"visible");this.map.events.register("moveend",this,this.update);this.update();return this.div},getBarLen:function(a){var b=parseInt(Math.log(a)/Math.log(10)),b=Math.pow(10,b),a=parseInt(a/b);return(5<a?5:2<a?2:1)*b},update:function(){var a=this.map.getResolution();if(a){var b=this.map.getUnits(),c=OpenLayers.INCHES_PER_UNIT,d=this.maxWidth*
-a*c[b],e=1;!0===this.geodesic&&(e=(this.map.getGeodesicPixelSize().w||1.0E-6)*this.maxWidth/(d/c.km),d*=e);var f,h;1E5<d?(f=this.topOutUnits,h=this.bottomOutUnits):(f=this.topInUnits,h=this.bottomInUnits);var g=d/c[f],j=d/c[h],d=this.getBarLen(g),j=this.getBarLen(j),g=d/c[b]*c[f],j=j/c[b]*c[h],b=g/a/e,a=j/a/e;"visible"==this.eBottom.style.visibility&&(this.eBottom.style.width=Math.round(a)+"px");"visible"==this.eTop.style.visibility&&(this.eTop.style.width=Math.round(b)+"px",this.eTop.innerHTML=d+
+a*c[b],e=1;!0===this.geodesic&&(e=(this.map.getGeodesicPixelSize().w||1.0E-6)*this.maxWidth/(d/c.km),d*=e);var f,g;1E5<d?(f=this.topOutUnits,g=this.bottomOutUnits):(f=this.topInUnits,g=this.bottomInUnits);var h=d/c[f],j=d/c[g],d=this.getBarLen(h),j=this.getBarLen(j),h=d/c[b]*c[f],j=j/c[b]*c[g],b=h/a/e,a=j/a/e;"visible"==this.eBottom.style.visibility&&(this.eBottom.style.width=Math.round(a)+"px");"visible"==this.eTop.style.visibility&&(this.eTop.style.width=Math.round(b)+"px",this.eTop.innerHTML=d+
 " "+f)}},CLASS_NAME:"OpenLayers.Control.ScaleLine"});
 OpenLayers.Control.LoadingPanel=OpenLayers.Class(OpenLayers.Control,{counter:0,maximized:!1,visible:!0,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a])},setVisible:function(a){(this.visible=a)?OpenLayers.Element.show(this.div):OpenLayers.Element.hide(this.div)},getVisible:function(){return this.visible},hide:function(){this.setVisible(!1)},show:function(){this.setVisible(!0)},toggle:function(){this.setVisible(!this.getVisible())},addLayer:function(a){a.layer&&(a.layer.events.register("loadstart",
 this,this.increaseCounter),a.layer.events.register("loadend",this,this.decreaseCounter))},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.register("preaddlayer",this,this.addLayer);for(var b=0;b<this.map.layers.length;b++){var c=this.map.layers[b];c.events.register("loadstart",this,this.increaseCounter);c.events.register("loadend",this,this.decreaseCounter)}},increaseCounter:function(){this.counter++;0<this.counter&&!this.maximized&&this.visible&&this.maximizeControl()},
@@ -13,14 +13,14 @@
 this,this.addLayer),this.map.layers))for(var a=0;a<this.map.layers.length;a++){var b=this.map.layers[a];b.events.unregister("loadstart",this,this.increaseCounter);b.events.unregister("loadend",this,this.decreaseCounter)}OpenLayers.Control.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.LoadingPanel"});
 var map,clickCtrl,measureControls,olSearchSymbol={graphicName:"cross",strokeColor:"#00FFFF",strokeWidth:1,fillOpacity:0,pointRadius:11},olFeaturequerySymbol={graphicName:"circle",strokeColor:"#00FFFF",fillColor:"#00FFFF",strokeWidth:3,fillOpacity:0.2,pointRadius:15,graphicName:"circle"},olGpsSymbol={graphicName:"cross",strokeColor:"#871D33",strokeWidth:2,fillOpacity:0,pointRadius:12},olGpscircleStyle={fillOpacity:0.1,fillColor:"#000",strokeColor:"#871D33",strokeOpacity:0.6},sketchSymbolizers={Point:{pointRadius:6,
 graphicName:"square",fillColor:"white",fillOpacity:1,strokeWidth:2,strokeOpacity:0.8,strokeColor:"#00FFFF"},Line:{strokeWidth:3,strokeOpacity:1,strokeColor:"#FF0000"},Polygon:{strokeWidth:3,strokeOpacity:1,strokeColor:"#FF0000",fillColor:"white",fillOpacity:0.5}},style=new OpenLayers.Style;style.addRules([new OpenLayers.Rule({symbolizer:sketchSymbolizers})]);var styleMap=new OpenLayers.StyleMap({"default":style});
-function Service(a,b,c,d,e,f,h,g){a=$("<li>",{serviceid:a,"class":"service",title:b,desc:c,getMapURL:d,status:e,logoUrl:f,symbolLink:h,avail:g});d=$('<div class="service_container"></div>');d.append($('<table style="margin: 0px; padding: 0px; float:left;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; height:43px; width:55px; text-align: center; vertical-align: middle;"><img style="max-height: 43px; max-width: 55px;  max-height: 43px;" src="'+f+'" class="service_logo" alt="Logo"/></td></tr></table>'));
+function Service(a,b,c,d,e,f,g,h){a=$("<li>",{serviceid:a,"class":"service",title:b,desc:c,getMapURL:d,status:e,logoUrl:f,symbolLink:g,avail:h});d=$('<div class="service_container"></div>');d.append($('<table style="margin: 0px; padding: 0px; float:left;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; height:43px; width:55px; text-align: center; vertical-align: middle;"><img style="max-height: 43px; max-width: 55px;  max-height: 43px;" src="'+f+'" class="service_logo" alt="Logo"/></td></tr></table>'));
 d.append($("<div>",{"class":"icon layer_remove",text:" "}).click(function(){removeService($(this).parent().parent())}));d.append($("<div>",{"class":"icon layer_add",text:" "}).click(function(){addService($(this).parent().parent())}));d.append('<div class="collapsible unselected" data-role="collapsible" data-collapsed="true" data-theme="a" data-content-theme="c" data-inset="true"><h3>'+b+"</h3><h3>"+b+"</h3><p>"+c+"</p></div>");a.append(d);return a}
 function BaseLayer(a,b){return $("<div>",{text:a,title:a,layerids:b,"class":"baselayer base_unchecked"}).click(function(){switchVisibility($(this))})}
-function ResultLayer(a,b,c,d,e,f,h,g){a=$("<div>",{layerid:a,name:c,"class":"layer",title:b,desc:d,previewUrl:e,queryable:f,getMapURL:h,bbox:g});a.append($("<div>",{"class":"icon query_preview "+(f?"query_info":"query_noinfo"),text:" "}));a.append($("<div>",{"class":"layer_icon icon layer_add",text:" "}).click(function(){switchLayer($(this).parent())}));a.append('<div class="collapsible unselected" data-role="collapsible" data-collapsed="true" data-theme="a" data-content-theme="c" data-inset="true"><h3>'+
+function ResultLayer(a,b,c,d,e,f,g,h){a=$("<div>",{layerid:a,name:c,"class":"layer",title:b,desc:d,previewUrl:e,queryable:f,getMapURL:g,bbox:h});a.append($("<div>",{"class":"icon query_preview "+(f?"query_info":"query_noinfo"),text:" "}));a.append($("<div>",{"class":"layer_icon icon layer_add",text:" "}).click(function(){switchLayer($(this).parent())}));a.append('<div class="collapsible unselected" data-role="collapsible" data-collapsed="true" data-theme="a" data-content-theme="c" data-inset="true"><h3>'+
 b+"</h3><h3>"+b+"</h3><p>"+d+"</p></div>");return a}
-function OwnLayer(a,b,c,d,e,f,h,g,j,m,n){c=$("<div>",{layerid:a,name:c,servicetitle:e,servicedesc:f,"class":"layer",title:b,desc:d,previewUrl:h,queryable:g,getMapURL:j,bbox:m,avail:n});c.append($("<div>",{"class":"layer_icon icon layer_remove",text:" "}).click(function(){removeLayer($(this).parent())}));g?c.append($("<div>",{"class":"icon query_queryable query_unchecked",text:" "}).click(function(){query_check($(this))})):c.append($("<div>",{"class":"icon query_queryable query_noinfo",text:" "}));
-c.append($("<div>",{"class":"icon layer_visibility layer_checked",text:" "}).click(function(){switchVisibility($(this).parent())}));c.append($("<div>",{"class":"icon move arrow_up",text:" "}).click(function(){up(a)}));g=$('<div class="collapsible unselected" data-role="collapsible" data-collapsed="true" data-theme="a" data-content-theme="c" data-inset="true"></div>');g.append("<h3>"+b+"</h3>");var j=$("<table></table>"),k=$("<tr></tr>"),l=$('<td class="layerinfo"></td>');h&&l.append($("<div>",{"class":"icon layer_preview",
-text:" "}).click(function(){zoomToBbox(m);$.mobile.changePage($("#mappage"),pageTransition)}));l.append("</br><p>"+n+"%</p>");h=$("<td></td>");h.append("<p><b>"+e+"</b></p><p>"+f+"</p>");h.append("<p><b>"+b+"</b></p><p>"+d+"</p>");k.append(l);k.append(h);j.append(k);g.append(j);c.append(g);return c}var maxlayers=5,maxresults=40,baseinfo=[];searchUrl="mod_mapbender/search_proxy.php?languageCode=de&resultTarget=web&maxResults="+maxresults;
+function OwnLayer(a,b,c,d,e,f,g,h,j,k,l){c=$("<div>",{layerid:a,name:c,servicetitle:e,servicedesc:f,"class":"layer",title:b,desc:d,previewUrl:g,queryable:h,getMapURL:j,bbox:k,avail:l});c.append($("<div>",{"class":"layer_icon icon layer_remove",text:" "}).click(function(){removeLayer($(this).parent())}));h?c.append($("<div>",{"class":"icon query_queryable query_unchecked",text:" "}).click(function(){query_check($(this))})):c.append($("<div>",{"class":"icon query_queryable query_noinfo",text:" "}));
+c.append($("<div>",{"class":"icon layer_visibility layer_checked",text:" "}).click(function(){switchVisibility($(this).parent())}));c.append($("<div>",{"class":"icon move arrow_up",text:" "}).click(function(){up(a)}));h=$('<div class="collapsible unselected" data-role="collapsible" data-collapsed="true" data-theme="a" data-content-theme="c" data-inset="true"></div>');h.append("<h3>"+b+"</h3>");var j=$("<table></table>"),m=$("<tr></tr>"),n=$('<td class="layerinfo"></td>');g&&n.append($("<div>",{"class":"icon layer_preview",
+text:" "}).click(function(){zoomToBbox(k);$.mobile.changePage($("#mappage"),pageTransition)}));n.append("</br><p>"+l+"%</p>");g=$("<td></td>");g.append("<p><b>"+e+"</b></p><p>"+f+"</p>");g.append("<p><b>"+b+"</b></p><p>"+d+"</p>");m.append(n);m.append(g);j.append(m);h.append(j);c.append(h);return c}var maxlayers=5,maxresults=40,baseinfo=[];searchUrl="mod_mapbender/search_proxy.php?languageCode=de&resultTarget=web&maxResults="+maxresults;
 function addmyLayer(){OpenLayers.Control.Click=OpenLayers.Class(OpenLayers.Control,{defaultHandlerOptions:{single:!0,pixelTolerance:0,stopSingle:!1},initialize:function(a){this.handlerOptions=OpenLayers.Util.applyDefaults((a||{}).handlerOptions||{},this.defaultHandlerOptions);OpenLayers.Control.prototype.initialize.apply(this,arguments);this.handler=new OpenLayers.Handler.Click(this,{click:this.onClick},this.handlerOptions)},onClick:function(a){var b=map.getLonLatFromViewPortPx(a.xy),c=$("#ownlist").find(".query_checked").parent(),
 d=$("#select-lang").val(),e=new OpenLayers.Geometry.Point(b.lon,b.lat),f=new OpenLayers.Geometry.Point(b.lon,b.lat);vector_marker.removeAllFeatures();vector_marker.addFeatures([new OpenLayers.Feature.Vector(e,{},olSearchSymbol),new OpenLayers.Feature.Vector(f,{},olFeaturequerySymbol)]);setMarkerhint(window.lang.convert("Meldung:"),window.lang.convert("bitte warten..."));0<c.length?(a=c.attr("getmapurl")+"&wms=SERVICE=WMS&REQUEST=getFeatureInfo&VERSION=1.1.1&mapfile="+c.attr("name")+"&layers="+c.attr("name")+
 "&QUERY_LAYERS="+c.attr("name")+"&SRS="+featurequerySrc+"&BBOX="+map.getExtent().toBBOX()+"&WIDTH="+map.size.w+"&HEIGHT="+map.size.h+"&X="+a.xy.x+"&Y="+a.xy.y+"&INFO_FORMAT=text/html",a=$('<iframe src="'+a+'" class="query_iframe"><p>Die Abfrage kann leider nicht angezeigt werden.</p></img>'),setMarkerhint("Abfrageergebnis:",a)):(a="query/rasterquery.php?coord="+b.lon+", "+b.lat+"&lang="+d,loadFeature(a))},CLASS_NAME:"OpenLayers.Control.Click"});$("#mapbenderbut").click(function(){$.mobile.changePage($("#mod_mapbender"),
@@ -29,7 +29,7 @@
 function preview(a,b,c){$.ajax({previewurl:a,layerid:b,bbox:c,success:function(){$("#preview").find("div[data-role=content]").empty();$("#preview").find("div[data-role=content]").append('<img src="'+$(this).attr("previewurl")+'" alt="image" style="width:200px;">');var a=$(this).attr("bbox"),b=$(this).attr("layerid");$("#preview_zoom").click(function(){getOpenlayersIndex(b);zoomToBbox(a);$.mobile.changePage($("#mappage"),pageTransition)});$("#preview").popup("open")}})}
 getInfo=function(a){$("#info_content").empty();$("#info_content").append(a);$("#info").popup("open")};function getOpenlayersIndex(a){for(var b=0;b<map.layers.length;b++)if(map.layers[b].name==a)return b;return-1}function addOpenlayer(a,b,c){a=new OpenLayers.Layer.WMS(a,c,{layers:b,format:"image/png",transparent:"TRUE",transitionEffect:"resize"},{projection:mapProj,units:projUnits,opacity:0.8,singleTile:!0,isBaseLayer:!1,visibility:!0,alwaysInRange:!0});map.addLayer(a);map.setLayerIndex(a,0)}
 function removeOpenlayer(a){a=getOpenlayersIndex(a);0<=a&&map.removeLayer(map.layers[a])}function setOpenBaselayer(a){a=getOpenlayersIndex(a);0<=a&&map.setBaseLayer(map.layers[a])}function selectOpenlayer(a,b){var c=getOpenlayersIndex(a);0<=c&&map.layers[c].setVisibility(b)}
-function addOpenBaselayer(a,b){$.getJSON("mod_mapbender/search_proxy.php?languageCode=de&resultTarget=web&resourceIds="+b,function(b){$.each(b.wms.srv,function(b,c){$.each(c.layer,function(b,d){d.layer&&(d=d.layer[0]);var g=new OpenLayers.Layer.WMS(a,c.getMapUrl,{layers:d.name,format:"image/png",transparent:"false",transitionEffect:"resize"},{projection:mapProj,units:projUnits,singleTile:!0,isBaseLayer:!0,alwaysInRange:!0});map.addLayers([g])})})})}
+function addOpenBaselayer(a,b){$.getJSON("mod_mapbender/search_proxy.php?languageCode=de&resultTarget=web&resourceIds="+b,function(b){$.each(b.wms.srv,function(b,c){$.each(c.layer,function(b,d){d.layer&&(d=d.layer[0]);var h=new OpenLayers.Layer.WMS(a,c.getMapUrl,{layers:d.name,format:"image/png",transparent:"false",transitionEffect:"resize"},{projection:mapProj,units:projUnits,singleTile:!0,isBaseLayer:!0,alwaysInRange:!0});map.addLayers([h])})})})}
 function zoomToBbox(a){var b=a.split(","),a=(new OpenLayers.LonLat(b[0],b[1])).transform(wgs84Proj,mapProj),b=(new OpenLayers.LonLat(b[2],b[3])).transform(wgs84Proj,mapProj);map.zoomToExtent(new OpenLayers.Bounds(a.lon,a.lat,b.lon,b.lat))}function numServices(){return $("#resultlist").find(".service").length}function numResultLayers(a){return a.find(".layer").length}function layerInList(a,b){for(var c=a.find(".layer"),d=0;d<c.length;d++)if($(c[d]).attr("layerid")==b)return d;return-1}
 function up(a){var b=layerInList($("#ownlist"),a);0<b&&($($("#ownlist").find(".layer")[b]).after($($("#ownlist").find(".layer")[b-1])),console.log("todo: layerreihenfolge"),map.raiseLayer(map.layers[getOpenlayersIndex(a)],1),validateArrows(),refresh())}function numOwnlayers(){return $("#ownlist").find(".layer").length}
 function refresh(){$("#resultlist").listview("refresh");$($("#ownlist").parent()).listview("refresh");$("div[data-role=collapsible]").collapsible();$("a[data-role=button]").button()}
@@ -41,12 +41,12 @@
 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,h=0;h<b.length;h++)if(b[h].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 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 h=b[f],g=h[1];h[0]==e.id&&service.append(ResultLayer(g.id,g.title,g.name,$(g).attr("abstract"),g.previewURL,"1"==g.queryable,e.getMapUrl,g.bbox))}$("#resultlist").append(service)}$("#resultlist").prepend('<li data-theme="b">Suchergebnis: '+
+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 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){$("#ownlist").empty();for(var d=[],e=0;e<a.length;e++)for(var f=a[e],h=0;h<b.length;h++){var g=b[h],j=g[1];g[0]==f.id&&d.push(OwnLayer(j.id,j.title,j.name,$(j).attr("abstract"),f.title,$(f).attr("abstract"),j.previewURL,"1"==j.queryable,f.getMapUrl,j.bbox,f.avail))}for(e=0;e<c.length;e++)for(h=0;h<d.length;h++)if(c[e].layerId==d[h].attr("layerid")){g=d[h];$("#ownlist").append(g);addOpenlayer(g.attr("layerid"),g.attr("name"),g.attr("getMapUrl"));c[e].active||switchVisibility(g);
-break}validateLayers();validateArrows()}function clearOwnlist(){for(var a=$("#ownlist").find(".layer"),b=0;b<a.length;b++)removeLayer(a[b])}
-function appendWmc(a){for(var b=0;b<a.backGroundLayer.length;b++){var c=a.backGroundLayer[b];if(c.active)for(var d=$("#baselayers").find(".baselayer"),e=0;e<d.length;e++)if($(d[e]).attr("layerids")==c.name){switchVisibility(d[e]);break}}clearOwnlist();var f="";$.each(a.layerList,function(a,b){f=f+","+b.layerId});f=f.substr(1,f.length);$.getJSON(searchUrl+"&resourceIds="+f,function(b){b=parseMapBenderJson(b);appendWmcData(b.services,b.layers,a.layerList);$.mobile.hidePageLoadingMsg()})}
+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);
+break}validateLayers();validateArrows();b=d.split(",");a=(new OpenLayers.LonLat(b[0],b[1])).transform(e,mapProj);e=(new OpenLayers.LonLat(b[2],b[3])).transform(e,mapProj);map.zoomToExtent(new OpenLayers.Bounds(a.lon,a.lat,e.lon,e.lat))}function clearOwnlist(){for(var a=$("#ownlist").find(".layer"),b=0;b<a.length;b++)removeLayer(a[b])}
+function appendWmc(a){for(var b=0;b<a.backGroundLayer.length;b++){var c=a.backGroundLayer[b];if(c.active)for(var d=$("#baselayers").find(".baselayer"),e=0;e<d.length;e++)if($(d[e]).attr("layerids")==c.name){switchVisibility(d[e]);break}}clearOwnlist();var f="";$.each(a.layerList,function(a,b){f=f+","+b.layerId});f=f.substr(1,f.length);$.getJSON(searchUrl+"&resourceIds="+f,function(b){b=parseMapBenderJson(b);appendWmcData(b.services,b.layers,a.layerList,a.wmc.bbox,a.wmc.crs);$.mobile.hidePageLoadingMsg()})}
 function addBaselayers(){$("#baselayers").empty();vector_marker=new OpenLayers.Layer.Vector("Vector Layer",{});$("#baselayers").append(BaseLayer("RLP Zusammenstellung",atkis_praes_tms.name));$("#baselayers").append(BaseLayer("Luftbilder",luftbilder.name));$("#baselayers").append(BaseLayer("Keine Hintergrundkarte",grenze_leer.name));map.addLayers([atkis_praes_tms,luftbilder,grenze_leer,vector_marker]);for(i in baseinfo){var a=baseinfo[i][0],b=baseinfo[i][1];$("#baselayers").append(BaseLayer(a,b));
 addOpenBaselayer(a,b)}base_check($("#baselayers").find(".baselayer").first())}
 var initmap=function(){var a={theme:null,projection:mapProj,units:projUnits,maxExtent:mymapbounds,maxScale:mymaxscale,minScale:myminscale,numZoomLevels:myzoomlevels,scales:myscales,controls:[new OpenLayers.Control.Attribution,new OpenLayers.Control.Navigation({zoomWheelEnabled:!0}),new OpenLayers.Control.KeyboardDefaults,new OpenLayers.Control.TouchNavigation({dragPanOptions:{interval:10,enableKinetic:!0}}),new OpenLayers.Control.ScaleLine({div:document.getElementById("scaleline"),geodesic:!1,maxWidth:100,
@@ -68,15 +68,15 @@
 function hideAddressBar(){window.location.hash||(document.height<=window.outerHeight+10?(document.body.style.height=window.outerHeight+50+"px",setTimeout(function(){window.scrollTo(0,1)},50)):setTimeout(function(){window.scrollTo(0,1)},0))}
 function changeHand(a){"l"===a?(defaultHand="l",$("#scaleline, #copyright, #zoomscale").css("left","auto").css("right","4px"),$("#navbutgroup").css("right","auto").css("left","4px")):(defaultHand="r",$("#scaleline, #copyright, #zoomscale").css("right","auto").css("left","4px"),$("#navbutgroup").css("left","auto").css("right","4px"))}
 function changeLanguage(a,b){window.lang.change(a);$.mobile.showPageLoadingMsg();$.ajax({url:"help/help_"+a+".html",cache:!0}).done(function(a){$("#helpdiv").html(a);$.mobile.hidePageLoadingMsg()});b&&$("#select-hand").selectmenu("refresh",!0);$("#select-lang").val(a)}
-function codeAddress(){adressgeocoder=new google.maps.Geocoder;var a=document.getElementById("searchfield").value;adressgeocoder.geocode({address:a},function(b,c){if(c===google.maps.GeocoderStatus.OK){var d="no";for(i=0;i<b[0].address_components.length;i++)b[0].address_components[i].long_name===googleGeocodeAdmin&&(d="ok");if("ok"!=d)alert("Adresse liegt nicht in "+googleGeocodeAdmin+"!");else{var d=b[0].formatted_address,e=b[0].geometry.location.lat(),f=b[0].geometry.location.lng(),h=new google.maps.LatLng(e,
-f),g={zoom:11,center:h,mapTypeId:google.maps.MapTypeId.ROADMAP},g=new google.maps.Map(document.getElementById("mygooglemap"),g);new google.maps.Marker({map:g,position:h});d=window.lang.convert("Suchergebnis: ")+d+'  <br><div class="searchbutton" onClick="zoomtosearchpoint(\''+d+"',"+f+","+e+')" >'+window.lang.convert("Zoom auf Ergebnis in Karte")+"</div>";$("#mygooglelink").html(d)}}else alert("Geocode nicht erfolgreich, Fehler: "+a+"  "+c)})}
+function codeAddress(){adressgeocoder=new google.maps.Geocoder;var a=document.getElementById("searchfield").value;adressgeocoder.geocode({address:a},function(b,c){if(c===google.maps.GeocoderStatus.OK){var d="no";for(i=0;i<b[0].address_components.length;i++)b[0].address_components[i].long_name===googleGeocodeAdmin&&(d="ok");if("ok"!=d)alert("Adresse liegt nicht in "+googleGeocodeAdmin+"!");else{var d=b[0].formatted_address,e=b[0].geometry.location.lat(),f=b[0].geometry.location.lng(),g=new google.maps.LatLng(e,
+f),h={zoom:11,center:g,mapTypeId:google.maps.MapTypeId.ROADMAP},h=new google.maps.Map(document.getElementById("mygooglemap"),h);new google.maps.Marker({map:h,position:g});d=window.lang.convert("Suchergebnis: ")+d+'  <br><div class="searchbutton" onClick="zoomtosearchpoint(\''+d+"',"+f+","+e+')" >'+window.lang.convert("Zoom auf Ergebnis in Karte")+"</div>";$("#mygooglelink").html(d)}}else alert("Geocode nicht erfolgreich, Fehler: "+a+"  "+c)})}
 function searchStreet(a){$.mobile.showPageLoadingMsg();$("#search_results").empty();$.getJSON("mod_streetsearch/street_full.php?lang=de&searchfield="+a,function(a){if("++"===a.totalResultsCount){var c='<li data-role="list-divider">'+window.lang.convert("Zu viele Datens\u00e4tze! Bitte schr\u00e4nken Sie Ihre Suche ein!")+"</li>";$("#search_results").append(c);$("#search_results").listview("refresh")}else c='<li data-role="list-divider"> '+a.totalResultsCount+" "+window.lang.convert("Suchergebnisse")+
 "</li>",$("#search_results").append(c),$.each(a.geonames,function(a,b){c="";c+='<li><a href="javascript:void(0);" onClick="searchHsn(\''+b.strid+"');\" ><h2>"+b.title1+"</h2>";c+="<p>"+b.title2+"</p></a></li>";$("#search_results").append(c)}),$("#search_results").listview("refresh"),a={words:$('input[name="searchfield"]').val()},highlight("search_results",a);$.mobile.hidePageLoadingMsg()})}
 function searchHsn(a){$.mobile.showPageLoadingMsg();$("#search_results").empty();$.getJSON("mod_streetsearch/street_hsn.php?lang=de&strid="+a,function(a){var c='<li data-role="list-divider" ><a href="javascript:void(0);" onClick="zoomtosearchpoint(\''+a.street+"',"+a.streetx+","+a.streety+');" ><h2>'+a.street+"</h2>",c=c+("<p>"+a.totalResultsCount+" "+window.lang.convert("Hausnummern")+"</p></a></li>");$("#search_results").append(c);$.each(a.geonames,function(d,e){c="";c+='<li><a href="javascript:void(0);" onClick="zoomtosearchpoint(\''+
 a.street+" "+e.title1+"',"+e.x+","+e.y+');" ><h2>Nr. '+e.title1+"</h2>";c+="<p>"+e.title2+"</p></a></li>";$("#search_results").append(c)});$("#search_results").listview("refresh");$.mobile.hidePageLoadingMsg()})}
 function searchMapbender(a){$.mobile.showPageLoadingMsg();$("#search_results").empty();$.getJSON(mapbendersearchurl+searchEPSG+("&searchText="+a),function(a){if(500<a.totalResultsCount){var c='<li data-role="list-divider" >'+window.lang.convert("Zu viele Datens\u00e4tze! Bitte schr\u00e4nken Sie Ihre Suche ein!")+"</li>";$("#search_results").append(c);$("#search_results").listview("refresh")}else c='<li data-role="list-divider" > '+a.totalResultsCount+" "+window.lang.convert("Suchergebnisse")+"</li>",
-$("#search_results").append(c),$.each(a.geonames,function(a,b){var f=(parseInt(b.minx)+parseInt(b.maxx))/2,h=(parseInt(b.miny)+parseInt(b.maxy))/2;c="";c="gemeinde_neu"===b.category||"Gemeinde"===b.category||"verbandsgemeinde"===b.category||"kreis"===b.category||"Kreis"===b.category?c+('<li><a href="javascript:void(0);" onClick="zoomtoextent(\''+b.title+"',"+b.minx+","+b.miny+","+b.maxx+","+b.maxy+');" ><h2>'+b.title+"</h2>"):c+('<li><a href="javascript:void(0);" onClick="zoomtosearchpoint(\''+b.title+
-"',"+f+","+h+');" ><h2>'+b.title+"</h2>");c+="<p>"+b.category+"</p></a></li>";$("#search_results").append(c)}),$("#search_results").listview("refresh"),a={words:$('input[name="searchfield"]').val()},highlight("search_results",a);$.mobile.hidePageLoadingMsg()})}
+$("#search_results").append(c),$.each(a.geonames,function(a,b){var f=(parseInt(b.minx)+parseInt(b.maxx))/2,g=(parseInt(b.miny)+parseInt(b.maxy))/2;c="";c="gemeinde_neu"===b.category||"Gemeinde"===b.category||"verbandsgemeinde"===b.category||"kreis"===b.category||"Kreis"===b.category?c+('<li><a href="javascript:void(0);" onClick="zoomtoextent(\''+b.title+"',"+b.minx+","+b.miny+","+b.maxx+","+b.maxy+');" ><h2>'+b.title+"</h2>"):c+('<li><a href="javascript:void(0);" onClick="zoomtosearchpoint(\''+b.title+
+"',"+f+","+g+');" ><h2>'+b.title+"</h2>");c+="<p>"+b.category+"</p></a></li>";$("#search_results").append(c)}),$("#search_results").listview("refresh"),a={words:$('input[name="searchfield"]').val()},highlight("search_results",a);$.mobile.hidePageLoadingMsg()})}
 function highlight(a,b){var c={words:"",caseSensitive:!1,wordsOnly:!0,template:'$1<span class="highlight">$2</span>$3'},d;$.extend(!0,c,b||{});0!=c.words.length&&(d=RegExp("(>[^<.]*)("+c.words+")([^<.]*)",c.caseSensitive?"":"ig"),$("#"+a).each(function(){var a=$(this).html();a&&$(this).html(a.replace(d,c.template))}))}
 function zoompoint(a,b){var c=new OpenLayers.LonLat(a,b),d=new OpenLayers.Geometry.Point(a,b),e=new OpenLayers.Geometry.Point(a,b);vector_marker.removeAllFeatures();vector_marker.addFeatures([new OpenLayers.Feature.Vector(d,{},olSearchSymbol),new OpenLayers.Feature.Vector(e,{},olFeaturequerySymbol)]);map.setCenter(c,getZoomlevel())}
 function zoomtosearchpoint(a,b,c){setMarkerhint(window.lang.convert("Suchergebnis: "),a);a=new OpenLayers.LonLat(b,c);if("google"===searchMode)var d=a.transform(wgs84Proj,mapProj);else if("streetsearch"===searchMode||"mapbendersearch"===searchMode)d=a;a=new OpenLayers.Geometry.Point(d.lon,d.lat);b=new OpenLayers.Geometry.Point(d.lon,d.lat);vector_marker.removeAllFeatures();vector_marker.addFeatures([new OpenLayers.Feature.Vector(a,{},olSearchSymbol),new OpenLayers.Feature.Vector(b,{},olFeaturequerySymbol)]);

Modified: trunk/mapbender/http/extensions/mobilemap/js/ngms_event.min.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/js/ngms_event.min.js	2013-05-14 14:37:38 UTC (rev 8620)
+++ trunk/mapbender/http/extensions/mobilemap/js/ngms_event.min.js	2013-05-20 13:58:14 UTC (rev 8621)
@@ -5,24 +5,22 @@
 function loadFeature(a){$.ajax({type:"GET",url:a,success:function(a){a&&(5>a.length&&(a=window.lang.convert("Kein Ergebnis!")),setMarkerhint(window.lang.convert("Abfrageergebnis:"),a))}})}
 OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,geodesic:!1,draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.eTop||(this.eTop=document.createElement("div"),this.eTop.className=this.displayClass+"Top",this.div.appendChild(this.eTop),this.eTop.style.visibility=""==this.topOutUnits||""==this.topInUnits?"hidden":"visible",this.eBottom=document.createElement("div"),
 this.eBottom.className=this.displayClass+"Bottom",this.div.appendChild(this.eBottom),this.eBottom.style.visibility=""==this.bottomOutUnits||""==this.bottomInUnits?"hidden":"visible");this.map.events.register("moveend",this,this.update);this.update();return this.div},getBarLen:function(a){var b=parseInt(Math.log(a)/Math.log(10)),b=Math.pow(10,b),a=parseInt(a/b);return(5<a?5:2<a?2:1)*b},update:function(){var a=this.map.getResolution();if(a){var b=this.map.getUnits(),c=OpenLayers.INCHES_PER_UNIT,d=this.maxWidth*
-a*c[b],e=1;!0===this.geodesic&&(e=(this.map.getGeodesicPixelSize().w||1.0E-6)*this.maxWidth/(d/c.km),d*=e);var f,h;1E5<d?(f=this.topOutUnits,h=this.bottomOutUnits):(f=this.topInUnits,h=this.bottomInUnits);var g=d/c[f],j=d/c[h],d=this.getBarLen(g),j=this.getBarLen(j),g=d/c[b]*c[f],j=j/c[b]*c[h],b=g/a/e,a=j/a/e;"visible"==this.eBottom.style.visibility&&(this.eBottom.style.width=Math.round(a)+"px");"visible"==this.eTop.style.visibility&&(this.eTop.style.width=Math.round(b)+"px",this.eTop.innerHTML=d+
+a*c[b],e=1;!0===this.geodesic&&(e=(this.map.getGeodesicPixelSize().w||1.0E-6)*this.maxWidth/(d/c.km),d*=e);var f,g;1E5<d?(f=this.topOutUnits,g=this.bottomOutUnits):(f=this.topInUnits,g=this.bottomInUnits);var h=d/c[f],j=d/c[g],d=this.getBarLen(h),j=this.getBarLen(j),h=d/c[b]*c[f],j=j/c[b]*c[g],b=h/a/e,a=j/a/e;"visible"==this.eBottom.style.visibility&&(this.eBottom.style.width=Math.round(a)+"px");"visible"==this.eTop.style.visibility&&(this.eTop.style.width=Math.round(b)+"px",this.eTop.innerHTML=d+
 " "+f)}},CLASS_NAME:"OpenLayers.Control.ScaleLine"});
 OpenLayers.Control.LoadingPanel=OpenLayers.Class(OpenLayers.Control,{counter:0,maximized:!1,visible:!0,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a])},setVisible:function(a){(this.visible=a)?OpenLayers.Element.show(this.div):OpenLayers.Element.hide(this.div)},getVisible:function(){return this.visible},hide:function(){this.setVisible(!1)},show:function(){this.setVisible(!0)},toggle:function(){this.setVisible(!this.getVisible())},addLayer:function(a){a.layer&&(a.layer.events.register("loadstart",
 this,this.increaseCounter),a.layer.events.register("loadend",this,this.decreaseCounter))},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.register("preaddlayer",this,this.addLayer);for(var b=0;b<this.map.layers.length;b++){var c=this.map.layers[b];c.events.register("loadstart",this,this.increaseCounter);c.events.register("loadend",this,this.decreaseCounter)}},increaseCounter:function(){this.counter++;0<this.counter&&!this.maximized&&this.visible&&this.maximizeControl()},
 decreaseCounter:function(){0<this.counter&&this.counter--;0==this.counter&&this.maximized&&this.visible&&this.minimizeControl()},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);return this.div},minimizeControl:function(a){this.div.style.display="none";this.maximized=!1;null!=a&&OpenLayers.Event.stop(a)},maximizeControl:function(a){this.div.style.display="block";this.maximized=!0;null!=a&&OpenLayers.Event.stop(a)},destroy:function(){if(this.map&&(this.map.events.unregister("preaddlayer",
-this,this.addLayer),this.map.layers))for(var a=0;a<this.map.layers.length;a++){var b=this.map.layers[a];b.events.unregister("loadstart",this,this.increaseCounter);b.events.unregister("loadend",this,this.decreaseCounter)}OpenLayers.Control.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.LoadingPanel"});var map,clickCtrl,measureControls;Proj4js.defs["EPSG:25832"]="+proj=utm +zone=32 +ellps=GRS80 +units=m +datum=WGS84";Proj4js.defs["EPSG:4326"]="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
-var mapProj=new OpenLayers.Projection("EPSG:25832"),wgs84Proj=new OpenLayers.Projection("EPSG:4326"),mymapbounds=new OpenLayers.Bounds(293300,5424E3,464300,5654100),myzoombounds="off",mymaxscale=2E6,myminscale=500,myzoomlevels=16,myscales=[2E6,15E5,1E6,5E5,25E4,15E4,1E5,5E4,25E3,15E3,1E4,8E3,5E3,3E3,1E3,500],zoomSelect=!0,projUnits="m",searchMode="mapbendersearch",mapbendersearchurl="query/searchproxy.php?resultTarget=web&outputFormat=json&searchEPSG=",searchEPSG="25832",searchZoom=12,defaultHand=
-"r",googleGeocodeAdmin="Rheinland-Pfalz",directLayerChange="on",pageTransition={transition:"fade"},toolColor="#871D33",featurequerySrc="EPSG:25832",olSearchSymbol={graphicName:"cross",strokeColor:"#00FFFF",strokeWidth:1,fillOpacity:0,pointRadius:11},olFeaturequerySymbol={graphicName:"circle",strokeColor:"#00FFFF",fillColor:"#00FFFF",strokeWidth:3,fillOpacity:0.2,pointRadius:15,graphicName:"circle"},olGpsSymbol={graphicName:"cross",strokeColor:"#871D33",strokeWidth:2,fillOpacity:0,pointRadius:12},
-olGpscircleStyle={fillOpacity:0.1,fillColor:"#000",strokeColor:"#871D33",strokeOpacity:0.6},sketchSymbolizers={Point:{pointRadius:6,graphicName:"square",fillColor:"white",fillOpacity:1,strokeWidth:2,strokeOpacity:0.8,strokeColor:"#00FFFF"},Line:{strokeWidth:3,strokeOpacity:1,strokeColor:"#FF0000"},Polygon:{strokeWidth:3,strokeOpacity:1,strokeColor:"#FF0000",fillColor:"white",fillOpacity:0.5}},style=new OpenLayers.Style;style.addRules([new OpenLayers.Rule({symbolizer:sketchSymbolizers})]);
-var styleMap=new OpenLayers.StyleMap({"default":style});
-function Service(a,b,c,d,e,f,h,g){a=$("<li>",{serviceid:a,"class":"service",title:b,desc:c,getMapURL:d,status:e,logoUrl:f,symbolLink:h,avail:g});d=$('<div class="service_container"></div>');d.append($('<table style="margin: 0px; padding: 0px; float:left;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; height:43px; width:55px; text-align: center; vertical-align: middle;"><img style="max-height: 43px; max-width: 55px;  max-height: 43px;" src="'+f+'" class="service_logo" alt="Logo"/></td></tr></table>'));
+this,this.addLayer),this.map.layers))for(var a=0;a<this.map.layers.length;a++){var b=this.map.layers[a];b.events.unregister("loadstart",this,this.increaseCounter);b.events.unregister("loadend",this,this.decreaseCounter)}OpenLayers.Control.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.LoadingPanel"});
+var map,clickCtrl,measureControls,olSearchSymbol={graphicName:"cross",strokeColor:"#00FFFF",strokeWidth:1,fillOpacity:0,pointRadius:11},olFeaturequerySymbol={graphicName:"circle",strokeColor:"#00FFFF",fillColor:"#00FFFF",strokeWidth:3,fillOpacity:0.2,pointRadius:15,graphicName:"circle"},olGpsSymbol={graphicName:"cross",strokeColor:"#871D33",strokeWidth:2,fillOpacity:0,pointRadius:12},olGpscircleStyle={fillOpacity:0.1,fillColor:"#000",strokeColor:"#871D33",strokeOpacity:0.6},sketchSymbolizers={Point:{pointRadius:6,
+graphicName:"square",fillColor:"white",fillOpacity:1,strokeWidth:2,strokeOpacity:0.8,strokeColor:"#00FFFF"},Line:{strokeWidth:3,strokeOpacity:1,strokeColor:"#FF0000"},Polygon:{strokeWidth:3,strokeOpacity:1,strokeColor:"#FF0000",fillColor:"white",fillOpacity:0.5}},style=new OpenLayers.Style;style.addRules([new OpenLayers.Rule({symbolizer:sketchSymbolizers})]);var styleMap=new OpenLayers.StyleMap({"default":style});
+function Service(a,b,c,d,e,f,g,h){a=$("<li>",{serviceid:a,"class":"service",title:b,desc:c,getMapURL:d,status:e,logoUrl:f,symbolLink:g,avail:h});d=$('<div class="service_container"></div>');d.append($('<table style="margin: 0px; padding: 0px; float:left;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; height:43px; width:55px; text-align: center; vertical-align: middle;"><img style="max-height: 43px; max-width: 55px;  max-height: 43px;" src="'+f+'" class="service_logo" alt="Logo"/></td></tr></table>'));
 d.append($("<div>",{"class":"icon layer_remove",text:" "}).click(function(){removeService($(this).parent().parent())}));d.append($("<div>",{"class":"icon layer_add",text:" "}).click(function(){addService($(this).parent().parent())}));d.append('<div class="collapsible unselected" data-role="collapsible" data-collapsed="true" data-theme="a" data-content-theme="c" data-inset="true"><h3>'+b+"</h3><h3>"+b+"</h3><p>"+c+"</p></div>");a.append(d);return a}
 function BaseLayer(a,b){return $("<div>",{text:a,title:a,layerids:b,"class":"baselayer base_unchecked"}).click(function(){switchVisibility($(this))})}
-function ResultLayer(a,b,c,d,e,f,h,g){a=$("<div>",{layerid:a,name:c,"class":"layer",title:b,desc:d,previewUrl:e,queryable:f,getMapURL:h,bbox:g});a.append($("<div>",{"class":"icon query_preview "+(f?"query_info":"query_noinfo"),text:" "}));a.append($("<div>",{"class":"layer_icon icon layer_add",text:" "}).click(function(){switchLayer($(this).parent())}));a.append('<div class="collapsible unselected" data-role="collapsible" data-collapsed="true" data-theme="a" data-content-theme="c" data-inset="true"><h3>'+
+function ResultLayer(a,b,c,d,e,f,g,h){a=$("<div>",{layerid:a,name:c,"class":"layer",title:b,desc:d,previewUrl:e,queryable:f,getMapURL:g,bbox:h});a.append($("<div>",{"class":"icon query_preview "+(f?"query_info":"query_noinfo"),text:" "}));a.append($("<div>",{"class":"layer_icon icon layer_add",text:" "}).click(function(){switchLayer($(this).parent())}));a.append('<div class="collapsible unselected" data-role="collapsible" data-collapsed="true" data-theme="a" data-content-theme="c" data-inset="true"><h3>'+
 b+"</h3><h3>"+b+"</h3><p>"+d+"</p></div>");return a}
-function OwnLayer(a,b,c,d,e,f,h,g,j,m,n){c=$("<div>",{layerid:a,name:c,servicetitle:e,servicedesc:f,"class":"layer",title:b,desc:d,previewUrl:h,queryable:g,getMapURL:j,bbox:m,avail:n});c.append($("<div>",{"class":"layer_icon icon layer_remove",text:" "}).click(function(){removeLayer($(this).parent())}));g?c.append($("<div>",{"class":"icon query_queryable query_unchecked",text:" "}).click(function(){query_check($(this))})):c.append($("<div>",{"class":"icon query_queryable query_noinfo",text:" "}));
-c.append($("<div>",{"class":"icon layer_visibility layer_checked",text:" "}).click(function(){switchVisibility($(this).parent())}));c.append($("<div>",{"class":"icon move arrow_up",text:" "}).click(function(){up(a)}));g=$('<div class="collapsible unselected" data-role="collapsible" data-collapsed="true" data-theme="a" data-content-theme="c" data-inset="true"></div>');g.append("<h3>"+b+"</h3>");var j=$("<table></table>"),k=$("<tr></tr>"),l=$('<td class="layerinfo"></td>');h&&l.append($("<div>",{"class":"icon layer_preview",
-text:" "}).click(function(){zoomToBbox(m);$.mobile.changePage($("#mappage"),pageTransition)}));l.append("</br><p>"+n+"%</p>");h=$("<td></td>");h.append("<p><b>"+e+"</b></p><p>"+f+"</p>");h.append("<p><b>"+b+"</b></p><p>"+d+"</p>");k.append(l);k.append(h);j.append(k);g.append(j);c.append(g);return c}var maxlayers=5,maxresults=40,baseinfo=[];searchUrl="mod_mapbender/search_proxy.php?languageCode=de&resultTarget=web&maxResults="+maxresults;
+function OwnLayer(a,b,c,d,e,f,g,h,j,k,l){c=$("<div>",{layerid:a,name:c,servicetitle:e,servicedesc:f,"class":"layer",title:b,desc:d,previewUrl:g,queryable:h,getMapURL:j,bbox:k,avail:l});c.append($("<div>",{"class":"layer_icon icon layer_remove",text:" "}).click(function(){removeLayer($(this).parent())}));h?c.append($("<div>",{"class":"icon query_queryable query_unchecked",text:" "}).click(function(){query_check($(this))})):c.append($("<div>",{"class":"icon query_queryable query_noinfo",text:" "}));
+c.append($("<div>",{"class":"icon layer_visibility layer_checked",text:" "}).click(function(){switchVisibility($(this).parent())}));c.append($("<div>",{"class":"icon move arrow_up",text:" "}).click(function(){up(a)}));h=$('<div class="collapsible unselected" data-role="collapsible" data-collapsed="true" data-theme="a" data-content-theme="c" data-inset="true"></div>');h.append("<h3>"+b+"</h3>");var j=$("<table></table>"),m=$("<tr></tr>"),n=$('<td class="layerinfo"></td>');g&&n.append($("<div>",{"class":"icon layer_preview",
+text:" "}).click(function(){zoomToBbox(k);$.mobile.changePage($("#mappage"),pageTransition)}));n.append("</br><p>"+l+"%</p>");g=$("<td></td>");g.append("<p><b>"+e+"</b></p><p>"+f+"</p>");g.append("<p><b>"+b+"</b></p><p>"+d+"</p>");m.append(n);m.append(g);j.append(m);h.append(j);c.append(h);return c}var maxlayers=5,maxresults=40,baseinfo=[];searchUrl="mod_mapbender/search_proxy.php?languageCode=de&resultTarget=web&maxResults="+maxresults;
 function addmyLayer(){OpenLayers.Control.Click=OpenLayers.Class(OpenLayers.Control,{defaultHandlerOptions:{single:!0,pixelTolerance:0,stopSingle:!1},initialize:function(a){this.handlerOptions=OpenLayers.Util.applyDefaults((a||{}).handlerOptions||{},this.defaultHandlerOptions);OpenLayers.Control.prototype.initialize.apply(this,arguments);this.handler=new OpenLayers.Handler.Click(this,{click:this.onClick},this.handlerOptions)},onClick:function(a){var b=map.getLonLatFromViewPortPx(a.xy),c=$("#ownlist").find(".query_checked").parent(),
 d=$("#select-lang").val(),e=new OpenLayers.Geometry.Point(b.lon,b.lat),f=new OpenLayers.Geometry.Point(b.lon,b.lat);vector_marker.removeAllFeatures();vector_marker.addFeatures([new OpenLayers.Feature.Vector(e,{},olSearchSymbol),new OpenLayers.Feature.Vector(f,{},olFeaturequerySymbol)]);setMarkerhint(window.lang.convert("Meldung:"),window.lang.convert("bitte warten..."));0<c.length?(a=c.attr("getmapurl")+"&wms=SERVICE=WMS&REQUEST=getFeatureInfo&VERSION=1.1.1&mapfile="+c.attr("name")+"&layers="+c.attr("name")+
 "&QUERY_LAYERS="+c.attr("name")+"&SRS="+featurequerySrc+"&BBOX="+map.getExtent().toBBOX()+"&WIDTH="+map.size.w+"&HEIGHT="+map.size.h+"&X="+a.xy.x+"&Y="+a.xy.y+"&INFO_FORMAT=text/html",a=$('<iframe src="'+a+'" class="query_iframe"><p>Die Abfrage kann leider nicht angezeigt werden.</p></img>'),setMarkerhint("Abfrageergebnis:",a)):(a="query/rasterquery.php?coord="+b.lon+", "+b.lat+"&lang="+d,loadFeature(a))},CLASS_NAME:"OpenLayers.Control.Click"});$("#mapbenderbut").click(function(){$.mobile.changePage($("#mod_mapbender"),
@@ -31,7 +29,7 @@
 function preview(a,b,c){$.ajax({previewurl:a,layerid:b,bbox:c,success:function(){$("#preview").find("div[data-role=content]").empty();$("#preview").find("div[data-role=content]").append('<img src="'+$(this).attr("previewurl")+'" alt="image" style="width:200px;">');var a=$(this).attr("bbox"),b=$(this).attr("layerid");$("#preview_zoom").click(function(){getOpenlayersIndex(b);zoomToBbox(a);$.mobile.changePage($("#mappage"),pageTransition)});$("#preview").popup("open")}})}
 getInfo=function(a){$("#info_content").empty();$("#info_content").append(a);$("#info").popup("open")};function getOpenlayersIndex(a){for(var b=0;b<map.layers.length;b++)if(map.layers[b].name==a)return b;return-1}function addOpenlayer(a,b,c){a=new OpenLayers.Layer.WMS(a,c,{layers:b,format:"image/png",transparent:"TRUE",transitionEffect:"resize"},{projection:mapProj,units:projUnits,opacity:0.8,singleTile:!0,isBaseLayer:!1,visibility:!0,alwaysInRange:!0});map.addLayer(a);map.setLayerIndex(a,0)}
 function removeOpenlayer(a){a=getOpenlayersIndex(a);0<=a&&map.removeLayer(map.layers[a])}function setOpenBaselayer(a){a=getOpenlayersIndex(a);0<=a&&map.setBaseLayer(map.layers[a])}function selectOpenlayer(a,b){var c=getOpenlayersIndex(a);0<=c&&map.layers[c].setVisibility(b)}
-function addOpenBaselayer(a,b){$.getJSON("mod_mapbender/search_proxy.php?languageCode=de&resultTarget=web&resourceIds="+b,function(b){$.each(b.wms.srv,function(b,c){$.each(c.layer,function(b,d){d.layer&&(d=d.layer[0]);var g=new OpenLayers.Layer.WMS(a,c.getMapUrl,{layers:d.name,format:"image/png",transparent:"false",transitionEffect:"resize"},{projection:mapProj,units:projUnits,singleTile:!0,isBaseLayer:!0,alwaysInRange:!0});map.addLayers([g])})})})}
+function addOpenBaselayer(a,b){$.getJSON("mod_mapbender/search_proxy.php?languageCode=de&resultTarget=web&resourceIds="+b,function(b){$.each(b.wms.srv,function(b,c){$.each(c.layer,function(b,d){d.layer&&(d=d.layer[0]);var h=new OpenLayers.Layer.WMS(a,c.getMapUrl,{layers:d.name,format:"image/png",transparent:"false",transitionEffect:"resize"},{projection:mapProj,units:projUnits,singleTile:!0,isBaseLayer:!0,alwaysInRange:!0});map.addLayers([h])})})})}
 function zoomToBbox(a){var b=a.split(","),a=(new OpenLayers.LonLat(b[0],b[1])).transform(wgs84Proj,mapProj),b=(new OpenLayers.LonLat(b[2],b[3])).transform(wgs84Proj,mapProj);map.zoomToExtent(new OpenLayers.Bounds(a.lon,a.lat,b.lon,b.lat))}function numServices(){return $("#resultlist").find(".service").length}function numResultLayers(a){return a.find(".layer").length}function layerInList(a,b){for(var c=a.find(".layer"),d=0;d<c.length;d++)if($(c[d]).attr("layerid")==b)return d;return-1}
 function up(a){var b=layerInList($("#ownlist"),a);0<b&&($($("#ownlist").find(".layer")[b]).after($($("#ownlist").find(".layer")[b-1])),console.log("todo: layerreihenfolge"),map.raiseLayer(map.layers[getOpenlayersIndex(a)],1),validateArrows(),refresh())}function numOwnlayers(){return $("#ownlist").find(".layer").length}
 function refresh(){$("#resultlist").listview("refresh");$($("#ownlist").parent()).listview("refresh");$("div[data-role=collapsible]").collapsible();$("a[data-role=button]").button()}
@@ -43,15 +41,14 @@
 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,h=0;h<b.length;h++)if(b[h].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 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 h=b[f],g=h[1];h[0]==e.id&&service.append(ResultLayer(g.id,g.title,g.name,$(g).attr("abstract"),g.previewURL,"1"==g.queryable,e.getMapUrl,g.bbox))}$("#resultlist").append(service)}$("#resultlist").prepend('<li data-theme="b">Suchergebnis: '+
+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 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){$("#ownlist").empty();for(var d=[],e=0;e<a.length;e++)for(var f=a[e],h=0;h<b.length;h++){var g=b[h],j=g[1];g[0]==f.id&&d.push(OwnLayer(j.id,j.title,j.name,$(j).attr("abstract"),f.title,$(f).attr("abstract"),j.previewURL,"1"==j.queryable,f.getMapUrl,j.bbox,f.avail))}for(e=0;e<c.length;e++)for(h=0;h<d.length;h++)if(c[e].layerId==d[h].attr("layerid")){g=d[h];$("#ownlist").append(g);addOpenlayer(g.attr("layerid"),g.attr("name"),g.attr("getMapUrl"));c[e].active||switchVisibility(g);
-break}validateLayers();validateArrows()}function clearOwnlist(){for(var a=$("#ownlist").find(".layer"),b=0;b<a.length;b++)removeLayer(a[b])}
-function appendWmc(a){for(var b=0;b<a.backGroundLayer.length;b++){var c=a.backGroundLayer[b];if(c.active)for(var d=$("#baselayers").find(".baselayer"),e=0;e<d.length;e++)if($(d[e]).attr("layerids")==c.name){switchVisibility(d[e]);break}}clearOwnlist();var f="";$.each(a.layerList,function(a,b){f=f+","+b.layerId});f=f.substr(1,f.length);$.getJSON(searchUrl+"&resourceIds="+f,function(b){b=parseMapBenderJson(b);appendWmcData(b.services,b.layers,a.layerList);$.mobile.hidePageLoadingMsg()})}
-function addBaselayers(){$("#baselayers").empty();vector_marker=new OpenLayers.Layer.Vector("Vector Layer",{});var a=new OpenLayers.Layer.TMS("Hybrid","http://www.gdi-rp-dienste2.rlp.de/mapcache/tms/",{layername:"test at UTM32",type:"jpeg",serviceVersion:"1.0.0",gutter:0,buffer:0,isBaseLayer:!0,transitionEffect:"resize",resolutions:[529.1666666667,396.875,264.5833333333,132.2916666667,66.1458333333,39.6875,26.4583333333,13.2291666667,6.6145833333,3.96875,2.6458333333,2.1166666667,1.3229166667,0.79375,
-0.2645833333,0.1322916667],units:projUnits,projection:mapProj,sphericalMercator:!1});$("#baselayers").append(BaseLayer("Rlp Zusammenstellung",a.name));var b=new OpenLayers.Layer.WMS("Luftbild","http://geo4.service24.rlp.de/wms/dop40_geo4.fcgi?",{layers:"dop",format:"image/jpeg",transparent:"false",transitionEffect:"resize"},{projection:mapProj,units:projUnits,singleTile:!1,alwaysInRange:!0,isBaseLayer:!0});$("#baselayers").append(BaseLayer("Luftbilder",b.name));var c=new OpenLayers.Layer.WMS("grenze_leer",
-"http://map1.naturschutz.rlp.de/service_basis/mod_wms/wms_getmap.php?mapfile=tk_rlp_gesamt&",{layers:"grenzen_land",format:"image/jpeg",transparent:"false",transitionEffect:"resize"},{projection:mapProj,units:projUnits,singleTile:!0,alwaysInRange:!0,isBaseLayer:!0});$("#baselayers").append(BaseLayer("keine Hintergrundkarte",c.name));map.addLayers([a,b,c,vector_marker]);for(i in baseinfo)a=baseinfo[i][0],b=baseinfo[i][1],$("#baselayers").append(BaseLayer(a,b)),addOpenBaselayer(a,b);base_check($("#baselayers").find(".baselayer").first())}
+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);
+break}validateLayers();validateArrows();b=d.split(",");a=(new OpenLayers.LonLat(b[0],b[1])).transform(e,mapProj);e=(new OpenLayers.LonLat(b[2],b[3])).transform(e,mapProj);map.zoomToExtent(new OpenLayers.Bounds(a.lon,a.lat,e.lon,e.lat))}function clearOwnlist(){for(var a=$("#ownlist").find(".layer"),b=0;b<a.length;b++)removeLayer(a[b])}
+function appendWmc(a){for(var b=0;b<a.backGroundLayer.length;b++){var c=a.backGroundLayer[b];if(c.active)for(var d=$("#baselayers").find(".baselayer"),e=0;e<d.length;e++)if($(d[e]).attr("layerids")==c.name){switchVisibility(d[e]);break}}clearOwnlist();var f="";$.each(a.layerList,function(a,b){f=f+","+b.layerId});f=f.substr(1,f.length);$.getJSON(searchUrl+"&resourceIds="+f,function(b){b=parseMapBenderJson(b);appendWmcData(b.services,b.layers,a.layerList,a.wmc.bbox,a.wmc.crs);$.mobile.hidePageLoadingMsg()})}
+function addBaselayers(){$("#baselayers").empty();vector_marker=new OpenLayers.Layer.Vector("Vector Layer",{});$("#baselayers").append(BaseLayer("RLP Zusammenstellung",atkis_praes_tms.name));$("#baselayers").append(BaseLayer("Luftbilder",luftbilder.name));$("#baselayers").append(BaseLayer("Keine Hintergrundkarte",grenze_leer.name));map.addLayers([atkis_praes_tms,luftbilder,grenze_leer,vector_marker]);for(i in baseinfo){var a=baseinfo[i][0],b=baseinfo[i][1];$("#baselayers").append(BaseLayer(a,b));
+addOpenBaselayer(a,b)}base_check($("#baselayers").find(".baselayer").first())}
 var initmap=function(){var a={theme:null,projection:mapProj,units:projUnits,maxExtent:mymapbounds,maxScale:mymaxscale,minScale:myminscale,numZoomLevels:myzoomlevels,scales:myscales,controls:[new OpenLayers.Control.Attribution,new OpenLayers.Control.Navigation({zoomWheelEnabled:!0}),new OpenLayers.Control.KeyboardDefaults,new OpenLayers.Control.TouchNavigation({dragPanOptions:{interval:10,enableKinetic:!0}}),new OpenLayers.Control.ScaleLine({div:document.getElementById("scaleline"),geodesic:!1,maxWidth:100,
 topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null}),new OpenLayers.Control.LoadingPanel({})]};map=new OpenLayers.Map("map",a);addmyLayer();"off"!==myzoombounds?map.zoomToExtent(myzoombounds):map.zoomToExtent(map.maxExtent);a=new OpenLayers.Control.Geolocate({id:"locate-control",geolocationOptions:{enableHighAccuracy:!0,maximumAge:0,timeout:7E3}});map.addControl(a);a.events.register("locationupdated",this,function(a){vector_marker.removeAllFeatures();vector_marker.addFeatures([new OpenLayers.Feature.Vector(a.point,
 {},olGpsSymbol),new OpenLayers.Feature.Vector(OpenLayers.Geometry.Polygon.createRegularPolygon(new OpenLayers.Geometry.Point(a.point.x,a.point.y),a.position.coords.accuracy/2,50,0),{},olGpscircleStyle)]);a.point.x>map.maxExtent.left&&a.point.x<map.maxExtent.right&&a.point.y>map.maxExtent.bottom&&a.point.y<map.maxExtent.top?(setMarkerhint(window.lang.convert("Positionsgenauigkeit:"),"~ "+a.position.coords.accuracy+" Meter"),map.zoomToExtent(vector_marker.getDataExtent())):(alert(window.lang.convert("Die ermittelte Position liegt au\u00dferhalb des darstellbaren Kartenausschnitts!")),
@@ -71,15 +68,15 @@
 function hideAddressBar(){window.location.hash||(document.height<=window.outerHeight+10?(document.body.style.height=window.outerHeight+50+"px",setTimeout(function(){window.scrollTo(0,1)},50)):setTimeout(function(){window.scrollTo(0,1)},0))}
 function changeHand(a){"l"===a?(defaultHand="l",$("#scaleline, #copyright, #zoomscale").css("left","auto").css("right","4px"),$("#navbutgroup").css("right","auto").css("left","4px")):(defaultHand="r",$("#scaleline, #copyright, #zoomscale").css("right","auto").css("left","4px"),$("#navbutgroup").css("left","auto").css("right","4px"))}
 function changeLanguage(a,b){window.lang.change(a);$.mobile.showPageLoadingMsg();$.ajax({url:"help/help_"+a+".html",cache:!0}).done(function(a){$("#helpdiv").html(a);$.mobile.hidePageLoadingMsg()});b&&$("#select-hand").selectmenu("refresh",!0);$("#select-lang").val(a)}
-function codeAddress(){adressgeocoder=new google.maps.Geocoder;var a=document.getElementById("searchfield").value;adressgeocoder.geocode({address:a},function(b,c){if(c===google.maps.GeocoderStatus.OK){var d="no";for(i=0;i<b[0].address_components.length;i++)b[0].address_components[i].long_name===googleGeocodeAdmin&&(d="ok");if("ok"!=d)alert("Adresse liegt nicht in "+googleGeocodeAdmin+"!");else{var d=b[0].formatted_address,e=b[0].geometry.location.lat(),f=b[0].geometry.location.lng(),h=new google.maps.LatLng(e,
-f),g={zoom:11,center:h,mapTypeId:google.maps.MapTypeId.ROADMAP},g=new google.maps.Map(document.getElementById("mygooglemap"),g);new google.maps.Marker({map:g,position:h});d=window.lang.convert("Suchergebnis: ")+d+'  <br><div class="searchbutton" onClick="zoomtosearchpoint(\''+d+"',"+f+","+e+')" >'+window.lang.convert("Zoom auf Ergebnis in Karte")+"</div>";$("#mygooglelink").html(d)}}else alert("Geocode nicht erfolgreich, Fehler: "+a+"  "+c)})}
+function codeAddress(){adressgeocoder=new google.maps.Geocoder;var a=document.getElementById("searchfield").value;adressgeocoder.geocode({address:a},function(b,c){if(c===google.maps.GeocoderStatus.OK){var d="no";for(i=0;i<b[0].address_components.length;i++)b[0].address_components[i].long_name===googleGeocodeAdmin&&(d="ok");if("ok"!=d)alert("Adresse liegt nicht in "+googleGeocodeAdmin+"!");else{var d=b[0].formatted_address,e=b[0].geometry.location.lat(),f=b[0].geometry.location.lng(),g=new google.maps.LatLng(e,
+f),h={zoom:11,center:g,mapTypeId:google.maps.MapTypeId.ROADMAP},h=new google.maps.Map(document.getElementById("mygooglemap"),h);new google.maps.Marker({map:h,position:g});d=window.lang.convert("Suchergebnis: ")+d+'  <br><div class="searchbutton" onClick="zoomtosearchpoint(\''+d+"',"+f+","+e+')" >'+window.lang.convert("Zoom auf Ergebnis in Karte")+"</div>";$("#mygooglelink").html(d)}}else alert("Geocode nicht erfolgreich, Fehler: "+a+"  "+c)})}
 function searchStreet(a){$.mobile.showPageLoadingMsg();$("#search_results").empty();$.getJSON("mod_streetsearch/street_full.php?lang=de&searchfield="+a,function(a){if("++"===a.totalResultsCount){var c='<li data-role="list-divider">'+window.lang.convert("Zu viele Datens\u00e4tze! Bitte schr\u00e4nken Sie Ihre Suche ein!")+"</li>";$("#search_results").append(c);$("#search_results").listview("refresh")}else c='<li data-role="list-divider"> '+a.totalResultsCount+" "+window.lang.convert("Suchergebnisse")+
 "</li>",$("#search_results").append(c),$.each(a.geonames,function(a,b){c="";c+='<li><a href="javascript:void(0);" onClick="searchHsn(\''+b.strid+"');\" ><h2>"+b.title1+"</h2>";c+="<p>"+b.title2+"</p></a></li>";$("#search_results").append(c)}),$("#search_results").listview("refresh"),a={words:$('input[name="searchfield"]').val()},highlight("search_results",a);$.mobile.hidePageLoadingMsg()})}
 function searchHsn(a){$.mobile.showPageLoadingMsg();$("#search_results").empty();$.getJSON("mod_streetsearch/street_hsn.php?lang=de&strid="+a,function(a){var c='<li data-role="list-divider" ><a href="javascript:void(0);" onClick="zoomtosearchpoint(\''+a.street+"',"+a.streetx+","+a.streety+');" ><h2>'+a.street+"</h2>",c=c+("<p>"+a.totalResultsCount+" "+window.lang.convert("Hausnummern")+"</p></a></li>");$("#search_results").append(c);$.each(a.geonames,function(d,e){c="";c+='<li><a href="javascript:void(0);" onClick="zoomtosearchpoint(\''+
 a.street+" "+e.title1+"',"+e.x+","+e.y+');" ><h2>Nr. '+e.title1+"</h2>";c+="<p>"+e.title2+"</p></a></li>";$("#search_results").append(c)});$("#search_results").listview("refresh");$.mobile.hidePageLoadingMsg()})}
-function searchMapbender(a){$.mobile.showPageLoadingMsg();$("#search_results").empty();var b=mapbendersearchurl+searchEPSG;$.getJSON(b+("&searchText="+a),function(a){if(500<a.totalResultsCount){var b='<li data-role="list-divider" >'+window.lang.convert("Zu viele Datens\u00e4tze! Bitte schr\u00e4nken Sie Ihre Suche ein!")+"</li>";$("#search_results").append(b);$("#search_results").listview("refresh")}else b='<li data-role="list-divider" > '+a.totalResultsCount+" "+window.lang.convert("Suchergebnisse")+
-"</li>",$("#search_results").append(b),$.each(a.geonames,function(a,c){var h=(parseInt(c.minx)+parseInt(c.maxx))/2,g=(parseInt(c.miny)+parseInt(c.maxy))/2;b="";b="gemeinde_neu"===c.category||"Gemeinde"===c.category||"verbandsgemeinde"===c.category||"kreis"===c.category||"Kreis"===c.category?b+('<li><a href="javascript:void(0);" onClick="zoomtoextent(\''+c.title+"',"+c.minx+","+c.miny+","+c.maxx+","+c.maxy+');" ><h2>'+c.title+"</h2>"):b+('<li><a href="javascript:void(0);" onClick="zoomtosearchpoint(\''+
-c.title+"',"+h+","+g+');" ><h2>'+c.title+"</h2>");b+="<p>"+c.category+"</p></a></li>";$("#search_results").append(b)}),$("#search_results").listview("refresh"),a={words:$('input[name="searchfield"]').val()},highlight("search_results",a);$.mobile.hidePageLoadingMsg()})}
+function searchMapbender(a){$.mobile.showPageLoadingMsg();$("#search_results").empty();$.getJSON(mapbendersearchurl+searchEPSG+("&searchText="+a),function(a){if(500<a.totalResultsCount){var c='<li data-role="list-divider" >'+window.lang.convert("Zu viele Datens\u00e4tze! Bitte schr\u00e4nken Sie Ihre Suche ein!")+"</li>";$("#search_results").append(c);$("#search_results").listview("refresh")}else c='<li data-role="list-divider" > '+a.totalResultsCount+" "+window.lang.convert("Suchergebnisse")+"</li>",
+$("#search_results").append(c),$.each(a.geonames,function(a,b){var f=(parseInt(b.minx)+parseInt(b.maxx))/2,g=(parseInt(b.miny)+parseInt(b.maxy))/2;c="";c="gemeinde_neu"===b.category||"Gemeinde"===b.category||"verbandsgemeinde"===b.category||"kreis"===b.category||"Kreis"===b.category?c+('<li><a href="javascript:void(0);" onClick="zoomtoextent(\''+b.title+"',"+b.minx+","+b.miny+","+b.maxx+","+b.maxy+');" ><h2>'+b.title+"</h2>"):c+('<li><a href="javascript:void(0);" onClick="zoomtosearchpoint(\''+b.title+
+"',"+f+","+g+');" ><h2>'+b.title+"</h2>");c+="<p>"+b.category+"</p></a></li>";$("#search_results").append(c)}),$("#search_results").listview("refresh"),a={words:$('input[name="searchfield"]').val()},highlight("search_results",a);$.mobile.hidePageLoadingMsg()})}
 function highlight(a,b){var c={words:"",caseSensitive:!1,wordsOnly:!0,template:'$1<span class="highlight">$2</span>$3'},d;$.extend(!0,c,b||{});0!=c.words.length&&(d=RegExp("(>[^<.]*)("+c.words+")([^<.]*)",c.caseSensitive?"":"ig"),$("#"+a).each(function(){var a=$(this).html();a&&$(this).html(a.replace(d,c.template))}))}
 function zoompoint(a,b){var c=new OpenLayers.LonLat(a,b),d=new OpenLayers.Geometry.Point(a,b),e=new OpenLayers.Geometry.Point(a,b);vector_marker.removeAllFeatures();vector_marker.addFeatures([new OpenLayers.Feature.Vector(d,{},olSearchSymbol),new OpenLayers.Feature.Vector(e,{},olFeaturequerySymbol)]);map.setCenter(c,getZoomlevel())}
 function zoomtosearchpoint(a,b,c){setMarkerhint(window.lang.convert("Suchergebnis: "),a);a=new OpenLayers.LonLat(b,c);if("google"===searchMode)var d=a.transform(wgs84Proj,mapProj);else if("streetsearch"===searchMode||"mapbendersearch"===searchMode)d=a;a=new OpenLayers.Geometry.Point(d.lon,d.lat);b=new OpenLayers.Geometry.Point(d.lon,d.lat);vector_marker.removeAllFeatures();vector_marker.addFeatures([new OpenLayers.Feature.Vector(a,{},olSearchSymbol),new OpenLayers.Feature.Vector(b,{},olFeaturequerySymbol)]);

Modified: trunk/mapbender/http/extensions/mobilemap/map.php
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/map.php	2013-05-14 14:37:38 UTC (rev 8620)
+++ trunk/mapbender/http/extensions/mobilemap/map.php	2013-05-20 13:58:14 UTC (rev 8621)
@@ -14,7 +14,30 @@
 if (isset($_GET['wmcid'])) {
 	$wmcid = htmlspecialchars($_GET["wmcid"]);
 }
-
+//Validate parameters for zooming to special extent for WMC
+if(isset($_REQUEST["mb_myBBOX"]) && $_REQUEST["mb_myBBOX"] != ""){
+	//Check for numerical values for BBOX
+	$array_bbox = explode(',',$_REQUEST["mb_myBBOX"]);
+	if ((is_numeric($array_bbox[0])) and (is_numeric($array_bbox[1])) and (is_numeric($array_bbox[2])) and (is_numeric($array_bbox[3])) ) {
+		$mb_myBBOX = $_REQUEST["mb_myBBOX"];
+		if(isset($_REQUEST["mb_myBBOXEpsg"])){
+			//Check epsg
+			$targetEpsg=intval($_REQUEST["mb_myBBOXEpsg"]);
+			if (($targetEpsg >= 1) and ($targetEpsg <= 50001)) {
+				#echo "is in the codespace of the epsg registry\n";
+				$mb_myBBOXEpsg = $targetEpsg;
+				
+			} else {
+				#echo "is outside\n";
+				echo 'The REQUEST parameter mb_myBBOXEpsg is not in the epsg realm - please define another EPSG Code.';
+				die();
+			}
+		}	
+	} else {
+		echo "The REQUEST parameters for mb_myBBOX are not numeric - please give numeric values!";
+		die();
+	} 
+}
 ?>
 <!DOCTYPE html>
 <html>
@@ -66,6 +89,10 @@
 		changeLanguage('<?php echo $mylang; ?>',false);
 		<?php if($wmcid != ''){ ?>
 		var wmcurl = '<?php echo $mapbender_wmcurl.$wmcid; ?>';
+		//add user defined bbox values if given
+		<?php if(isset($mb_myBBOX) && isset($mb_myBBOXEpsg)){ ?>
+			var wmcurl = wmcurl+"&mb_myBBOX="+<?php echo "'".$mb_myBBOX."'"; ?>+"&mb_myBBOXEpsg="+<?php echo "'".$mb_myBBOXEpsg."'"; ?>;
+		<?php } ?>
 		searchWmc(wmcurl);
 		<?php } ?>
 	});

Modified: trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js	2013-05-14 14:37:38 UTC (rev 8620)
+++ trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js	2013-05-20 13:58:14 UTC (rev 8621)
@@ -251,7 +251,7 @@
 	});
 }
 
-// Zoomen auf bestimmte Boundingbox
+// Zoomen auf bestimmte Boundingbox (in WGS84 gegeben!)
 function zoomToBbox(bbox){
 	var extend=bbox.split(',');
 	var p1 = new OpenLayers.LonLat(extend[0],extend[1]).transform(wgs84Proj,mapProj);
@@ -527,7 +527,7 @@
 }
 
 // Fügt die WMC-Layer in das DOM ein
-function appendWmcData(services,layers,layerlist){
+function appendWmcData(services,layers,layerlist,bbox,crs){
 	$("#ownlist").empty();
 	var ownlayers = [];
 	for(var i=0; i<services.length; i++){
@@ -561,6 +561,11 @@
 	}
 	validateLayers();
 	validateArrows();
+	//zoom to wmc extent
+	var extend=bbox.split(',');
+	var p1 = new OpenLayers.LonLat(extend[0],extend[1]).transform(crs,mapProj);
+	var p2 = new OpenLayers.LonLat(extend[2],extend[3]).transform(crs,mapProj);
+	map.zoomToExtent(new OpenLayers.Bounds(p1.lon, p1.lat, p2.lon, p2.lat));
 	
 }
 
@@ -588,7 +593,9 @@
 			}
 		}
 	}
-
+	// Parsen der bbox aus wmc 
+	//var bbox = json.wmc.bbox;
+	//var crs = json.wmc.crs;
 	// Alle ausgewählten overlays entfernen
 	clearOwnlist();
 
@@ -603,7 +610,7 @@
 	$.getJSON(searchUrl+'&resourceIds='+layerids, function(data){	
 		// Informationen sammeln und Parsen
 		var datacollection=parseMapBenderJson(data);
-		appendWmcData(datacollection.services,datacollection.layers,json.layerList);
+		appendWmcData(datacollection.services,datacollection.layers,json.layerList,json.wmc.bbox,json.wmc.crs);
 		$.mobile.hidePageLoadingMsg();
 	});
 }

Modified: trunk/mapbender/http/php/mod_exportWmc2Json.php
===================================================================
--- trunk/mapbender/http/php/mod_exportWmc2Json.php	2013-05-14 14:37:38 UTC (rev 8620)
+++ trunk/mapbender/http/php/mod_exportWmc2Json.php	2013-05-20 13:58:14 UTC (rev 8621)
@@ -19,6 +19,8 @@
 $user = new User();
 $admin = new administration();
 $userId = $user->id;
+$mb_myBBOX = null;
+$mb_myBBOXEpsg = null;
 //check for parameter wmc_id
 if(!isset($_GET["wmc_id"])){
 	echo 'Error: wmc_id not requested<br>';
@@ -39,7 +41,7 @@
 	$testMatch = $_REQUEST["wmc_id"];
 	$pattern = '/^[0-9_]*$/';
 	if (!preg_match($pattern,$testMatch)){ 
-		echo 'wmc_id: <b>'.$testMatch.'</b> is not valid.<br/>'; 
+		echo 'Parameter <b>wmc_id</b> is not valid - no csv integer list!.<br/>'; 
 		die(); 		
 	}
 	$wmc_id = $testMatch;
@@ -54,18 +56,44 @@
 	$testMatch = $_REQUEST["epsg"];
 	$pattern = '/^[0-9]*$/';
 	if (!preg_match($pattern,$testMatch)){ 
-		echo 'epsg: <b>'.$testMatch.'</b> is not valid.<br/>'; 
+		echo 'epsg: <b>epsg</b> is not valid.<br/>'; 
 		die(); 		
 	}
 	$epsg = $testMatch;
 	$crs = "EPSG:".$epsg;
 	$testMatch = NULL;
 } else {
-	echo "Mandatory parameter <b>epsg</b> is not set or empty!";
+	echo "Parameter <b>epsg</b> is not set or empty!";
 	die();
 }
 
+//Validate parameters for zooming to special extent
+if(isset($_REQUEST["mb_myBBOX"]) && $_REQUEST["mb_myBBOX"] != ""){
+	//Check for numerical values for BBOX
+	$array_bbox = explode(',',$_REQUEST["mb_myBBOX"]);
+	if ((is_numeric($array_bbox[0])) and (is_numeric($array_bbox[1])) and (is_numeric($array_bbox[2])) and (is_numeric($array_bbox[3])) ) {
+		$mb_myBBOX = $_REQUEST["mb_myBBOX"];
+		if(isset($_REQUEST["mb_myBBOXEpsg"])){
+			//Check epsg
+			$targetEpsg=intval($_REQUEST["mb_myBBOXEpsg"]);
+			if (($targetEpsg >= 1) and ($targetEpsg <= 50001)) {
+				#echo "is in the codespace of the epsg registry\n";
+				$mb_myBBOXEpsg = $targetEpsg;
+				$e = new mb_notice("bbox for exportWmc2Json: ".$mb_myBBOX." - epsg: ".$mb_myBBOXEpsg);
+			} else {
+				#echo "is outside\n";
+				echo 'The REQUEST parameter mb_myBBOXEpsg is not in the epsg realm - please define another EPSG Code.';
+				die();
+			}
+		}	
+	} else {
+		echo "The REQUEST parameters for mb_myBBOX are not numeric - please give numeric values!";
+		die();
+	} 
+}
+//after that the mb_myBBOX, mb_myBBOXEpsg parameters may be ok
 
+
 //define background layer
 //define list of typical background layer ids
 //use wms id because the layers can be pulled dynamically
@@ -136,6 +164,8 @@
 	global $userId;
 	global $admin;
 	global $backgroundLayer;
+	global $mb_myBBOXEpsg;
+	global $mb_myBBOX;
 	//maybe faster to parse the xml itself and read the new layer_names and getmapurls directly
 	/* example reduced wmc json
 	{"wmc":{"id":"6","title":"Testwmc","bbox":"","timeStamp":"123123123"},"layerList":[{"internal":true,"currentFormat":"image/png","id":31452,"opacity":50},{"internal":"false","currentFormat":"image/jpeg","getMapUrl":"","layerTitle":"","layerName":"","layerAbstract":"","layerBbox":"","opacity":"50"}]}
@@ -154,8 +184,22 @@
 		die();
 	}
 	//transform coords if needed
+	//crs for client
 	$requestedEPSG = preg_replace("/EPSG:/","", $crs);
+	//crs from wmc
 	$wmcEPSG = preg_replace("/EPSG:/","", $row['srs']);
+	//overwrite wmc information with external given if own bbox is requested
+	if (isset($mb_myBBOXEpsg) && isset($mb_myBBOX)) {
+		$e = new mb_notice("user given extent information found");
+		//transform user defined bbox into bbox for mobile client
+		$wmcEPSG = $mb_myBBOXEpsg;
+		$bbox = explode(',',$mb_myBBOX);
+		//use given bbox instead that from database
+		$row['minx'] = $bbox[0];
+		$row['miny'] = $bbox[1];
+		$row['maxx'] = $bbox[2];
+		$row['maxy'] = $bbox[3];
+	}
 	if ($requestedEPSG != $wmcEPSG) {
 		//transform bbox to other crs
 		$llc = transform($row['minx'], $row['miny'], $wmcEPSG, $requestedEPSG);
@@ -168,7 +212,7 @@
 		$row['maxx'] = $urc["x"];
 		$row['maxy'] = $urc["y"];
 		$row['srs'] = "EPSG:".$requestedEPSG;
-		$e = new mb_exception("CRS for WMC with wmc_serial_id ".$row['wmc_serial_id']." is tranformed to ".$row['srs']);
+		$e = new mb_notice("CRS for WMC with wmc_serial_id ".$row['wmc_serial_id']." is tranformed to ".$row['srs']);
 	}
 	//build object
 	//build background part
@@ -192,6 +236,9 @@
 	$wmcObject->wmc->timeStamp = $row['wmc_timestamp'];
 	//transform bbox to requested crs
 	//TODO
+	//check if special other crs is requested
+	//check if other bbox is requested
+	
 	$wmcObject->wmc->crs = $row['srs'];
 	$wmcObject->wmc->bbox = $row['minx'].",".$row['miny'].",".$row['maxx'].",".$row['maxy'];
 	//parse wmc

Modified: trunk/mapbender/http/php/mod_getWmcDisclaimer.php
===================================================================
--- trunk/mapbender/http/php/mod_getWmcDisclaimer.php	2013-05-14 14:37:38 UTC (rev 8620)
+++ trunk/mapbender/http/php/mod_getWmcDisclaimer.php	2013-05-20 13:58:14 UTC (rev 8621)
@@ -7,7 +7,7 @@
 //following is needed cause sometimes the service is invoked as a localhost service and then no userId is known but the userId in the session is needed for class_wmc to read from database!!! TODO: check if needed in this class.
 $userId = Mapbender::session()->get("mb_user_id");
 if (!isset($userId) or $userId =='') {
-	$userId = ANONYMOUS_USER; //or public
+	$userId = PUBLIC_USER; //or public
 	Mapbender::session()->set("mb_user_id",$userId);
 }
 $languageCode = 'de';
@@ -18,7 +18,7 @@
 
 //initialize variables
 $hostName = $_SERVER['HTTP_HOST'];
-$userId = ANONYMOUS_USER;
+//$userId = PUBLIC_USER;
 $id = 4373; //dummy id
 //TODO give requesting hostname to this script
 if (isset($_REQUEST["id"]) & $_REQUEST["id"] != "") {



More information about the Mapbender_commits mailing list