Страница 3 из 4

Re: Странная ощибка GetFeatureInfo

Добавлено: 04 май 2011, 14:32
Mavka
Отличия только в версии. На это это никак не реагирует?

Re: Странная ощибка GetFeatureInfo

Добавлено: 04 май 2011, 14:54
Protectr
Выдает пустую таблицу!!!
ничего не могу понять !

Re: Странная ощибка GetFeatureInfo

Добавлено: 04 май 2011, 17:25
Protectr
Так кто знает в чем проблема ???
Я уже отчаялся!

Re: Странная ощибка GetFeatureInfo

Добавлено: 05 май 2011, 09:41
Mavka
Если он выдает пустую таблицу, но при точно таком же обращении из OL (все параметры идентичны) ответ нулевой, то у меня идей, объясняющих мистику, нету. Попробуйте сменить формат с text/html на GML.

Re: Странная ощибка GetFeatureInfo

Добавлено: 06 май 2011, 13:37
Protectr
Я думаю что раз запрос выдает таблицу с нулевыми значениями , то ошибка явно не в мап-файле .

вот моя функция:

Код: Выделить всё

	 info = new OpenLayers.Control.WMSGetFeatureInfo({
			 
            url:'http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map',   /*URL STRAIGHT*/
			layerUrls:['http://localhost:8080/WMSTileCache-V0.2/WMS/water'],
           
            queryVisible: true,
            eventListeners: {
                getfeatureinfo: function(event) {
                    map.addPopup(new OpenLayers.Popup.FramedCloud(
                        "chicken", 
                        map.getLonLatFromPixel(event.xy),
                        null,
                        event.text,
                        null,
                        true
                    ));
                }
            }
        });
        map.addControl(info);
        info.activate();
Любопыино , что в попапе без проблем можна вывести любые другие значения . все , кроме того что нужно .

Re: Странная ощибка GetFeatureInfo

Добавлено: 06 май 2011, 15:43
Mavka
Самая непонятная проблема - почему запрос вручную дает пустую таблицу, а отправленный из OpenLayers вообще ничего не возвращает. Проверьте еще раз прокси, попробуйте не использовать его. Включите отладку в MapServer, еще раз просмотрите логи Apache и консоль Firebug.

Re: Странная ощибка GetFeatureInfo

Добавлено: 06 май 2011, 16:24
Protectr
Proxy не использую , хотя фаербаг все равно дает ошибку "Proxy undefined"

Как включить отладку Mapserver ???

Re: Странная ощибка GetFeatureInfo

Добавлено: 06 май 2011, 16:56
Mavka
На уровне MAP:

Код: Выделить всё

CONFIG "MS_ERRORFILE" "c:/temp/error.log"
DEBUG 5
Proxy не использую
Хорошо, а если его включить?

Re: Странная ощибка GetFeatureInfo

Добавлено: 06 май 2011, 17:29
Protectr
Если включить прокси : все равно ошибка
OpenLayers is not defined
OpenLayers.ProxyHost = "proxy.cgi?url=";
И в попапе опять
#! C:/Python27/python.exe -u """This is a blind proxy that we use to get around browser restrictions that prevent the Javascript from loading pages not on the same server as the Javascript. This has several problems: it's less efficient, it might break some sites, and it's a security risk because people can use this proxy to browse the web and possibly do bad stuff with it. It only loads pages via http and https, but it can load any content type. It supports GET and POST requests.""" import urllib2 import cgi import sys, os # Designed to prevent Open Proxy type stuff. allowedHosts = ['localhost','localhost:8080','www.openlayers.org'] method = os.environ["REQUEST_METHOD"] if method == "POST": qs = os.environ["QUERY_STRING"] d = cgi.parse_qs(qs) if d.has_key("url"): url = d["url"][0] else: url = "http://www.openlayers.org" else: fs = cgi.FieldStorage() url = fs.getvalue('url', "http://www.openlayers.org") try: host = url.split("/")[2] if allowedHosts and not host in allowedHosts: print "Status: 502 Bad Gateway" print "Content-Type: text/plain" print print "This proxy does not allow you to access that location (%s)." % (host,) print print os.environ elif url.startswith("http://") or url.startswith("https://"): if method == "POST": length = int(os.environ["CONTENT_LENGTH"]) headers = {"Content-Type": os.environ["CONTENT_TYPE"]} body = sys.stdin.read(length) r = urllib2.Request(url, body, headers) y = urllib2.urlopen(r) else: y = urllib2.urlopen(url) # print content type header i = y.info() if i.has_key("Content-Type"): print "Content-Type: %s" % (i["Content-Type"]) else: print "Content-Type: text/plain" print print y.read() y.close() else: print "Content-Type: text/plain" print print "Illegal request." except Exception, E: print "Status: 500 Unexpected Error" print "Content-Type: text/plain" print print "Some unexpected error occurred. Error text was:", E

Re: Странная ощибка GetFeatureInfo

Добавлено: 06 май 2011, 17:30
Protectr
из моего proxy.cgi :

allowedHosts = ['localhost','localhost:8080','www.openlayers.org']

Re: Странная ощибка GetFeatureInfo

Добавлено: 06 май 2011, 17:37
Protectr
Если включить прокси , то запрос в фаербаге вообще не отлеживаеться!
зато отображает в попапе вышенаписаное!

вот error log мапсервера : (Прокси выключен)
[Fri May 06 18:32:37 2011].500000 CGI Request 1 on process 3140
[Fri May 06 18:32:37 2011].515000 mapserv request processing time (msLoadMap not incl.): 0.015s
[Fri May 06 18:32:37 2011].515000 msFreeMap(): freeing map at 01A4B7A0.

Re: Странная ощибка GetFeatureInfo

Добавлено: 06 май 2011, 20:38
Mavka
OpenLayers.ProxyHost = "proxy.cgi?url=";
URL для прокси должен быть абсолютным, обычно:

Код: Выделить всё

OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";  
Прокси-скрипт проверяется на работоспособность самостоятельно без OpenLayers. См. там же.

Re: Странная ощибка GetFeatureInfo

Добавлено: 07 май 2011, 13:11
Protectr
С включенным прокси :
Access to restricted URI denied" code: "1012
и запрос не происходит .
что это значит ??

Re: Странная ощибка GetFeatureInfo

Добавлено: 07 май 2011, 17:45
Protectr
Перейдя по ссылке
http://localhost/cgi-bin/proxy.cgi
открываеться страничка OpenLayers

Re: Странная ощибка GetFeatureInfo

Добавлено: 08 май 2011, 14:04
Mavka
Какой путь для прокси указываете (OpenLayers.ProxyHost)?