[OpenLayers-Users] ISO-8859-1
R. Ortner
reinhard.ortner at edu.fh-kaernten.ac.at
Fri Nov 30 05:11:59 EST 2007
Hi,
i´m now a little confused...
I looked at
http://rips-uis.lubw.baden-wuerttemberg.de/rips/wms_viewer/openlayer_test/OpenLayers.php
cause i use the same GetFeatureInfo request (see below). They also use
responseText with innerHTML and they can display special characters with no
problem.
If I open the request in a new window everything is displayed correct but
with the "normal" call within the application (like the lubw application)
the special characters shown as ?.
Any idea where else the problem could be?
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;
}
----
Bart van den Eijnden (OSGIS)-2 wrote:
>
> You can use an iframe and set it's source (src) to the GetFeatureInfo URL.
>
> 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 07:52
>
>>
>> that will work basically. Now i can open the info in a new window and it
> will
>> diplayed correctly.
>>
>> but i need to find out a way to disply it within the application. maybe
> not
>> with innerHTML but with something different. Can i use something else
> except
>> innerHTML to place it e.g. in the top right corner?
>>
>> ----
>>
>> Bart van den Eijnden (OSGIS)-2 wrote:
>> >
>> > ResponseXML will only work if the content-type (set in the http
> headers)
>> > is
>> > text/xml. Then ofcourse you won't be able to set it to the innerHTML
> since
>> > it is not a string.
>> >
>> > I tend to believe you can only get this done using (UTF-8 and HTML)
> or
>> > (ISO8859 and XML) if you use AJAX.
>> >
>> > What happens if you just popup a new window with the url:
>> >
>> > So instead of:
>> >
>> > OpenLayers.loadURL(request, '', this, setHTML);
>> >
>> > try:
>> >
>> > window.open(request);
>> >
>> > 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:37
>> >
>> >>
>> >> 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 &amp;&amp;
> document.getElementById(id).checked==true) {
>> >> document.getElementById('map').style.cursor =
>> 'crosshair';
>> >> document.getElementById(imgid).src =
>> > &quot;img/treemenu/identify_2.gif&quot;;
>> >> if (oldimgid != null)
> document.getElementById(oldimgid).src =
>> >> &quot;img/treemenu/identify_1.gif&quot;;
>> >> oldimgid = imgid;
>> >> document.getElementById('nodeList').style.visibility =
>> > 'visible';
>> >>
>> >> map.events.register('click', map, function (e) {
>> >> if(infobox == 1 &amp;&amp;
> document.getElementById(id).checked==true)
>> > {
>> >> document.getElementById('map').style.cursor =
>> 'crosshair';
>> >> OpenLayers.Util.getElement('nodeList').innerHTML =
>> > &quot;Loading...
>> >> please wait...&quot;;
>> >> var request = window[id].getFullRequestString({
>> >> REQUEST:
> &quot;GetFeatureInfo&quot;,
>> >> EXCEPTIONS:
>> > &quot;application/vnd.ogc.se_xml&quot;,
>> >> 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 =
> &quot;&quot;;
>> >> infobox = 0;
>> >> document.getElementById(imgid).src =
>> > &quot;img/treemenu/identify_1.gif&quot;;
>> >> }
>> >> }
>> >>
>> >> 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:
>> >> &gt;
>> >> &gt; Can you explain code-wise how you perform the
> GetFeatureInfo
>> >> request?
>> >> &gt;
>> >> &gt; If the code uses responseText instead of responseXML,
>> it
> can only
>> > work in
>> >> &gt; UTF-8.
>> >> &gt;
>> >> &gt; See also some threads in september titled loading XML
> problem, e.g.:
>> >> &gt;
>> >> &gt;
> http://openlayers.org/pipermail/users/2007-September/003001.html
>> >> &gt;
>> >> &gt; Best regards,
>> >> &gt; Bart
>> >> &gt;
>> >> &gt; --
>> >> &gt; Bart van den Eijnden
>> >> &gt; OSGIS, Open Source GIS
>> >> &gt; http://www.osgis.nl
>> >> &gt;
>> >> &gt;
>> >> &gt; --------- Oorspronkelijk bericht --------
>> >> &gt; Van: R. Ortner
> &lt;reinhard.ortner at edu.fh-kaernten.ac.at&gt;
>> >> &gt; Naar: users at openlayers.org
> &lt;users at openlayers.org&gt;
>> >> &gt; Onderwerp: Re: [OpenLayers-Users] ISO-8859-1
>> >> &gt; Datum: 29/11/07 06:00
>> >> &gt;
>> >> &gt;&gt;
>> >> &gt;&gt; Hi again,
>> >> &gt;&gt;
>> >> &gt;&gt; i tried to set the charset by adding
> &amp;lt;meta
>> >> &gt; http-equiv=&amp;quot;content-type&amp;quot;
>> >> &gt;&gt; content=&amp;quot;text/html;
> charset=ISO-8859-1&amp;quot;
>> > /&amp;gt; to the head of
>> >> &gt;&gt; the
>> >> &gt; template file
>> >> &gt;&gt; and by adding it to my OL index.php. I also set
> the apache
>> > defaultCharset
>> >> &gt; to
>> >> &gt;&gt; ISO-8859-1 but i still have some special
> characters displayed
>> > wrong.
>> >> &gt;&gt;
>> >> &gt;&gt; So i gess that must be something in the
> OpenLayers Code where
>> >> the
>> > Charset
>> >> &gt; is
>> >> &gt;&gt; set &amp;quot;wrong&amp;quot;!
>> >> &gt;&gt;
>> >> &gt;&gt; If i try to open the template file (template
> file for a
>> > getFeatrueInfo
>> >> &gt;&gt; request the characters displayed correctly!
>> only
> wrong when OL
>> >> is
>> >> &gt; involved)
>> >> &gt;&gt;
>> >> &gt;&gt; hope some developer can tell me how to change
> the default
>> >> charset
>> > of OL
>> >> &gt;&gt;
>> >> &gt;&gt; thx
>> >> &gt;&gt;
>> >> &gt;&gt; ----
>> >> &gt;&gt;
>> >> &gt;&gt;
>> >> &gt;&gt; R. Ortner wrote:
>> >> &gt;&gt; &amp;gt;
>> >> &gt;&gt; &amp;gt; Hi,
>> >> &gt;&gt; &amp;gt;
>> >> &gt;&gt; &amp;gt; where to tell OL to show the
> getFeatureInfo request in
>> > ISO-8859-1?
>> >> &gt;&gt; (i
>> >> &gt; need
>> >> &gt;&gt; &amp;gt; special character support)
>> >> &gt;&gt; &amp;gt;
>> >> &gt;&gt; &amp;gt; so far i get as a result of my
> request for every
>> >> special
>> > character
>> >> &gt; like ä
>> >> &gt;&gt; &amp;gt; or ö -&amp;gt; � (FF) /? (in
> IE).
>> >> &gt;&gt; &amp;gt;
>> >> &gt;&gt; &amp;gt; regards
>> >> &gt;&gt; &amp;gt; R. Ortner
>> >> &gt;&gt; &amp;gt;
>> >> &gt;&gt;
>> >> &gt;&gt; --
>> >> &gt;&gt; View this message in context:
>> >> &gt;
> http://www.nabble.com/ISO-8859-1-tf4887822.html#a14021006
>> >> &gt;&gt; Sent from the OpenLayers Users mailing list
> archive at
>> > Nabble.com.
>> >> &gt;&gt;
>> >> &gt;&gt; _______________________________________________
>> >> &gt;&gt; Users mailing list
>> >> &gt;&gt; Users at openlayers.org
>> >> &gt;&gt; http://openlayers.org/mailman/listinfo/users
>> >> &gt;&gt;
>> >> &gt;
>> >> &gt;
>> >> &gt;
>> >> &gt; _______________________________________________
>> >> &gt; Users mailing list
>> >> &gt; Users at openlayers.org
>> >> &gt; http://openlayers.org/mailman/listinfo/users
>> >> &gt;
>> >> &gt;
>> >>
>> >> --
>> >> 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.
>> >>
>> >> _______________________________________________
>> >> 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#a14022546
>> 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#a14042427
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list