[Mapbender-commits] r2733 - in branches/2.5/http: .
gazetteer_rostock
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Jul 28 03:52:24 EDT 2008
Author: christoph
Date: 2008-07-28 03:52:24 -0400 (Mon, 28 Jul 2008)
New Revision: 2733
Added:
branches/2.5/http/gazetteer_rostock/
branches/2.5/http/gazetteer_rostock/mod_WFSGazetteer_client.js
branches/2.5/http/gazetteer_rostock/mod_WFSGazetteer_client.php
branches/2.5/http/gazetteer_rostock/mod_WFSGazetteer_server.php
branches/2.5/http/gazetteer_rostock/mod_WFSStreetGaz_client.js
branches/2.5/http/gazetteer_rostock/mod_WFSStreetGaz_client.php
branches/2.5/http/gazetteer_rostock/mod_WFSStreetGaz_server.php
Log:
initial commit
Added: branches/2.5/http/gazetteer_rostock/mod_WFSGazetteer_client.js
===================================================================
--- branches/2.5/http/gazetteer_rostock/mod_WFSGazetteer_client.js (rev 0)
+++ branches/2.5/http/gazetteer_rostock/mod_WFSGazetteer_client.js 2008-07-28 07:52:24 UTC (rev 2733)
@@ -0,0 +1,459 @@
+ /**
+ * jquery function to create search form html elements
+ *
+ */
+
+$(document).ready(function(){
+
+ $("<form />").attr({"id":"searchForm1","method":"post","action":"mod_WFSGazetteer_client.php?"+getParamsForm}).appendTo("#"+e_id);
+ $("#searchForm1").submit( function() {
+ //try {if(startSearch()){}}catch(e) {console.log(e);}
+ startSearch();
+ return false;
+ } );
+
+ //$("<div/>").attr({"id":"div1"}).appendTo("#searchForm1");
+ //$("<input type='button'>").attr({"id":"buttonNew","value":"Neue Suche"}).appendTo("#div1");
+ //$("#buttonNew").click( function() { clearSearch();});
+
+
+ //table structure
+ $("<table/>").attr({"id":"table1","border":"0","cellpadding":"0","cellspacing":"0"}).appendTo("#searchForm1");
+ $("<tr/>").attr({"id":"tr1"}).appendTo("#table1");
+ $("<tr/>").attr({"id":"tr2"}).appendTo("#table1");
+ $("<tr/>").attr({"id":"trLabel"}).appendTo("#table1");
+ $("<tr/>").attr({"id":"tr3"}).appendTo("#table1");
+ //$("<tr/>").attr({"id":"tr4"}).appendTo("#table1");
+ $("<td/>").attr({"id":"td1"}).appendTo("#tr1");
+ $("<td/>").attr({"id":"td2"}).appendTo("#tr1");
+ $("<td/>").attr({"id":"td2b"}).appendTo("#tr1");
+ $("<td/>").attr({"id":"td3"}).appendTo("#tr2");
+ $("<td/>").attr({"id":"td4"}).appendTo("#tr2");
+ $("<td/>").attr({"id":"td4b"}).appendTo("#tr2");
+
+ //$("<td/>").attr({"id":"td5"}).appendTo("#tr3");
+ //$("<td/>").attr({"id":"td5b","colspan":"2"}).appendTo("#tr3");
+
+ $("<table/>").attr({"id":"table2","border":"0"}).appendTo("#searchForm1");
+ $("<tr/>").attr({"id":"tr1Table2"}).appendTo("#table2");
+ $("<tr/>").attr({"id":"tr2Table2"}).appendTo("#table2");
+ $("<td/>").attr({"id":"tdLabel2"}).appendTo("#tr1Table2");
+ $("<td/>").attr({"id":"tdLabel3"}).appendTo("#tr1Table2");
+ $("<td/>").attr({"id":"tdLabel4"}).appendTo("#tr1Table2");
+ $("<td/>").attr({"id":"tdLabel5"}).appendTo("#tr1Table2");
+ $("<td/>").attr({"id":"td6a"}).appendTo("#tr2Table2");
+ $("<td/>").attr({"id":"td6c"}).appendTo("#tr2Table2");
+ $("<td/>").attr({"id":"td6e"}).appendTo("#tr2Table2");
+ $("<td/>").attr({"id":"td6f"}).appendTo("#tr2Table2");
+ $("<td/>").attr({"id":"td6g"}).appendTo("#tr2Table2");
+
+ $("<table/>").attr({"id":"table3","border":"0"}).appendTo("#searchForm1");
+ $("<tr/>").attr({"id":"tr4"}).appendTo("#table3");
+ $("<td/>").attr({"id":"td7"}).appendTo("#tr4");
+ $("<td/>").attr({"id":"td8"}).appendTo("#tr4");
+ $("<td/>").attr({"id":"td8b"}).appendTo("#tr4");
+
+ //button ok for gemarkung and flurstck
+ $("<input type='submit'>").attr({"id":"input9","value":"ok"}).appendTo("#td4b");
+ $("<input type='submit'>").attr({"id":"input10","value":"ok"}).appendTo("#td6g");
+ $("#input9").css({"position":"relative"});
+ $("#input10").css({"position":"relative"});
+ //default: buttons hidden
+ $("#input9").css({"left":"-800"});
+ $("#input10").css({"left":"-800"});
+
+ //text fields
+ $("<input type='text'>").attr({"id":"input2","size":"15"}).appendTo("#td4");
+ $("#input2").click( function() {
+ //clearGemFlur() loescht nur Gem. und Flurfelder, Zaehler/Nenner bleibt stehen;
+ //austauschen mit clearSearch(), wenn Suche bei Klick komplett reseted werden soll
+ //clearGemFlur();
+ clearSearch();
+ $("#input9").css({"left":"0"});
+ $("#input10").css({"left":"-800"});
+
+ } );
+
+ $("<input type='text'>").attr({"id":"input3","size":"6"}).appendTo("#td6a");
+ $("#input3").focus( function() {
+ $("#input10").css({"left":"0"});
+ $("#input9").css({"left":"-800"});
+ } );
+
+ $("<input type='text'>").attr({"id":"input4","size":"3"}).appendTo("#td6c");
+ $("<input type='text'>").attr({"id":"input5","size":"5"}).appendTo("#td6e");
+ $("<input type='text'>").attr({"id":"input6","size":"3"}).appendTo("#td6f");
+
+ $("#input4").keyup( function() { nextTab($("#input4"),3,$("#input5")); } );
+ $("#input5").keyup( function() { nextTab($("#input5"),5,$("#input6")); } );
+ $("#input6").keyup( function() { nextTab($("#input6"),3,$("#input11")); } );
+
+ //Field texts
+ $("#td1").html("Kreis:");
+ $("#td3").html("Gemarkung:");
+ //$("#td5").html("Flstkennz.:");
+ $("#td7").html("Treffer:");
+ $("#tdLabel2").html("Gem.");
+ $("#tdLabel3").html("Flur");
+ $("#tdLabel4").html("Zähler/");
+ $("#tdLabel5").html("Nenner");
+
+ //select box for selection of wfs
+ $("#td2").append("<select id='select1' name='select1'/>");
+ $("#select1").change( function() {
+ $("#input2").focus();
+ selectedVal = $("#select1 option[@selected]").val();
+ } );
+ var optionName = optionHtml.split(",");
+ for(var i=1; i<=optionCount; i++){
+ $("<option/>").attr({"id":"option"+i,value:i}).appendTo("#select1").html(optionName[i-1]);
+ }
+ $("#select1 > option:first").attr('selected', 'selected');
+
+ //Block fuer STYLE CSS ##################################################
+ $("td").css('padding-left', '1px');
+ $("td").css('padding-right', '1px');
+ $("td").css('color', 'gray');
+ $("td").css('font-size', '11px');
+
+ $("#td1").css('font-weight','bold');
+ $("#td3").css('font-weight','bold');
+ $("#td7").css('font-weight','bold');
+ //Ende Block fuer STYLE CSS #############################################
+
+ });
+
+ /**
+ * function to start search
+ *
+ */
+
+function startSearch(){
+ //if($("#input10").get()!=''){
+ if($("#input3").val()!='' && $("#input4").val()!='' && $("#input5").val()!=''){
+ propertyName[0] = propertyNameString4;
+ propertyName[1] = propertyNameString5;
+ propertyName[2] = propertyNameString6;
+ var searchString1 = $("#input5").val().replace (/^\s+/, '').replace (/\s+$/, '');
+ var searchString2 = $("#input6").val().replace (/^\s+/, '').replace (/\s+$/, '');
+ var sizeOfSearchString1 = searchString1.length;
+ var sizeOfSearchString2 = searchString2.length;
+
+ if(sizeOfSearchString1==5){
+ searchString1 = searchString1;
+ }
+ else{
+ var numberOfFillIns1 = 5-sizeOfSearchString1;
+ searchString1 = FillUpArray[numberOfFillIns1]+searchString1;
+ }
+
+ if(sizeOfSearchString2==3){
+ searchString2 = searchString2;
+ }
+ else{
+ var numberOfFillIns2 = 3-sizeOfSearchString2;
+ searchString2 = FillUpArray[numberOfFillIns2]+searchString2;
+ }
+ var searchString4 = $("#input4").val().replace (/^\s+/, '').replace (/\s+$/, '');
+ var sizeOfSearchString4 = searchString4.length;
+ if(sizeOfSearchString4==3){
+ searchString4 = searchString4;
+ }
+ else{
+ var numberOfFillIns2 = 3-sizeOfSearchString4;
+ searchString4 = FillUpArray[numberOfFillIns2]+searchString4;
+ }
+
+ searchValue[0] = $("#input3").val()+"-"+searchString4;
+ searchValue[1] = searchString1;
+ searchValue[2] = searchString2;
+ $("#input4").val(searchString4);
+ $("#input5").val(searchString1);
+ $("#input6").val(searchString2);
+ validate(propertyName,searchValue,wfsSearch3[selectedVal],shortName[2]);
+ }
+ else{
+ $("#td8").empty();
+ var searchString = $("#input2").val().replace (/^\s+/, '').replace (/\s+$/, '');
+ searchValue[0] = searchString;
+ propertyName[0] = propertyNameString0;
+
+ //workaround Rostock, bis es f�r jeden Kreis eigene WFS gibt ##############
+// var newPropertyName = [];
+// newPropertyName[0] = propertyName[0];
+// newPropertyName[1] = propertyNameString4;
+// var selectedGem = [];
+// selectedGem[1] = "Rostock";
+// selectedGem[2] = "Doberan";
+// selectedGem[3] = "G�strow";
+// searchValue[1] = selectedGem[selectedVal];
+// validate(newPropertyName,searchValue,wfsSearch1[1],shortName[0]);
+ // Ende Workaround #####################
+
+ //untenstehende Zeile wieder einkommentieren, wenn Workaround nicht mehr ben�tigt wird
+ validate(propertyName,searchValue,wfsSearch1[selectedVal],shortName[0]);
+ }
+}
+
+
+
+
+function clearSearch(){
+ //$("#select1 > option:first").attr('selected', 'selected');
+ $("#input2").val("");
+ $("#input3").val("");
+ $("#input4").val("");
+ $("#input5").val("");
+ $("#input6").val("");
+ $("#td8").empty();
+ propertyName = [];
+ searchValue = [];
+ //newPropertyName raus, wenn Workaround siehe oben nicht mehr benutzt wird
+ //newPropertyName = [];
+ $("#input9").css({"left":"-800"});
+ $("#input10").css({"left":"-800"});
+}
+
+function clearGemFlur(){
+ $("#input2").val("");
+ $("#input3").val("");
+ $("#input4").val("");
+ $("#td8").empty();
+ propertyName = [];
+ searchValue = [];
+ //newPropertyName raus, wenn Workaround siehe oben nicht mehr benutzt wird
+ //newPropertyName = [];
+ $("#input9").css({"left":"-800"});
+ $("#input10").css({"left":"-800"});
+}
+
+function normalize(str){
+ //console.log("string vor replace = %s",str);
+ str = str.toUpperCase();
+ str = str.replace(/ß/g,'SS');
+ str = str.replace(/Ä/g,'AE');
+ str = str.replace(/Ö/g,'OE');
+ str = str.replace(/Ü/g,'UE');
+ return str;
+}
+
+ /**
+ * sets focus from one input field to the next one
+ *
+ * [@param {jquery element} first current focused input
+ * [@param {integer} fLength max possible length
+ * [@param {jquery element} next next input to focus
+ */
+function nextTab(first,fLength,next){
+ if (first.val().length==fLength){
+ next.focus();
+ }
+}
+
+ /**
+ * fills Gemarkung search result in field, button and input handling and event for button
+ *
+ * [@param {string} resultFill transfer search value
+ */
+
+ function transferGemResult(resultFillName,resultFillNumber){
+ $("#input2").attr({"value":""+resultFillName+""});
+ $("#input3").attr({"value":""+resultFillNumber+""});
+ //$("#td6g").empty();
+ $("#input9").css({"left":"-800"});
+ //$("#input2").attr({"disabled":"disabled"});
+ //$("#input3").attr({"disabled":"disabled"});
+ $("#input4").focus();
+
+ propertyName[0] = propertyNameString4;
+ searchValue[0] = $("#input3").val().replace (/^\s+/, '').replace (/\s+$/, '');
+
+ validate(propertyName,searchValue,wfsSearch2[selectedVal],shortName[1]);
+
+}
+
+/**
+ * fills Flur search result in field, button handling and event for button
+ *
+ * [@param {string} resultFill transfer search value
+ */
+
+function transferFlurResult(resultFill){
+ var searchResult = resultFill;
+ $("#input10").css({"left":"0"});
+ $("#input4").attr({"value":""+searchResult+""});
+ //$("#td6g").empty();
+ //$("#input4").attr({"disabled":"disabled"});
+ $("#input5").focus();
+ $("#td8").empty();
+ //$("<input type='submit'>").attr({"id":"input10","value":"ok"}).appendTo("#td6g");
+
+}
+
+
+
+/**
+ * creates wfs search request and shows search results in div tags
+ *
+ * [@param {array} propertyName array with all propertyNames for search
+ * [@param {array} searchValue array with all searchstrings for search
+ * [@param {string} wfsUrl URL of WFS
+ * [@param {string} searchAbbr string containing abbreviation defining step of search
+ */
+
+ function validate(propertyName,searchValue,wfsUrl,searchAbbr){
+ if(geomArray.count()>0){
+ geomArray.empty();
+ }
+ global_resultHighlight = new Highlight(targetArray, "wfsGazetteerHighlight", {"position":"absolute", "top":"0px", "left":"0px", "z-index":100}, 2);
+ mb_registerSubFunctions("global_resultHighlight.paint()");
+ var filterParameterCount = propertyName.length;
+ if(filterParameterCount == 0){
+ return false;
+ }
+ else{
+ var andConditions = "";
+ for (var i = 0; i < propertyName.length; i++) {
+ andConditions += "<ogc:PropertyIsLike wildCard='*' singleChar='.' escape='!'>";
+ andConditions += "<ogc:PropertyName>" + propertyName[i] + "</ogc:PropertyName>";
+ andConditions += "<ogc:Literal>";
+ if(searchValue[i]=="*"){
+ andConditions +="";
+ }
+ else{
+ andConditions += normalize(searchValue[i]);
+ //andConditions += searchValue[i];
+ }
+ andConditions += "*</ogc:Literal>";
+ andConditions += "</ogc:PropertyIsLike>";
+ }
+ if (filterParameterCount > 1) {
+ andConditions = "<And>" + andConditions + "</And>";
+ }
+
+ var requestUrl = wfsUrl;
+ requestUrl += "&filter=";
+ var filter = "<ogc:Filter xmlns:ogc='http://ogc.org' xmlns:gml='http://www.opengis.net/gml'>"+andConditions+"</ogc:Filter>";
+ }
+ $("#td8").empty();
+ $("<img>").attr({"id":"wheelImg","src":"../img/indicator_wheel.gif"}).appendTo("#td8");
+ $("<span>").attr({"id":"searchDiv"}).appendTo("#td8").html(" Suche...");
+
+ var parameters = {command:"getSearchResults", "url":requestUrl, "filter":filter};
+ parent.mb_ajax_post("../gazetteer_rostock/mod_WFSGazetteer_server.php", parameters, function (jsCode, status) {
+ $("#td8").empty();
+ var geoObj = eval('(' + jsCode + ')');
+ if (jsCode) {
+ if (typeof(geoObj) == 'object') {
+ geomArray.importGeoJSON(geoObj);
+ $("#td8").empty();
+ for (var i=0; i < geomArray.count(); i++) {
+ if(searchAbbr==shortName[0]){
+ (function () {
+ var geomStr = searchAbbr + i;
+ var geomIndex = i;
+ $("<div>").attr({"id":searchAbbr+i}).appendTo("#td8");
+ $("#"+geomStr).text(geomArray.get(i).e.getElementValueByName(resultValue1));
+ $("#"+geomStr).css({"cursor":"pointer"});
+ $("#"+geomStr).mouseover( function() { setResult('over', geomIndex);});
+ $("#"+geomStr).mouseout( function() { setResult('out', geomIndex);});
+ $("#"+geomStr).click( function() { setResult('click', geomIndex);transferGemResult($("#"+geomStr).text(),geomArray.get(geomIndex).e.getElementValueByName(resultValue0));});
+ })();
+ }
+ else if (searchAbbr==shortName[1]){
+ (function () {
+ var geomStr = searchAbbr + i;
+ var geomIndex = i;
+ $("<div>").attr({"id":searchAbbr+i}).appendTo("#td8");
+ $("#"+geomStr).text(geomArray.get(i).e.getElementValueByName(resultValue2));
+ $("#"+geomStr).css({"cursor":"pointer"});
+ $("#"+geomStr).mouseover( function() { setResult('over', geomIndex);});
+ $("#"+geomStr).mouseout( function() { setResult('out', geomIndex);});
+ $("#"+geomStr).click( function() { setResult('click', geomIndex);transferFlurResult(geomArray.get(geomIndex).e.getElementValueByName(resultValue2));});
+ })();
+ }
+ else if (searchAbbr==shortName[2]){
+ (function () {
+ var geomStr = searchAbbr + i;
+ var geomIndex = i;
+ $("<div>").attr({"id":searchAbbr+i}).appendTo("#td8");
+ $("#"+geomStr).text(geomArray.get(i).e.getElementValueByName(resultValue3));
+ $("#"+geomStr).css({"cursor":"pointer"});
+ $("#"+geomStr).mouseover( function() { setResult('over', geomIndex);});
+ $("#"+geomStr).mouseout( function() { setResult('out', geomIndex);});
+ $("#"+geomStr).click( function() { setResult('click', geomIndex);});
+ })();
+ }
+ }
+ if(geomArray.count()==0){
+ $("#td8").empty();
+ $("<div>").attr({"id":"noResult"}).appendTo("#td8");
+ selectedOption = $("#select1 option[@selected]").text();
+ if(searchAbbr==shortName[0]){
+ $("#noResult").text(noResultText[0]+selectedOption);
+ $("#input9").css({"left":"0"});
+ $("#td6g").empty();
+ }
+ if(searchAbbr==shortName[1]){
+ $("#noResult").text(noResultText[1]+selectedOption);
+ }
+ if(searchAbbr==shortName[2]){
+ $("#noResult").text(noResultText[2]+selectedOption);
+ }
+ }
+ }
+ else {
+ $("#td8").empty();
+ $("<div>").attr({"id":"noResult"}).appendTo("#td8");
+ selectedOption = $("#select1 option[@selected]").text();
+ if(searchAbbr==shortName[0]){
+ $("#noResult").text(noResultText[0]+selectedOption);
+ $("#input9").css({"left":"0"});
+ $("#td6g").empty();
+ }
+ if(searchAbbr==shortName[1]){
+ $("#noResult").text(noResultText[1]+selectedOption);
+ }
+ if(searchAbbr==shortName[2]){
+ $("#noResult").text(noResultText[2]+selectedOption);
+ }
+ }
+ }
+ else {
+ alert("No results.");
+ }
+ });
+}
+
+ /**
+ * gets a javascript event and the index of the geometry array; highlights the current geom element and
+ * sets bbox for zooming
+ *
+ * [@param {string} event (over || out || click)
+ * [@param {integer} i index of geometry array
+ */
+
+function setResult(event,i){
+ var cw_fillcolor = "#cc33cc";
+ var currentGeom = geomArray.get(i);
+
+ if (event == "over") {
+ global_resultHighlight.add(currentGeom, cw_fillcolor);
+ global_resultHighlight.paint();
+ }
+ else if (event == "out"){
+ global_resultHighlight.del(currentGeom, cw_fillcolor);
+ global_resultHighlight.paint();
+ }
+ else if (event == "click"){
+ global_resultHighlight.del(currentGeom, cw_fillcolor);
+ var bbox = currentGeom.getBBox();
+ var buffer = new Point(1,1);
+ bbox[0] = bbox[0].minus(buffer);
+ bbox[1] = bbox[1].plus(buffer);
+ mb_calculateExtent(targetArray[0], bbox[0].x, bbox[0].y, bbox[1].x, bbox[1].y);
+ zoom(targetArray[0], 'true', 1.0);
+ global_resultHighlight.add(currentGeom, cw_fillcolor);
+ global_resultHighlight.paint();
+ }
+}
\ No newline at end of file
Property changes on: branches/2.5/http/gazetteer_rostock/mod_WFSGazetteer_client.js
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/2.5/http/gazetteer_rostock/mod_WFSGazetteer_client.php
===================================================================
--- branches/2.5/http/gazetteer_rostock/mod_WFSGazetteer_client.php (rev 0)
+++ branches/2.5/http/gazetteer_rostock/mod_WFSGazetteer_client.php 2008-07-28 07:52:24 UTC (rev 2733)
@@ -0,0 +1,90 @@
+<?php
+#$Id: mod_WFSGazetteer_client.php 2008 2008-03-05 11:44:45Z verenadiewald $
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
+
+echo "var getParamsForm = '".SID."&gui_id=".$gui_id."&e_id=".$e_id."';";
+
+echo "var e_id = '".$e_id."';";
+echo "var resultGeom = '';";
+echo "var geomArray = new GeometryArray();";
+//number of select options
+echo "var optionCount = 4;";
+//comma-separated list of names of select options
+echo "var optionHtml = 'Rostock-Stadt,Doberan,Güstrow,Nordvorpommern';";
+//default selected value of options list
+echo "var selectedVal = 1;";
+
+echo "var wfsSearch1 = [];";
+echo "wfsSearch1[1] = 'http://kataster.sv.rostock.de/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:gemarkung_simple';";
+echo "wfsSearch1[2] = 'http://kataster1.sv.rostock.de/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:gemarkung_simple';";
+echo "wfsSearch1[3] = 'http://kataster.sv.rostock.de/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:gemarkung';";
+echo "wfsSearch1[4] = 'http://geoportal.lk-nvp.de/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=nvp:gemarkung';";
+
+echo "var wfsSearch2 = [];";
+echo "wfsSearch2[1] = 'http://kataster.sv.rostock.de/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:fluren_simple';";
+echo "wfsSearch2[2] = 'http://kataster1.sv.rostock.de/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:fluren';";
+echo "wfsSearch2[3] = 'http://kataster.sv.rostock.de/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:fluren';";
+echo "wfsSearch2[4] = 'http://geoportal.lk-nvp.de/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=nvp:gd_lk_fluren';";
+
+echo "var wfsSearch3 = [];";
+echo "wfsSearch3[1] = 'http://kataster.sv.rostock.de/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:flurstuecke';";
+echo "wfsSearch3[2] = 'http://kataster1.sv.rostock.de/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:flurstuecke';";
+echo "wfsSearch3[3] = 'http://kataster.sv.rostock.de/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:flurstuecke';";
+echo "wfsSearch3[4] = 'http://geoportal.lk-nvp.de/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=nvp:flurstuecke';";
+
+echo "var propertyName = [];";
+#echo "propertyNameString0 = 'hro:gemarkungsname_kurz';";
+echo "propertyNameString0 = 'gemarkungsname_knorm';";
+echo "propertyNameString1 = 'flur';";
+echo "propertyNameString4 = 'parentidentifier';";
+echo "propertyNameString2 = 'flurstueck';";
+echo "propertyNameString5 = 'zaehler';";
+echo "propertyNameString6 = 'nenner';";
+
+echo "var searchValue = [];";
+
+echo "var resultValue1='gemarkungsname_kurz';";
+echo "var resultValue0='geographicidentifier';";
+echo "var resultValue2='flur';";
+echo "var resultValue3='flurstueck';";
+
+echo "var shortName = [];";
+echo "shortName[0] = 'gem';";
+echo "shortName[1] = 'flur';";
+echo "shortName[2] = 'flurst';";
+
+echo "var noResultText = [];";
+echo "noResultText[0] = 'Keine Gemarkung gefunden in ';";
+echo "noResultText[1] = 'Keine Flur gefunden in ';";
+echo "noResultText[2] = 'Kein Flurstück gefunden in ';";
+
+echo "var targetString = '" . implode(",", $e_target) . "';";
+echo "var targetArray = targetString.split(',');";
+
+echo "var FillUpArray = [];";
+echo "FillUpArray[0] = '000';";
+echo "FillUpArray[1] = '0';";
+echo "FillUpArray[2] = '00';";
+echo "FillUpArray[3] = '000';";
+echo "FillUpArray[4] = '0000';";
+
+include (dirname(__FILE__)."/../gazetteer_rostock/mod_WFSGazetteer_client.js");
+
+?>
\ No newline at end of file
Added: branches/2.5/http/gazetteer_rostock/mod_WFSGazetteer_server.php
===================================================================
--- branches/2.5/http/gazetteer_rostock/mod_WFSGazetteer_server.php (rev 0)
+++ branches/2.5/http/gazetteer_rostock/mod_WFSGazetteer_server.php 2008-07-28 07:52:24 UTC (rev 2733)
@@ -0,0 +1,69 @@
+<?php
+# $Id: mod_wfsrequest.php 1008 2007-01-16 11:26:56Z christoph $
+# http://www.mapbender.org/index.php/Administration
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+include(dirname(__FILE__)."/../classes/class_gml2.php");
+require_once(dirname(__FILE__)."/../extensions/JSON.php");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db($DB,$con);
+
+$command = $_REQUEST["command"];
+
+if ($command == "getSearchResults") {
+ $filter = $_REQUEST["filter"];
+ $url = $_REQUEST["url"];
+
+ $admin = new administration();
+
+ $req = urldecode($url).urlencode($admin->char_decode(stripslashes($filter)));
+ $mygml = new gml2();
+
+ // $mygml->parsegml($req);
+//
+// // generates JavaScript code that will add a geometry array containing
+// // all the result geometries
+//
+// $js = "";
+// if ($mygml->getMemberCount() > 0) {
+//
+// $js .= $mygml->exportGeometriesToJS(true);
+//
+// for ($i = 0; $i < $mygml->getMemberCount(); $i++) {
+// for ($j = 0; $j < count($mygml->keys[$i]); $j++) {
+// $key = $mygml->sepNameSpace($mygml->keys[$i][$j]);
+// $js .= "geom.get(".$i.").e.setElement('".$key."', '".$mygml->getValueBySeparatedKey($i, $key) . "');\n";
+// }
+// }
+// }
+// echo $js;
+
+ $mygml->parseFile($req);
+
+ header("Content-type:application/x-json; charset=utf-8");
+ echo $mygml->toGeoJSON();
+}
+else {
+ echo "please enter a valid command.";
+}
+?>
\ No newline at end of file
Property changes on: branches/2.5/http/gazetteer_rostock/mod_WFSGazetteer_server.php
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/2.5/http/gazetteer_rostock/mod_WFSStreetGaz_client.js
===================================================================
--- branches/2.5/http/gazetteer_rostock/mod_WFSStreetGaz_client.js (rev 0)
+++ branches/2.5/http/gazetteer_rostock/mod_WFSStreetGaz_client.js 2008-07-28 07:52:24 UTC (rev 2733)
@@ -0,0 +1,564 @@
+ /**
+ * jquery function to create search form html elements
+ *
+ */
+ eventInit.register(function() {
+ global_resultHighlight1 = new Highlight(targetArray2, "wfsGazetteerHighlight1", {"position":"absolute", "top":"0px", "left":"0px", "z-index":100}, 2);
+ global_resultHighlight2 = new Highlight(targetArray3, "wfsGazetteerHighlight2", {"position":"absolute", "top":"0px", "left":"0px", "z-index":100}, 2);
+ mb_registerSubFunctions("global_resultHighlight1.paint()");
+ mb_registerSubFunctions("global_resultHighlight2.paint()");
+ });
+
+$(document).ready(function(){
+ $("<form />").attr({"id":"searchFormStreet","method":"post","action":"mod_WFSStreetGaz_client.php?"+getParamsForm2}).appendTo("#"+e_id2);
+ $("#searchFormStreet").submit( function() {
+ //try {if(startSearch2()){}}catch(e) {console.log(e);}
+ startSearch2();
+ return false;
+ } );
+
+ //table structure
+ $("<table/>").attr({"id":"tableStreet","border":"0","cellpadding":"0","cellspacing":"0"}).appendTo("#searchFormStreet");
+ $("<tr/>").attr({"id":"tr_a"}).appendTo("#tableStreet");
+ $("<tr/>").attr({"id":"tr_b"}).appendTo("#tableStreet");
+ $("<tr/>").attr({"id":"tr_c"}).appendTo("#tableStreet");
+ $("<td/>").attr({"id":"td_a"}).appendTo("#tr_a");
+ $("<td/>").attr({"id":"td_b"}).appendTo("#tr_a");
+ $("<td/>").attr({"id":"td_c"}).appendTo("#tr_a");
+ $("<td/>").attr({"id":"td_d"}).appendTo("#tr_b");
+ $("<td/>").attr({"id":"td_e"}).appendTo("#tr_b");
+ $("<td/>").attr({"id":"td_f"}).appendTo("#tr_b");
+ $("<td/>").attr({"id":"td_g"}).appendTo("#tr_c");
+ $("<td/>").attr({"id":"td_h"}).appendTo("#tr_c");
+ $("<td/>").attr({"id":"td_i"}).appendTo("#tr_c");
+
+ //button ok
+ $("<input type='submit'>").attr({"id":"button1","value":"ok"}).appendTo("#td_c");
+ $("#button1").click( function() {
+ eventGazResClickOV.trigger({
+ "targetArray":targetArray2
+ });
+ } );
+
+ $("<input type='submit'>").attr({"id":"button2","value":"ok"}).appendTo("#td_f");
+ $("#button1").css({"position":"relative"});
+ $("#button2").css({"position":"relative"});
+ //default: buttons hidden
+ $("#button1").css({"left":"-800"});
+ $("#button2").css({"left":"-800"});
+ $("#button2").click( function() {
+ eventGazResClickOV.trigger({
+ "targetArray":targetArray2
+ });
+ } );
+
+ //text fields
+ $("<input type='text'>").attr({"id":"feld1","size":"15"}).appendTo("#td_b");
+ $("#feld1").mousedown( function() {
+ clearAll();
+ $("#button1").css({"left":"0"});
+ $("#button2").css({"left":"-800"});
+ $("#feld2").attr('disabled','true');
+ } );
+
+ $("<input type='text'>").attr({"id":"feld2","size":"15"}).appendTo("#td_e");
+ $("#feld2").attr('disabled','true');
+ $("#feld2").mousedown( function() {
+ clearStreet();
+ $("#button1").css({"left":"-800"});
+ $("#button2").css({"left":"0"});
+ } );
+
+ //hidden field for gemeindeschluessel
+ $("<input type='hidden'>").attr({"id":"feldhidden"}).appendTo("#td_i");
+
+ //Field texts
+ $("#td_a").html("Ort:");
+ $("#td_d").html("Straße:");
+ $("#td_g").html("Treffer:");
+
+ //Block fuer STYLE CSS ##################################################
+ $("td").css('padding-left', '1px');
+ $("td").css('padding-right', '1px');
+ $("td").css('color', 'gray');
+ $("td").css('font-size', '11px');
+ $("td").css('height', '30px');
+
+ $("#td_a").css('font-weight','bold');
+ $("#td_d").css('font-weight','bold');
+ $("#td_g").css('font-weight','bold');
+ $("#td_g").css('vertical-align','top');
+ //Ende Block fuer STYLE CSS #############################################
+
+ });
+
+var setIcon = function (argObj) {
+ var geomIndex = argObj.geomIndex;
+ var geomArray = argObj.geomArray;
+ geomArray.get(geomIndex).e.setElement("Mapbender:icon","../img/pinblau.png");
+};
+
+var removeIcon = function (argObj) {
+ var geomIndex = argObj.geomIndex;
+ var geomArray = argObj.geomArray;
+ geomArray.get(geomIndex).e.delElement("Mapbender:icon");
+};
+
+var deleteHighlight = function(argObj){
+ var geomIndex = argObj.geomIndex;
+ var geomArray = argObj.geomArray;
+ var highlightObj = argObj.highlightObj;
+
+ var cw_fillcolor = "#cc33cc";
+ var currentGeom = geomArray.get(geomIndex);
+ highlightObj.clean();
+// highlightObj.del(currentGeom, cw_fillcolor);
+// highlightObj.paint();
+ try {
+ var highlightObjTemp = argObj.highlightObjTemp;
+ highlightObjTemp.clean();
+ }
+ catch(e) {
+ //console.log("Ein Fehler ist aufgetreten: %s", e);
+ }
+};
+
+var displayHighlight = function(argObj){
+ var geomIndex = argObj.geomIndex;
+ var geomArray = argObj.geomArray;
+ var highlightObj = argObj.highlightObj;
+
+ var cw_fillcolor = "#cc33cc";
+ var currentGeom = geomArray.get(geomIndex);
+ highlightObj.add(currentGeom, cw_fillcolor);
+ highlightObj.paint();
+};
+
+var zoomToGeom = function(argObj){
+ var geomIndex = argObj.geomIndex;
+ var geomArray = argObj.geomArray;
+ var highlightObj = argObj.highlightObj;
+ var targetArray = argObj.targetArray;
+ var zoomTo = argObj.zoomTo;
+ var offsetParam = argObj.offsetParam;
+
+ var currentGeom = geomArray.get(geomIndex);
+ var bbox = currentGeom.getBBox();
+ var buffer = new Point(1,1);
+ bbox[0] = bbox[0].minus(buffer);
+ bbox[1] = bbox[1].plus(buffer);
+ //console.log(bbox[0].x, bbox[0].y, bbox[1].x, bbox[1].y);
+ mb_calculateExtent(targetArray[0], bbox[0].x-offsetParam, bbox[0].y-offsetParam, bbox[1].x+offsetParam, bbox[1].y+offsetParam);
+ //zoom(targetArray[0], 'true', 0.999);
+ zoom(targetArray[0], 'true', zoomTo);
+};
+
+var zoomToFullExtent = function(argObj){
+ var targetArray = argObj.targetArray;
+
+ var ind = this.getMapObjIndexByName(targetArray[1]);
+ this.width = mb_mapObj[ind].width;
+ this.height = mb_mapObj[ind].height;
+ this.epsg = wms[0].gui_wms_epsg;
+
+ var arrayExt = new Array();
+ var exts = setExtent(width,height,epsg);
+ arrayExt = exts.split(",");
+ mb_calculateExtent(targetArray[1], arrayExt[0], arrayExt[1], arrayExt[2], arrayExt[3]);
+ mb_repaint(targetArray[1],arrayExt[0],arrayExt[1],arrayExt[2],arrayExt[3]);
+};
+
+var transferResult = function(argObj){
+ var geomIndex = argObj.geomIndex;
+ var geomArray = argObj.geomArray;
+ var resultType = argObj.type;
+
+ if(resultType=='ort'){
+ transferOrtResult(geomArray.get(geomIndex).e.getElementValueByName(resVal3),geomArray.get(geomIndex).e.getElementValueByName(resVal2));
+ $("#feldhidden").attr({"value":""+geomArray.get(geomIndex).e.getElementValueByName(resVal4)+""});
+ }
+ else if(resultType=='strasse'){
+ transferStrResult(geomArray.get(geomIndex).e.getElementValueByName(resVal5),geomArray.get(geomIndex).e.getElementValueByName(resVal6),geomArray.get(geomIndex).e.getElementValueByName(resVal3));
+ }
+};
+
+var eventGazResClickIcon = new MapbenderEvent();
+eventGazResClickIcon.register(setIcon);
+eventGazResClickIcon.register(deleteHighlight);
+eventGazResClickIcon.register(zoomToGeom);
+eventGazResClickIcon.register(displayHighlight);
+//eventGazResClickIcon.register(removeIcon);
+
+var eventGazResOver = new MapbenderEvent();
+eventGazResOver.register(displayHighlight);
+
+var eventGazResOut = new MapbenderEvent();
+eventGazResOut.register(deleteHighlight);
+
+var eventGazResClickOV = new MapbenderEvent();
+eventGazResClickOV.register(zoomToFullExtent);
+
+var eventGazResClick = new MapbenderEvent();
+eventGazResClick.register(deleteHighlight);
+eventGazResClick.register(zoomToGeom);
+eventGazResClick.register(displayHighlight);
+eventGazResClick.register(transferResult);
+
+ /**
+ * function to start search
+ *
+ */
+
+function startSearch2(){
+ if($("#feld2").val()!=''){
+ if($("#feld1").val()==''){
+ alert("Bitte Ort wählen.");
+ }
+ else{
+ propertyName2[0] = propNameStr1;
+ propertyName2[1] = propNameStr2;
+ var searchString1 = $("#feld2").val().replace (/^\s+/, '').replace (/\s+$/, '');
+ if (searchString1.length<3){
+ alert("Geben Sie mindestens drei Zeichen ein.");
+ return false;
+ }
+ searchValue2[0] = $("#feldhidden").val();
+ searchValue2[1] = searchString1;
+ validate2(propertyName2,searchValue2,wfsSearchStr,shortName2[1]);
+ }
+ }
+ else{
+ $("#td_h").empty();
+ var searchString = $("#feld1").val().replace (/^\s+/, '').replace (/\s+$/, '');
+ searchValue2[0] = searchString;
+ propertyName2[0] = propNameStr0;
+ if (searchString.length<3){
+ alert("Geben Sie mindestens drei Zeichen ein.");
+ return false;
+ }
+ validate2(propertyName2,searchValue2,wfsSearchOrt,shortName2[0]);
+ }
+}
+
+function clearStreet(){
+ $("#feld2").val("");
+ $("#td_h").empty();
+ propertyName2 = [];
+ searchValue2 = [];
+ $("#button1").css({"left":"-800"});
+ $("#button2").css({"left":"-800"});
+}
+
+function clearAll(){
+ $("#feld1").val("");
+ $("#feld2").val("");
+ $("#td_h").empty();
+ propertyName2 = [];
+ searchValue2 = [];
+ $("#button1").css({"left":"-800"});
+ $("#button2").css({"left":"-800"});
+}
+
+function normalize2(str){
+ //console.log("string vor replace = %s",str);
+ str = str.toUpperCase();
+ str = str.replace(/ß/g,'SS');
+ str = str.replace(/Ä/g,'AE');
+ str = str.replace(/Ö/g,'OE');
+ str = str.replace(/Ü/g,'UE');
+ return str;
+}
+
+ /**
+ * fills Ort search result in field, button and input handling and event for button
+ *
+ * [@param {string} resultFill transfer search value
+ */
+
+ function transferOrtResult(nextWfsUrl,resultFillNumber){
+ $("#feld1").attr({"value":""+resultFillNumber+""});
+ $("#button1").css({"left":"-800"});
+ $("#button2").css({"left":"0"});
+ $("#feld2").attr('disabled','');
+ $("#feld2").focus();
+ $("#td_h").empty();
+ wfsSearchStr = nextWfsUrl;
+}
+
+/**
+ * fills Strassen search result in field, button handling and event for button
+ *
+ * [@param {string} resultFill transfer search value
+ */
+
+function transferStrResult(resultFill,nextSearchAttr,nextWfsUrl){
+ var searchResult = resultFill;
+ $("#feld2").attr({"value":""+searchResult+""});
+ $("#td_h").empty();
+ propertyName2 = [];
+ searchValue2 = [];
+ propertyName2[0] = propNameStr3;
+ searchValue2[0] = nextSearchAttr;
+
+ validate2(propertyName2,searchValue2,nextWfsUrl,shortName2[2]);
+}
+
+/**
+ * creates wfs search request and shows search results in div tags
+ *
+ * [@param {array} propertyName2 array with all propertyNames for search
+ * [@param {array} searchValue2 array with all searchstrings for search
+ * [@param {string} wfsUrl URL of WFS
+ * [@param {string} searchAbbr string containing abbreviation defining step of search
+ */
+
+ function validate2(propertyName2,searchValue2,wfsUrl,searchAbbr){
+ $("#td_h").empty();
+ if(geomArray2.count()>0){
+ geomArray2.empty();
+ }
+ if(geomArray3.count()>0){
+ geomArray3.empty();
+ }
+ var filterParameterCount = propertyName2.length;
+ if(filterParameterCount == 0){
+ return false;
+ }
+ else{
+ var andConditions = "";
+ for (var i = 0; i < propertyName2.length; i++) {
+ if(propertyName2[i]==propNameStr1 || propertyName2[i]==propNameStr3){
+ andConditions += "<ogc:PropertyIsEqualTo>";
+ var closingTag = "</ogc:PropertyIsEqualTo>";
+ }
+ else{
+ andConditions += "<ogc:PropertyIsLike wildCard='*' singleChar='.' escape='!'>";
+ var closingTag = "</ogc:PropertyIsLike>";
+ }
+ andConditions += "<ogc:PropertyName>" + propertyName2[i] + "</ogc:PropertyName>";
+ andConditions += "<ogc:Literal>";
+ if(searchValue2[i]=="*"){
+ andConditions +="*";
+ }
+ else if(propertyName2[i]==propNameStr1 || propertyName2[i]==propNameStr3){
+ andConditions += normalize2(searchValue2[i]);
+ //andConditions += searchValue2[i];
+ }
+ else{
+ andConditions += normalize2(searchValue2[i])+"*";
+ //andConditions += searchValue2[i];
+ }
+ andConditions += "</ogc:Literal>";
+ //andConditions += "</ogc:PropertyIsLike>";
+ andConditions += closingTag;
+ }
+ if (filterParameterCount > 1) {
+ andConditions = "<And>" + andConditions + "</And>";
+ }
+
+ var requestUrl = wfsUrl;
+ requestUrl += "&filter=";
+ var filter = "<ogc:Filter xmlns:ogc='http://ogc.org' xmlns:gml='http://www.opengis.net/gml'>"+andConditions+"</ogc:Filter>";
+ }
+ $("#td_h").empty();
+ $("<img>").attr({"id":"wheelImg","src":"../img/indicator_wheel.gif"}).appendTo("#td_h");
+ $("<span>").attr({"id":"searchDiv"}).appendTo("#td_h").html(" Suche...");
+
+ var parameters = {command:"getSearchResults", "url":requestUrl, "filter":filter};
+ parent.mb_ajax_post("../gazetteer_rostock/mod_WFSStreetGaz_server.php", parameters, function (jsCode, status) {
+ $("#td_h").empty();
+ var geoObj = eval('(' + jsCode + ')');
+ if (jsCode) {
+ if (typeof(geoObj) == 'object') {
+ geomArray2.importGeoJSON(geoObj);
+ geomArray3.importGeoJSON(geoObj);
+ $("#td_h").empty();
+ $("<ul/>").attr({"id":"hnrUl"}).appendTo("#td_h");
+ $("#hnrUl").css('list-style', 'none');
+ $("#hnrUl").css('margin', '0');
+ $("#hnrUl").css('padding', '0');
+ for (var i=0; i < geomArray2.count(); i++) {
+ if(searchAbbr==shortName2[0]){
+ (function () {
+ var geomStr = searchAbbr + i;
+ var geomIndex = i;
+ $("<div>").attr({"id":searchAbbr+i}).appendTo("#td_h");
+ var text1 = geomArray2.get(i).e.getElementValueByName(resVal0);
+ if(geomArray2.get(i).e.getElementValueByName(resVal1)==''){
+ var text2 = "";
+ }
+ else{
+ var text2 = geomArray2.get(i).e.getElementValueByName(resVal1);
+ }
+ $("#"+geomStr).text(text1+" "+text2);
+ $("#"+geomStr).css({"cursor":"pointer"});
+ if ((i % 2) === 0) {
+ $("#"+geomStr).css({"color":"red"});
+ }
+ else{
+ $("#"+geomStr).css({"color":"blue"});
+ }
+ $("#"+geomStr).mouseover( function() {
+ eventGazResOver.trigger({
+ "geomIndex":geomIndex,
+ "geomArray":geomArray2,
+ "eventAction":"over",
+ "targetArray":targetArray2,
+ "highlightObj":global_resultHighlight1
+ });
+ });
+ $("#"+geomStr).mouseout( function() {
+ eventGazResOut.trigger({
+ "geomIndex":geomIndex,
+ "geomArray":geomArray2,
+ "eventAction":"out",
+ "targetArray":targetArray2,
+ "highlightObj":global_resultHighlight1
+ });
+ });
+ $("#"+geomStr).click( function() {
+ eventGazResClick.trigger({
+ "geomIndex":geomIndex,
+ "geomArray":geomArray2,
+ "eventAction":"click",
+ "targetArray":targetArray2,
+ "highlightObj":global_resultHighlight1,
+ "type":"ort",
+ "zoomTo":"1.0",
+ "offsetParam":offsetParamOrt
+ });
+ });
+ })();
+ }
+ else if (searchAbbr==shortName2[1]){
+ (function () {
+ var geomStr = searchAbbr + i;
+ var geomIndex = i;
+ $("<div>").attr({"id":searchAbbr+i}).appendTo("#td_h");
+ $("#"+geomStr).text(geomArray2.get(i).e.getElementValueByName(resVal5));
+ $("#"+geomStr).css({"cursor":"pointer"});
+ if ((i % 2) === 0) {
+ $("#"+geomStr).css({"color":"red"});
+ }
+ else{
+ $("#"+geomStr).css({"color":"blue"});
+ }
+ $("#"+geomStr).mouseover( function() {
+ eventGazResOver.trigger({
+ "geomIndex":geomIndex,
+ "geomArray":geomArray2,
+ "eventAction":"over",
+ "targetArray":targetArray2,
+ "highlightObj":global_resultHighlight1
+ });
+ });
+ $("#"+geomStr).mouseout( function() {
+ eventGazResOut.trigger({
+ "geomIndex":geomIndex,
+ "geomArray":geomArray2,
+ "eventAction":"out",
+ "targetArray":targetArray2,
+ "highlightObj":global_resultHighlight1
+ });
+ });
+ $("#"+geomStr).click( function() {
+ eventGazResClick.trigger({
+ "geomIndex":geomIndex,
+ "geomArray":geomArray2,
+ "eventAction":"click",
+ "targetArray":targetArray2,
+ "highlightObj":global_resultHighlight1,
+ "type":"strasse",
+ "zoomTo":"1.0",
+ "offsetParam":offsetParamStr
+ });
+ });
+ })();
+ }
+ else if (searchAbbr==shortName2[2]){
+ (function () {
+ var geomStr = searchAbbr + i;
+ var geomIndex = i;
+ $("<li/>").attr({"id":searchAbbr+i}).appendTo("#hnrUl");
+ $("#"+searchAbbr+i).css('float', 'left');
+ $("#"+searchAbbr+i).css('margin', '2px');
+ $("#"+searchAbbr+i).css('padding', '1px 2px');
+ if(i==9){
+ $("#"+geomStr).text(geomArray2.get(i).e.getElementValueByName(resVal7));
+ $("<br>").appendTo("#"+geomStr);
+ }
+ else{
+ $("#"+geomStr).text(geomArray2.get(i).e.getElementValueByName(resVal7));
+ }
+ $("#"+geomStr).css({"cursor":"pointer"});
+ if ((i % 2) === 0) {
+ $("#"+geomStr).css({"color":"red"});
+ }
+ else{
+ $("#"+geomStr).css({"color":"blue"});
+ }
+ $("#"+geomStr).mouseover( function() {
+ eventGazResOver.trigger({
+ "geomIndex":geomIndex,
+ "geomArray":geomArray2,
+ "eventAction":"over",
+ "targetArray":targetArray2,
+ "highlightObj":global_resultHighlight1
+ });
+ });
+ $("#"+geomStr).mouseout( function() {
+ eventGazResOut.trigger({
+ "geomIndex":geomIndex,
+ "geomArray":geomArray2,
+ "eventAction":"out",
+ "targetArray":targetArray2,
+ "highlightObj":global_resultHighlight1
+ });
+ });
+ $("#"+geomStr).click( function() {
+ eventGazResClickIcon.trigger({
+ "geomIndex":geomIndex,
+ "geomArray":geomArray3,
+ "targetArray":targetArray2,
+ "highlightObj":global_resultHighlight2,
+ "highlightObjTemp":global_resultHighlight1,
+ "zoomTo":"0.01",
+ "offsetParam":offsetParamHsnr
+ });
+ });
+ })();
+ }
+ }
+ if(geomArray2.count()==0){
+ $("#td_h").empty();
+ $("<div>").attr({"id":"noResult"}).appendTo("#td_h");
+ if(searchAbbr==shortName2[0]){
+ $("#noResult").text(noResultText2[0]);
+ }
+ if(searchAbbr==shortName2[1]){
+ $("#noResult").text(noResultText2[1]);
+ }
+ if(searchAbbr==shortName2[2]){
+ $("#noResult").text(noResultText2[2]);
+ }
+ }
+ }
+ else {
+ $("#td_h").empty();
+ $("<div>").attr({"id":"noResult"}).appendTo("#td_h");
+ if(searchAbbr==shortName2[0]){
+ $("#noResult").text(noResultText2[0]);
+ }
+ if(searchAbbr==shortName2[1]){
+ $("#noResult").text(noResultText2[1]);
+ }
+ if(searchAbbr==shortName2[2]){
+ $("#noResult").text(noResultText2[2]);
+ }
+ }
+ }
+ else {
+ alert("No results.");
+ }
+ });
+}
Property changes on: branches/2.5/http/gazetteer_rostock/mod_WFSStreetGaz_client.js
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/2.5/http/gazetteer_rostock/mod_WFSStreetGaz_client.php
===================================================================
--- branches/2.5/http/gazetteer_rostock/mod_WFSStreetGaz_client.php (rev 0)
+++ branches/2.5/http/gazetteer_rostock/mod_WFSStreetGaz_client.php 2008-07-28 07:52:24 UTC (rev 2733)
@@ -0,0 +1,69 @@
+<?php
+#$Id: mod_WFSStreetGaz_client.php 2008 2008-03-05 11:44:45Z verenadiewald $
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+echo "var getParamsForm2 = '".SID."&gui_id=".$gui_id."&e_id=".$e_id."';";
+
+echo "var e_id2 = '".$e_id."';";
+echo "var resultGeom2 = '';";
+echo "var geomArray2 = new GeometryArray();";
+echo "var geomArray3 = new GeometryArray();";
+
+echo "var wfsSearchOrt = 'http://kataster.sv.rostock.de/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:orte_sort';";
+//echo "var wfsSearchStr = 'http://kataster.sv.rostock.de/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:str_dbr_sort';";
+//echo "var wfsSearchNr = 'http://kataster.sv.rostock.de/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:hnr_dbr_sort';";
+
+echo "var propertyName2 = [];";
+echo "propNameStr0 = 'ort_normalisiert';";
+echo "propNameStr1 = 'gemeindeschluessel';";
+echo "propNameStr2 = 'strassenname_normalisiert';";
+echo "propNameStr3 = 'suchschluessel';";
+
+echo "var searchValue2 = [];";
+
+echo "var resVal0='geographicidentifier';";
+echo "var resVal1='orts_zusatz';";
+echo "var resVal2='gemeindename';";
+echo "var resVal3='wfs_url';";
+echo "var resVal4='gemeindeschluessel';";
+echo "var resVal5='strassenname';";
+echo "var resVal6='suchschluessel';";
+echo "var resVal7='hnr';";
+
+echo "var shortName2 = [];";
+echo "shortName2[0] = 'ort';";
+echo "shortName2[1] = 'strasse';";
+echo "shortName2[2] = 'hausnr';";
+
+echo "var noResultText2 = [];";
+echo "noResultText2[0] = 'Kein Ort gefunden.';";
+echo "noResultText2[1] = 'Keine Strasse gefunden.';";
+echo "noResultText2[2] = 'Keine Hausnummern vorhanden.';";
+
+echo "var targetString2 = '" . implode(",", $e_target) . "';";
+echo "var targetArray2 = targetString2.split(',');";
+echo "var targetArray3 = [];";
+echo "targetArray3[0] = targetArray2[0];";
+
+echo "var offsetParamOrt = 200;";
+echo "var offsetParamStr = 200;";
+echo "var offsetParamHsnr = 0;";
+
+include (dirname(__FILE__)."/../gazetteer_rostock/mod_WFSStreetGaz_client.js");
+
+?>
Added: branches/2.5/http/gazetteer_rostock/mod_WFSStreetGaz_server.php
===================================================================
--- branches/2.5/http/gazetteer_rostock/mod_WFSStreetGaz_server.php (rev 0)
+++ branches/2.5/http/gazetteer_rostock/mod_WFSStreetGaz_server.php 2008-07-28 07:52:24 UTC (rev 2733)
@@ -0,0 +1,69 @@
+<?php
+# $Id: mod_wfsrequest.php 1008 2007-01-16 11:26:56Z christoph $
+# http://www.mapbender.org/index.php/Administration
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+include(dirname(__FILE__)."/../classes/class_gml2.php");
+require_once(dirname(__FILE__)."/../extensions/JSON.php");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db($DB,$con);
+
+$command = $_REQUEST["command"];
+
+if ($command == "getSearchResults") {
+ $filter = $_REQUEST["filter"];
+ $url = $_REQUEST["url"];
+
+ $admin = new administration();
+
+ $req = urldecode($url).urlencode($admin->char_decode(stripslashes($filter)));
+ $mygml = new gml2();
+
+ // $mygml->parsegml($req);
+//
+// // generates JavaScript code that will add a geometry array containing
+// // all the result geometries
+//
+// $js = "";
+// if ($mygml->getMemberCount() > 0) {
+//
+// $js .= $mygml->exportGeometriesToJS(true);
+//
+// for ($i = 0; $i < $mygml->getMemberCount(); $i++) {
+// for ($j = 0; $j < count($mygml->keys[$i]); $j++) {
+// $key = $mygml->sepNameSpace($mygml->keys[$i][$j]);
+// $js .= "geom.get(".$i.").e.setElement('".$key."', '".$mygml->getValueBySeparatedKey($i, $key) . "');\n";
+// }
+// }
+// }
+// echo $js;
+
+ $mygml->parseFile($req);
+
+ header("Content-type:application/x-json; charset=utf-8");
+ echo $mygml->toGeoJSON();
+}
+else {
+ echo "please enter a valid command.";
+}
+?>
\ No newline at end of file
Property changes on: branches/2.5/http/gazetteer_rostock/mod_WFSStreetGaz_server.php
___________________________________________________________________
Name: svn:executable
+ *
More information about the Mapbender_commits
mailing list