[Mapbender-commits] r8622 - in trunk/mapbender/http/extensions/mobilemap: . _build js js/dev mod_mapbender
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue May 21 08:06:10 PDT 2013
Author: armin11
Date: 2013-05-21 08:06:10 -0700 (Tue, 21 May 2013)
New Revision: 8622
Removed:
trunk/mapbender/http/extensions/mobilemap/backgroundlayer.php~
trunk/mapbender/http/extensions/mobilemap/js/dev/2_ngms_global.js~
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/dev/1_ngms_olextent.js
trunk/mapbender/http/extensions/mobilemap/js/dev/5_ngms_jq.js
trunk/mapbender/http/extensions/mobilemap/js/ngms_event.min.js
trunk/mapbender/http/extensions/mobilemap/map.php
trunk/mapbender/http/extensions/mobilemap/map.php~
trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.css
trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js
trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js~
Log:
New possibility to show featureInfo in new window (mobile client extension)
Modified: trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.js 2013-05-20 13:58:14 UTC (rev 8621)
+++ trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.js 2013-05-21 15:06:10 UTC (rev 8622)
@@ -31,7 +31,7 @@
},
onClick: function( evt ) {
- // click funcktion
+ // click function
var lonlat = map.getLonLatFromViewPortPx(evt.xy);
var querylayer = $('#queryselect').val();
var actuallang = $('#select-lang').val();
@@ -130,11 +130,16 @@
url: myurl,
//data: {layers:mylayers,imgsize:myimgsize},
success: function(ergebnis){
+ alert(myurl);
if(ergebnis){
+ alert(ergebnis);
if(ergebnis.length < 5){
ergebnis = window.lang.convert('Kein Ergebnis!');
}
setMarkerhint(window.lang.convert('Abfrageergebnis:'),ergebnis);
+ //go to other window and set content
+ //$.mobile.changePage($("#featureinforesult"),pageTransition);
+ //$("#fi_contentdiv").val(ergebnis);
}
}
});
@@ -639,7 +644,7 @@
},
onClick: function( evt ) {
- // click funcktion
+ // click funktion
var lonlat = map.getLonLatFromViewPortPx(evt.xy);
var querylayer = $('#ownlist').find('.query_checked').parent();
var actuallang = $('#select-lang').val();
@@ -650,9 +655,19 @@
vector_marker.addFeatures([
new OpenLayers.Feature.Vector(geompoint,{},olSearchSymbol),
new OpenLayers.Feature.Vector(geompoint1,{},olFeaturequerySymbol)
- ]);
- setMarkerhint(window.lang.convert('Meldung:'),window.lang.convert('bitte warten...'));
-
+ ]);
+ if ($("#select-feature-info").val() === 'p') {
+ var fiPopUp = true;
+ } else {
+ var fiPopUp = false;
+ }
+ if (fiPopUp) {
+ setMarkerhint(window.lang.convert('Meldung:'),window.lang.convert('bitte warten...'));
+ } else {
+ $.mobile.changePage($("#featureinforesult"),pageTransition);
+ $("#ficontentdiv").text(window.lang.convert("Bitte warten..."));
+ }
+ //
if(querylayer.length>0){
// Abfrage des ausgewählten Layers
var featureurl = querylayer.attr('getmapurl')
@@ -663,13 +678,28 @@
+ '&BBOX=' + map.getExtent().toBBOX()
+ '&WIDTH=' + map.size.w + '&HEIGHT=' + map.size.h
+ '&X=' + evt.xy.x + '&Y=' + evt.xy.y
- + '&INFO_FORMAT=text/html';
- var iframe=$('<iframe src="'+featureurl+'" class="query_iframe">'
+ + '&INFO_FORMAT=text/html'
+ + '&FORMAT=image/png' //only for some wms that have problems if this parameter is not given
+ + '&STYLES='; //only for some wms that have problems if this parameter is not given
+
+ if (fiPopUp) {
+ var iframe=$('<iframe src="'+featureurl+'" class="query_iframe">'
+'<p>Die Abfrage kann leider nicht angezeigt werden.</p></img>'
);
- setMarkerhint('Abfrageergebnis:',iframe);
+ setMarkerhint('Abfrageergebnis:',iframe);
+ } else {
+ var iframe=$('<iframe src="'+featureurl+'" class="query_iframe_full">'
+ +'<p>Die Abfrage kann leider nicht angezeigt werden.</p></img>'
+ );
+ //alert(featureurl);
+ //$.mobile.changePage($("#featureinforesult"),pageTransition);
+ $("#ficontentdiv").text("");
+ $("#ficontentdiv").append(iframe);
+ //add onclick delete iframe from page
+
+ }
} else {
- // Standartabfrage, falls keiner ausgewählt ist
+ // Standardabfrage, falls keiner ausgewählt ist
var featureurl = 'query/rasterquery.php?coord='+lonlat.lon+ ', '+lonlat.lat+'&lang='+actuallang;
loadFeature(featureurl);
}
@@ -1781,7 +1811,19 @@
$("#navbutgroup").css("left","auto").css("right","4px");
}
}
-
+//Feature Info ändern
+function changeFeatureInfo(h){
+ //Popup
+ if(h === "p"){
+ //$("#scaleline, #copyright, #zoomscale").css("left","auto").css("right","4px");
+ //$("#navbutgroup").css("right","auto").css("left","4px");
+ }
+ //Neues Fenster (default)
+ else{
+ //$("#scaleline, #copyright, #zoomscale").css("right","auto").css("left","4px");
+ //$("#navbutgroup").css("left","auto").css("right","4px");
+ }
+}
//Sprache umstellen
function changeLanguage(lang,refresh){
window.lang.change(lang);
Modified: trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.min.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.min.js 2013-05-20 13:58:14 UTC (rev 8621)
+++ trunk/mapbender/http/extensions/mobilemap/_build/ngms_event.min.js 2013-05-21 15:06:10 UTC (rev 8622)
@@ -2,7 +2,7 @@
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)]);"dhm"==c?(setMarkerhint(window.lang.convert("Meldung:"),window.lang.convert("bitte warten...")),a="query/rasterquery.php?coord="+b.lon+", "+b.lat+"&lang="+d):"pois"==c?a="query/poiquery.php?qx="+b.lon+"&qy="+b.lat+"&qlayer="+poilayer.params.LAYERS+
"&qextent="+map.getExtent().toBBOX()+"&qsize="+map.size.w+" "+map.size.h+"&lang="+d:(setMarkerhint(window.lang.convert("Meldung:"),window.lang.convert("bitte warten...")),a="query/proxy.php?wms=SERVICE=WMS&REQUEST=getFeatureInfo&VERSION=1.1.1&mapfile="+c+"&layers="+c+"&QUERY_LAYERS="+c+"&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");loadFeature(a)},showQuerylayer:function(){var a=$("#queryselect").val();
"dhm"==a?setMarkerhint(window.lang.convert("Standardabfrage:"),window.lang.convert("Koordinaten + Hoehe")):setMarkerhint(window.lang.convert("aktuelle Abfrageebene:"),a)},CLASS_NAME:"OpenLayers.Control.Click"});function showQuerylayer(){var a=$("#queryselect").val();"dhm"==a?setMarkerhint(window.lang.convert("Standardabfrage:"),window.lang.convert("Koordinaten + Hoehe")):setMarkerhint(window.lang.convert("aktuelle Abfrageebene:"),a)}
-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))}})}
+function loadFeature(a){$.ajax({type:"GET",url:a,success:function(b){alert(a);b&&(alert(b),5>b.length&&(b=window.lang.convert("Kein Ergebnis!")),setMarkerhint(window.lang.convert("Abfrageergebnis:"),b))}})}
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,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+
@@ -22,10 +22,10 @@
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"),
-pageTransition);refresh()});$("#mapbendersearchformbut").click(function(){searchMaps(searchUrl+"&searchText="+$("#mapbendersearchfield").val())});$("#mapbendersearchfield").live("keypress",function(a){13===a.keyCode&&searchMaps(searchUrl+"&searchText="+$("#mapbendersearchfield").val())});$("div[data-role=collapsible]").live("expand",function(){$("div[data-role=collapsible]").not($(this)).trigger("collapse")});$(".addToMapBut").click(function(){$("div[data-role=collapsible]").not(".ui-collapsible-collapsed").trigger("collapse");
-$.mobile.changePage($("#mappage"),pageTransition)});addBaselayers()}
+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)]);(e="p"===$("#select-feature-info").val()?!0:!1)?setMarkerhint(window.lang.convert("Meldung:"),window.lang.convert("bitte warten...")):($.mobile.changePage($("#featureinforesult"),pageTransition),$("#ficontentdiv").text(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&FORMAT=image/png&STYLES=",e?(a=$('<iframe src="'+a+'" class="query_iframe"><p>Die Abfrage kann leider nicht angezeigt werden.</p></img>'),setMarkerhint("Abfrageergebnis:",a)):(a=
+$('<iframe src="'+a+'" class="query_iframe_full"><p>Die Abfrage kann leider nicht angezeigt werden.</p></img>'),$("#ficontentdiv").text(""),$("#ficontentdiv").append(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"),pageTransition);refresh()});$("#mapbendersearchformbut").click(function(){searchMaps(searchUrl+"&searchText="+$("#mapbendersearchfield").val())});
+$("#mapbendersearchfield").live("keypress",function(a){13===a.keyCode&&searchMaps(searchUrl+"&searchText="+$("#mapbendersearchfield").val())});$("div[data-role=collapsible]").live("expand",function(){$("div[data-role=collapsible]").not($(this)).trigger("collapse")});$(".addToMapBut").click(function(){$("div[data-role=collapsible]").not(".ui-collapsible-collapsed").trigger("collapse");$.mobile.changePage($("#mappage"),pageTransition)});addBaselayers()}
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)}
@@ -66,7 +66,7 @@
$(this).css("background-image","url(img/ico_basecheck_active.png)")});$(".layer_check").each(function(){for(var a=0;a<map.layers.length;a++)map.layers[a].name===$(this).attr("id")&&map.layers[a].visibility&&$(this).css("background-image","url(img/ico_check_active.png)")});$(".poi_check").each(function(){var a=poilayer.params.LAYERS,b=[];""!=a&&(b=a.split(","));-1!=jQuery.inArray($(this).attr("id"),b)&&$(this).css("background-image","url(img/ico_check.png)")});$(".query_check").each(function(){var a=
$(this).attr("id");a.substring(0,a.length-6)===$("#queryselect").val()&&$(this).css("background-image","url(img/ico_checkop_active.png)")})};function searchCall(){"google"===searchMode?codeAddress():"streetsearch"===searchMode?searchStreet($("#searchfield").val()):"mapbendersearch"===searchMode?searchMapbender($("#searchfield").val()):alert("kein Suchmodus konfiguriert!")}function setMarkerhint(a,b){$("#xheader").html(a);$("#xcontent").html(b);$("#markerhint").css("visibility","visible")}
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 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 changeFeatureInfo(){}
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(),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)})}
Deleted: trunk/mapbender/http/extensions/mobilemap/backgroundlayer.php~
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/backgroundlayer.php~ 2013-05-20 13:58:14 UTC (rev 8621)
+++ trunk/mapbender/http/extensions/mobilemap/backgroundlayer.php~ 2013-05-21 15:06:10 UTC (rev 8622)
@@ -1,12 +0,0 @@
-<?php
-//Basic configuration of mapserver client
-require_once(dirname(__FILE__)."/../../../conf/mobilemap.conf");
-$js = "";
-$js .= $constants;
-for ($i = 0; $i < count($layer); $i++) {
- $js .= $layer[$i];
-}
-//header - javascript
-
-echo $js;
-?>
Modified: trunk/mapbender/http/extensions/mobilemap/js/dev/1_ngms_olextent.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/js/dev/1_ngms_olextent.js 2013-05-20 13:58:14 UTC (rev 8621)
+++ trunk/mapbender/http/extensions/mobilemap/js/dev/1_ngms_olextent.js 2013-05-21 15:06:10 UTC (rev 8622)
@@ -30,7 +30,7 @@
},
onClick: function( evt ) {
- // click funcktion
+ // click function
var lonlat = map.getLonLatFromViewPortPx(evt.xy);
var querylayer = $('#queryselect').val();
var actuallang = $('#select-lang').val();
@@ -129,11 +129,16 @@
url: myurl,
//data: {layers:mylayers,imgsize:myimgsize},
success: function(ergebnis){
+ alert(myurl);
if(ergebnis){
+ alert(ergebnis);
if(ergebnis.length < 5){
ergebnis = window.lang.convert('Kein Ergebnis!');
}
setMarkerhint(window.lang.convert('Abfrageergebnis:'),ergebnis);
+ //go to other window and set content
+ //$.mobile.changePage($("#featureinforesult"),pageTransition);
+ //$("#fi_contentdiv").val(ergebnis);
}
}
});
Deleted: trunk/mapbender/http/extensions/mobilemap/js/dev/2_ngms_global.js~
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/js/dev/2_ngms_global.js~ 2013-05-20 13:58:14 UTC (rev 8621)
+++ trunk/mapbender/http/extensions/mobilemap/js/dev/2_ngms_global.js~ 2013-05-21 15:06:10 UTC (rev 8622)
@@ -1,87 +0,0 @@
-// Global
-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");
-var wgs84Proj = new OpenLayers.Projection("EPSG:4326");
-var mymapbounds = new OpenLayers.Bounds(293300,5424000,464300,5654100); //Rlp UTM 32
-var myzoombounds = "off"; //new OpenLayers.Bounds(3460280,5482455,3462440,5484561); //Anfangsausdehnung (deaktiv auf "off" setzen)
-var mymaxscale = 2000000;
-var myminscale = 500;
-var myzoomlevels = 16;
-var myscales = [2000000, 1500000, 1000000, 500000, 250000, 150000, 100000, 50000, 25000, 15000, 10000, 8000, 5000, 3000, 1000, 500]; //Maßstäbe die dargestellt werden sollen
-var zoomSelect = true; //Soll Select aus myscales dargestellt werden? (true/false)
-var projUnits = 'm';
-var searchMode = 'mapbendersearch'; //Suchmodus (google/streetsearch/mapbendersearch)
-var mapbendersearchurl = 'query/searchproxy.php?resultTarget=web&outputFormat=json&searchEPSG='; //Url bzw. Proxy zur Mapbender Ortsuche
-var searchEPSG = '25832'; //EPSG Anfrage für Mapbender-Suche
-var searchZoom = 12; //Zoomlevel in der Karte
-var defaultHand = "r"; //Anfangs Händigkeit (r/l)
-var googleGeocodeAdmin = "Rheinland-Pfalz"; //Administrative Einheit in der eine Meldung kommen soll falls geocodierter Punkt außerhalb liegt
-var directLayerChange = "on"; //Wechsel aus Layersteuerung direkt bei Klick auf Ebene (on/off)
-var pageTransition = {transition: "fade"}; //Objekt, Seitenübergänge (vgl. jQuerymobile, z.B. fade, pop, slide, none)
-var toolColor = "#871D33"; //Farbe der Toolumrandungen
-var featurequerySrc = "EPSG:25832"; //EPSG der FeatureQuery
-
-//Openlayers Objekte
-//OpenLayers Kombinations Symbole (Objekt) zur Markierung des Suchergebnis u. Abfragepunktes (Featurequery), mögliche Namen: "star", "cross", "x", "square", "triangle", "circle"
-var olSearchSymbol = { graphicName: 'cross',
- strokeColor: '#00FFFF',
- strokeWidth: 1,
- fillOpacity: 0,
- pointRadius: 11 };
-var olFeaturequerySymbol = {graphicName: 'circle',
- strokeColor: '#00FFFF', //'#871D33',
- fillColor: '#00FFFF',
- strokeWidth: 3,
- fillOpacity: 0.2,
- pointRadius: 15,
- graphicName: 'circle'};
-
-//OpenLayers Symbol (Objekt) GPS-Lokalisierung, mögliche Namen: "star", "cross", "x", "square", "triangle", "circle"
-var olGpsSymbol = { graphicName: 'cross',
- strokeColor: '#871D33',
- strokeWidth: 2,
- fillOpacity: 0,
- pointRadius: 12 };
-
-//OpenLayers Symbol (Objekt) zur Markierung der GPS-Kreisfarbe + Stil
-var olGpscircleStyle = { fillOpacity: 0.1,
- fillColor: '#000',
- strokeColor: '#871D33',
- strokeOpacity: 0.6 };
-
-// default style für Zeichnungen
-var sketchSymbolizers = {
- "Point": {
- pointRadius: 6,
- graphicName: "square",
- fillColor: "white",
- fillOpacity: 1,
- strokeWidth: 2,
- strokeOpacity: 0.8,
- strokeColor: "#00FFFF"
- },
- "Line": {
- strokeWidth: 3,
- strokeOpacity: 1,
- //strokeDashstyle: "dash",
- strokeColor: "#FF0000"
-
- },
- "Polygon": {
- strokeWidth: 3,
- strokeOpacity: 1,
- strokeColor: "#FF0000",
- fillColor: "white",
- fillOpacity: 0.5
- }
-};
-
-//default Style für Zeich- / Messfunktion)
-var style = new OpenLayers.Style();
-style.addRules([
- new OpenLayers.Rule({symbolizer: sketchSymbolizers})
-]);
-var styleMap = new OpenLayers.StyleMap({"default": style});
-
Modified: trunk/mapbender/http/extensions/mobilemap/js/dev/5_ngms_jq.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/js/dev/5_ngms_jq.js 2013-05-20 13:58:14 UTC (rev 8621)
+++ trunk/mapbender/http/extensions/mobilemap/js/dev/5_ngms_jq.js 2013-05-21 15:06:10 UTC (rev 8622)
@@ -362,7 +362,19 @@
$("#navbutgroup").css("left","auto").css("right","4px");
}
}
-
+//Feature Info ändern
+function changeFeatureInfo(h){
+ //Popup
+ if(h === "p"){
+ //$("#scaleline, #copyright, #zoomscale").css("left","auto").css("right","4px");
+ //$("#navbutgroup").css("right","auto").css("left","4px");
+ }
+ //Neues Fenster (default)
+ else{
+ //$("#scaleline, #copyright, #zoomscale").css("right","auto").css("left","4px");
+ //$("#navbutgroup").css("left","auto").css("right","4px");
+ }
+}
//Sprache umstellen
function changeLanguage(lang,refresh){
window.lang.change(lang);
Modified: trunk/mapbender/http/extensions/mobilemap/js/ngms_event.min.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/js/ngms_event.min.js 2013-05-20 13:58:14 UTC (rev 8621)
+++ trunk/mapbender/http/extensions/mobilemap/js/ngms_event.min.js 2013-05-21 15:06:10 UTC (rev 8622)
@@ -2,7 +2,7 @@
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)]);"dhm"==c?(setMarkerhint(window.lang.convert("Meldung:"),window.lang.convert("bitte warten...")),a="query/rasterquery.php?coord="+b.lon+", "+b.lat+"&lang="+d):"pois"==c?a="query/poiquery.php?qx="+b.lon+"&qy="+b.lat+"&qlayer="+poilayer.params.LAYERS+
"&qextent="+map.getExtent().toBBOX()+"&qsize="+map.size.w+" "+map.size.h+"&lang="+d:(setMarkerhint(window.lang.convert("Meldung:"),window.lang.convert("bitte warten...")),a="query/proxy.php?wms=SERVICE=WMS&REQUEST=getFeatureInfo&VERSION=1.1.1&mapfile="+c+"&layers="+c+"&QUERY_LAYERS="+c+"&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");loadFeature(a)},showQuerylayer:function(){var a=$("#queryselect").val();
"dhm"==a?setMarkerhint(window.lang.convert("Standardabfrage:"),window.lang.convert("Koordinaten + Hoehe")):setMarkerhint(window.lang.convert("aktuelle Abfrageebene:"),a)},CLASS_NAME:"OpenLayers.Control.Click"});function showQuerylayer(){var a=$("#queryselect").val();"dhm"==a?setMarkerhint(window.lang.convert("Standardabfrage:"),window.lang.convert("Koordinaten + Hoehe")):setMarkerhint(window.lang.convert("aktuelle Abfrageebene:"),a)}
-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))}})}
+function loadFeature(a){$.ajax({type:"GET",url:a,success:function(b){alert(a);b&&(alert(b),5>b.length&&(b=window.lang.convert("Kein Ergebnis!")),setMarkerhint(window.lang.convert("Abfrageergebnis:"),b))}})}
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,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+
@@ -22,10 +22,10 @@
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"),
-pageTransition);refresh()});$("#mapbendersearchformbut").click(function(){searchMaps(searchUrl+"&searchText="+$("#mapbendersearchfield").val())});$("#mapbendersearchfield").live("keypress",function(a){13===a.keyCode&&searchMaps(searchUrl+"&searchText="+$("#mapbendersearchfield").val())});$("div[data-role=collapsible]").live("expand",function(){$("div[data-role=collapsible]").not($(this)).trigger("collapse")});$(".addToMapBut").click(function(){$("div[data-role=collapsible]").not(".ui-collapsible-collapsed").trigger("collapse");
-$.mobile.changePage($("#mappage"),pageTransition)});addBaselayers()}
+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)]);(e="p"===$("#select-feature-info").val()?!0:!1)?setMarkerhint(window.lang.convert("Meldung:"),window.lang.convert("bitte warten...")):($.mobile.changePage($("#featureinforesult"),pageTransition),$("#ficontentdiv").text(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&FORMAT=image/png&STYLES=",e?(a=$('<iframe src="'+a+'" class="query_iframe"><p>Die Abfrage kann leider nicht angezeigt werden.</p></img>'),setMarkerhint("Abfrageergebnis:",a)):(a=
+$('<iframe src="'+a+'" class="query_iframe_full"><p>Die Abfrage kann leider nicht angezeigt werden.</p></img>'),$("#ficontentdiv").text(""),$("#ficontentdiv").append(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"),pageTransition);refresh()});$("#mapbendersearchformbut").click(function(){searchMaps(searchUrl+"&searchText="+$("#mapbendersearchfield").val())});
+$("#mapbendersearchfield").live("keypress",function(a){13===a.keyCode&&searchMaps(searchUrl+"&searchText="+$("#mapbendersearchfield").val())});$("div[data-role=collapsible]").live("expand",function(){$("div[data-role=collapsible]").not($(this)).trigger("collapse")});$(".addToMapBut").click(function(){$("div[data-role=collapsible]").not(".ui-collapsible-collapsed").trigger("collapse");$.mobile.changePage($("#mappage"),pageTransition)});addBaselayers()}
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)}
@@ -66,7 +66,7 @@
$(this).css("background-image","url(img/ico_basecheck_active.png)")});$(".layer_check").each(function(){for(var a=0;a<map.layers.length;a++)map.layers[a].name===$(this).attr("id")&&map.layers[a].visibility&&$(this).css("background-image","url(img/ico_check_active.png)")});$(".poi_check").each(function(){var a=poilayer.params.LAYERS,b=[];""!=a&&(b=a.split(","));-1!=jQuery.inArray($(this).attr("id"),b)&&$(this).css("background-image","url(img/ico_check.png)")});$(".query_check").each(function(){var a=
$(this).attr("id");a.substring(0,a.length-6)===$("#queryselect").val()&&$(this).css("background-image","url(img/ico_checkop_active.png)")})};function searchCall(){"google"===searchMode?codeAddress():"streetsearch"===searchMode?searchStreet($("#searchfield").val()):"mapbendersearch"===searchMode?searchMapbender($("#searchfield").val()):alert("kein Suchmodus konfiguriert!")}function setMarkerhint(a,b){$("#xheader").html(a);$("#xcontent").html(b);$("#markerhint").css("visibility","visible")}
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 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 changeFeatureInfo(){}
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(),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)})}
Modified: trunk/mapbender/http/extensions/mobilemap/map.php
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/map.php 2013-05-20 13:58:14 UTC (rev 8621)
+++ trunk/mapbender/http/extensions/mobilemap/map.php 2013-05-21 15:06:10 UTC (rev 8622)
@@ -287,9 +287,21 @@
</div>
<!-- /Search Seite Ende-->
+<!-- FeatureInfo Seite Start-->
+<div data-role="page" id="featureinforesult" style="height: 100%">
+ <div data-role="header" data-position="fixed" > <a href="#" class="mapbackbut" data-icon="arrow-l" onclick='$("#ficontentdiv").empty();'><span lang="de">Karte</span></a>
+ <h1><span lang="de">Sachdatenanzeige</span></h1>
+ </div>
+ <!-- /header -->
+ <!-- <div data-role="content" style="padding: 10px" >-->
+ <div id="ficontentdiv" style="height: 500px"> </div>
+ <!-- </div>-->
+</div>
+<!-- /FeatureInfo Seite Ende-->
+
<!-- Hilfe Seite Start-->
<div data-role="page" id="helppage">
- <div data-role="header" data-position="fixed" > <a href="#" class="mapbackbut" data-icon="arrow-l"><span lang="de">Karte</span></a>
+ <div data-role="header" data-position="fixed" > <a href="#" class="mapbackbut" data-icon="arrow-l" ><span lang="de">Karte</span></a>
<h1><span lang="de">Hilfe / Info</span></h1>
</div>
<div data-role="content" style="padding: 10px">
@@ -321,6 +333,11 @@
<option value="l" lang="de">Linkshänder</option>
</select>
<br>
+ <label for="select-feature-info" class="select"><span lang="de">Sachdatenanzeige:</span></label>
+ <select name="select-feature-info" id="select-feature-info" onChange="changeFeatureInfo(this.value);" data-icon="gear" data-inline="true" data-native-menu="false">
+ <option value="n" lang="de">Neues Fenster</option>
+ <option value="p" lang="de">Popup</option>
+ </select>
<br>
<div class="apptools">
Browserinfo:<br>
Modified: trunk/mapbender/http/extensions/mobilemap/map.php~
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/map.php~ 2013-05-20 13:58:14 UTC (rev 8621)
+++ trunk/mapbender/http/extensions/mobilemap/map.php~ 2013-05-21 15:06:10 UTC (rev 8622)
@@ -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 } ?>
});
@@ -106,7 +133,7 @@
</div>
<div id="scaleline"></div>
- <div id="copyright"><span lang="de">(C) Geobasidaten: LVermGeo Rlp 2012</span></div>
+ <div id="copyright"><span lang="de"><?php echo $copyright; ?></span></div>
<div id="LoadingPanel"></div>
<div id="zoomscale">
<select name="selectzoom" id="selectzoom" onChange="changeScale(this.value);" data-inline="true" data-mini="true" data-native-menu="<?php echo $scaleselect; ?>" >
@@ -260,9 +287,21 @@
</div>
<!-- /Search Seite Ende-->
+<!-- FeatureInfo Seite Start-->
+<div data-role="page" id="featureinforesult" style="height: 100%">
+ <div data-role="header" data-position="fixed" > <a href="#" class="mapbackbut" data-icon="arrow-l" onclick='$("#ficontentdiv").empty();'><span lang="de">Karte</span></a>
+ <h1><span lang="de">Sachdatenanzeige</span></h1>
+ </div>
+ <!-- /header -->
+ <!-- <div data-role="content" style="padding: 10px" >-->
+ <div id="ficontentdiv" style="height: 100%"> </div>
+ <!-- </div>-->
+</div>
+<!-- /FeatureInfo Seite Ende-->
+
<!-- Hilfe Seite Start-->
<div data-role="page" id="helppage">
- <div data-role="header" data-position="fixed" > <a href="#" class="mapbackbut" data-icon="arrow-l"><span lang="de">Karte</span></a>
+ <div data-role="header" data-position="fixed" > <a href="#" class="mapbackbut" data-icon="arrow-l" ><span lang="de">Karte</span></a>
<h1><span lang="de">Hilfe / Info</span></h1>
</div>
<div data-role="content" style="padding: 10px">
@@ -294,6 +333,11 @@
<option value="l" lang="de">Linkshänder</option>
</select>
<br>
+ <label for="select-feature-info" class="select"><span lang="de">Sachdatenanzeige:</span></label>
+ <select name="select-feature-info" id="select-feature-info" onChange="changeFeatureInfo(this.value);" data-icon="gear" data-inline="true" data-native-menu="false">
+ <option value="n" lang="de">Neues Fenster</option>
+ <option value="p" lang="de">Popup</option>
+ </select>
<br>
<div class="apptools">
Browserinfo:<br>
Modified: trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.css
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.css 2013-05-20 13:58:14 UTC (rev 8621)
+++ trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.css 2013-05-21 15:06:10 UTC (rev 8622)
@@ -283,8 +283,13 @@
}
.query_iframe{
- width: 100%
+ width: 100%;
max-height: 200px;
border:none;
}
+.query_iframe_full{
+ width: 100%;
+ height: 100%;
+ border:none;
+}
Modified: trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js 2013-05-20 13:58:14 UTC (rev 8621)
+++ trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js 2013-05-21 15:06:10 UTC (rev 8622)
@@ -61,7 +61,7 @@
},
onClick: function( evt ) {
- // click funcktion
+ // click funktion
var lonlat = map.getLonLatFromViewPortPx(evt.xy);
var querylayer = $('#ownlist').find('.query_checked').parent();
var actuallang = $('#select-lang').val();
@@ -72,9 +72,19 @@
vector_marker.addFeatures([
new OpenLayers.Feature.Vector(geompoint,{},olSearchSymbol),
new OpenLayers.Feature.Vector(geompoint1,{},olFeaturequerySymbol)
- ]);
- setMarkerhint(window.lang.convert('Meldung:'),window.lang.convert('bitte warten...'));
-
+ ]);
+ if ($("#select-feature-info").val() === 'p') {
+ var fiPopUp = true;
+ } else {
+ var fiPopUp = false;
+ }
+ if (fiPopUp) {
+ setMarkerhint(window.lang.convert('Meldung:'),window.lang.convert('bitte warten...'));
+ } else {
+ $.mobile.changePage($("#featureinforesult"),pageTransition);
+ $("#ficontentdiv").text(window.lang.convert("Bitte warten..."));
+ }
+ //
if(querylayer.length>0){
// Abfrage des ausgewählten Layers
var featureurl = querylayer.attr('getmapurl')
@@ -85,13 +95,28 @@
+ '&BBOX=' + map.getExtent().toBBOX()
+ '&WIDTH=' + map.size.w + '&HEIGHT=' + map.size.h
+ '&X=' + evt.xy.x + '&Y=' + evt.xy.y
- + '&INFO_FORMAT=text/html';
- var iframe=$('<iframe src="'+featureurl+'" class="query_iframe">'
+ + '&INFO_FORMAT=text/html'
+ + '&FORMAT=image/png' //only for some wms that have problems if this parameter is not given
+ + '&STYLES='; //only for some wms that have problems if this parameter is not given
+
+ if (fiPopUp) {
+ var iframe=$('<iframe src="'+featureurl+'" class="query_iframe">'
+'<p>Die Abfrage kann leider nicht angezeigt werden.</p></img>'
);
- setMarkerhint('Abfrageergebnis:',iframe);
+ setMarkerhint('Abfrageergebnis:',iframe);
+ } else {
+ var iframe=$('<iframe src="'+featureurl+'" class="query_iframe_full">'
+ +'<p>Die Abfrage kann leider nicht angezeigt werden.</p></img>'
+ );
+ //alert(featureurl);
+ //$.mobile.changePage($("#featureinforesult"),pageTransition);
+ $("#ficontentdiv").text("");
+ $("#ficontentdiv").append(iframe);
+ //add onclick delete iframe from page
+
+ }
} else {
- // Standartabfrage, falls keiner ausgewählt ist
+ // Standardabfrage, falls keiner ausgewählt ist
var featureurl = 'query/rasterquery.php?coord='+lonlat.lon+ ', '+lonlat.lat+'&lang='+actuallang;
loadFeature(featureurl);
}
Modified: trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js~
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js~ 2013-05-20 13:58:14 UTC (rev 8621)
+++ trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js~ 2013-05-21 15:06:10 UTC (rev 8622)
@@ -61,7 +61,7 @@
},
onClick: function( evt ) {
- // click funcktion
+ // click funktion
var lonlat = map.getLonLatFromViewPortPx(evt.xy);
var querylayer = $('#ownlist').find('.query_checked').parent();
var actuallang = $('#select-lang').val();
@@ -72,9 +72,19 @@
vector_marker.addFeatures([
new OpenLayers.Feature.Vector(geompoint,{},olSearchSymbol),
new OpenLayers.Feature.Vector(geompoint1,{},olFeaturequerySymbol)
- ]);
- setMarkerhint(window.lang.convert('Meldung:'),window.lang.convert('bitte warten...'));
-
+ ]);
+ if ($("#select-feature-info").val() === 'p') {
+ var fiPopUp = true;
+ } else {
+ var fiPopUp = false;
+ }
+ if (fiPopUp) {
+ setMarkerhint(window.lang.convert('Meldung:'),window.lang.convert('bitte warten...'));
+ } else {
+ $.mobile.changePage($("#featureinforesult"),pageTransition);
+ $("#ficontentdiv").text(window.lang.convert("Bitte warten..."));
+ }
+ //
if(querylayer.length>0){
// Abfrage des ausgewählten Layers
var featureurl = querylayer.attr('getmapurl')
@@ -85,13 +95,27 @@
+ '&BBOX=' + map.getExtent().toBBOX()
+ '&WIDTH=' + map.size.w + '&HEIGHT=' + map.size.h
+ '&X=' + evt.xy.x + '&Y=' + evt.xy.y
- + '&INFO_FORMAT=text/html';
- var iframe=$('<iframe src="'+featureurl+'" class="query_iframe">'
+ + '&INFO_FORMAT=text/html'
+ + '&FORMAT=image/png' //only for some wms that have problems if this parameter is not given
+ + '&STYLES='; //only for some wms that have problems if this parameter is not given
+
+ if (fiPopUp) {
+ var iframe=$('<iframe src="'+featureurl+'" class="query_iframe">'
+'<p>Die Abfrage kann leider nicht angezeigt werden.</p></img>'
);
- setMarkerhint('Abfrageergebnis:',iframe);
+ setMarkerhint('Abfrageergebnis:',iframe);
+ } else {
+ var iframe=$('<iframe src="'+featureurl+'" class="query_iframe_full">'
+ +'<p>Die Abfrage kann leider nicht angezeigt werden.</p></img>'
+ );
+ //alert(featureurl);
+ //$.mobile.changePage($("#featureinforesult"),pageTransition);
+ $("#ficontentdiv").append(iframe);
+ //add onclick delete iframe from page
+
+ }
} else {
- // Standartabfrage, falls keiner ausgewählt ist
+ // Standardabfrage, falls keiner ausgewählt ist
var featureurl = 'query/rasterquery.php?coord='+lonlat.lon+ ', '+lonlat.lat+'&lang='+actuallang;
loadFeature(featureurl);
}
@@ -251,7 +275,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 +551,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 +585,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 +617,9 @@
}
}
}
-
+ // Parsen der bbox aus wmc
+ //var bbox = json.wmc.bbox;
+ //var crs = json.wmc.crs;
// Alle ausgewählten overlays entfernen
clearOwnlist();
@@ -603,7 +634,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();
});
}
@@ -676,7 +707,7 @@
} );*/
- $('#baselayers').append(BaseLayer("keine Hintergrundkarte",grenze_leer.name));
+ $('#baselayers').append(BaseLayer("Keine Hintergrundkarte",grenze_leer.name));
map.addLayers([atkis_praes_tms,luftbilder,grenze_leer,vector_marker]);
More information about the Mapbender_commits
mailing list