[OpenLayers-Users] ISO-8859-1

R. Ortner reinhard.ortner at edu.fh-kaernten.ac.at
Thu Nov 29 03:36:50 EST 2007


Heres my code for the getfeatureinfo part:

function checkinfo(imgid,url,title){

if (infobox == 0) {infobox = 1;}
if (imgid == oldimgid) {infobox = 0;}
id = imgid.substring(3,imgid.length);
	 if(infobox == 1 && document.getElementById(id).checked==true) {
	 					document.getElementById('map').style.cursor = 'crosshair';
						document.getElementById(imgid).src = "img/treemenu/identify_2.gif";
        		if (oldimgid != null) document.getElementById(oldimgid).src =
"img/treemenu/identify_1.gif"; 
        		oldimgid = imgid;
        		document.getElementById('nodeList').style.visibility = 'visible';

    map.events.register('click', map, function (e) {
				if(infobox == 1 && document.getElementById(id).checked==true) {
	 					document.getElementById('map').style.cursor = 'crosshair';
            OpenLayers.Util.getElement('nodeList').innerHTML = "Loading...
please wait...";
            var request =  window[id].getFullRequestString({
                            REQUEST: "GetFeatureInfo",
                            EXCEPTIONS: "application/vnd.ogc.se_xml",
                            BBOX: window[id].map.getExtent().toBBOX(),
                            X: e.xy.x,
                            Y: e.xy.y,
                            INFO_FORMAT: 'text/html',
                            QUERY_LAYERS: window[id].params.LAYERS,
                            WIDTH: window[id].map.size.w,
                            HEIGHT: window[id].map.size.h});
            OpenLayers.loadURL(request, '', this, setHTML);
            OpenLayers.Event.stop(e); 
				}
      });
		}
else {		
	 					document.getElementById('map').style.cursor = 'auto';
			 			document.getElementById('nodeList').style.visibility = 'hidden';
			 			if (imgid == oldimgid) { oldimgid = null; } else { oldimgid = imgid;
}
						document.getElementById('nodeList').innerHTML = "";
			 			infobox = 0; 
						document.getElementById(imgid).src = "img/treemenu/identify_1.gif";
						}
}		

function setHTML(response) { 
   OpenLayers.Util.getElement('nodeList').innerHTML = response.responseText;
}


I tried to change the response.responseText to responseXML as u told, but
than the Info is not displayed any more. (after mouseclick i see short the
Loading... please wait... and than nothing!)
do i have then to change something about my template to, maybe with the
responseXML the template is not correct anymore?
 

----



Bart van den Eijnden (OSGIS)-2 wrote:
> 
> Can you explain code-wise how you perform the GetFeatureInfo request?
> 
> If the code uses responseText instead of responseXML, it can only work in
> UTF-8.
> 
> See also some threads in september titled loading XML problem, e.g.:
> 
> http://openlayers.org/pipermail/users/2007-September/003001.html
> 
> Best regards,
> Bart
> 
> --
> Bart van den Eijnden
> OSGIS, Open Source GIS
> http://www.osgis.nl
> 
> 
> --------- Oorspronkelijk bericht --------
> Van: R. Ortner <reinhard.ortner at edu.fh-kaernten.ac.at>
> Naar: users at openlayers.org <users at openlayers.org>
> Onderwerp: Re: [OpenLayers-Users] ISO-8859-1
> Datum: 29/11/07 06:00
> 
>> 
>> Hi again,
>> 
>> i tried to set the charset by adding &lt;meta
> http-equiv=&quot;content-type&quot;
>> content=&quot;text/html; charset=ISO-8859-1&quot; /&gt; to the head of
>> the
> template file
>> and by adding it to my OL index.php. I also set the apache defaultCharset
> to
>> ISO-8859-1 but i still have some special characters displayed wrong.
>> 
>> So i gess that must be something in the OpenLayers Code where the Charset
> is
>> set &quot;wrong&quot;!
>> 
>> If i try to open the template file (template file for a getFeatrueInfo
>> request the characters displayed correctly! only wrong when OL is
> involved)
>> 
>> hope some developer can tell me how to change the default charset of OL
>> 
>> thx
>> 
>> ----
>> 
>> 
>> R. Ortner wrote:
>> &gt; 
>> &gt; Hi,
>> &gt; 
>> &gt; where to tell OL to show the getFeatureInfo request in ISO-8859-1?
>> (i
> need
>> &gt; special character support)
>> &gt; 
>> &gt; so far i get as a result of my request for every special character
> like ä
>> &gt; or ö -&gt; � (FF) /? (in IE).
>> &gt; 
>> &gt; regards
>> &gt; R. Ortner
>> &gt; 
>> 
>> -- 
>> View this message in context:
> http://www.nabble.com/ISO-8859-1-tf4887822.html#a14021006
>> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>> 
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>> 
> 
> 
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://www.nabble.com/ISO-8859-1-tf4887822.html#a14021264
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list