[OpenLayers-Users] FeatureInfo-Popup not returning results
Sven Burbeck
sburbeck at bfs.de
Tue Aug 24 08:53:56 EDT 2010
Hi Marc,
indeed I think I run into the same origin issue.
I already had a look into it but I run my project on glassfish v3 and
I have to figure out tomorrow, where glassfish needs the proxy.cgi to
be.
cheers,
Sven
Quoting "Marc Jansen" <jansen at terrestris.de>:
> Hi Sven,
>
> which error do you get in firebug? Just guessing: could it be that you
> run into the same origin policy
> (http://en.wikipedia.org/wiki/Same_origin_policy)? Do the mapserver and
> the webserver share the same origin?
>
> If not, you'll need a proxy, and OpenLayers provides one for you:
> http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#ProxyHost
>
> If you see a different error, we'll need more details about it.
>
> Regards,
> Marc
>
>
> n 24.08.2010 12:36, Sven Burbeck wrote:
>> Hi Marc,
>> thanks for your hint regarding the vendorParams. It at least solves
>> part of the problem (passing the URl to the constructor didn't work).
>> I now produce a request that has the "map" parameter and the request
>> gets a response from the server (format=html).
>>
>> However, GeoExt.popup opens but is still blank and doesn't show the html.
>> Firebug throws an error (just the GET request) although I can take
>> this request and get a proper response from the server.
>>
>> any idea?
>>
>> cheers,
>> Sven
>>
>>
>>
>> Quoting "Marc Jansen"<jansen at terrestris.de>:
>>
>>
>>> Hi Sven,
>>>
>>> The error message you see come from UMN mapserver moaning about the
>>> missing URL parameter MAP, not the OpenLayers Map.
>>>
>>> Have you tried to pass over an URL to the Constructor of the control
>>> (this isn't documented in the API, but maybe should be)?
>>>
>>> featureInfo = new OpenLayers.Control.WMSGetFeatureInfo({
>>> url : 'http://example.com/mapserver?map=/path/to/mapfile.map'
>>> });
>>>
>>>
>>> If the above fails, you could use the non-API-property "vendorParams" (I
>>> cannot see a reason why this is a hidden option):
>>>
>>> featureInfo = new OpenLayers.Control.WMSGetFeatureInfo({
>>> vendorParams: {
>>> map: '/path/to/mapfile.map'
>>> }
>>> });
>>>
>>> If both work, I'd go with the vendorParams, because that is what UMN
>>> Mapservers MAP url parameter is.
>>>
>>> Untested, hope it helps,
>>>
>>> Marc
>>>
>>>
>>>
>>> On 24.08.2010 11:00, Sven Burbeck wrote:
>>>
>>>> Hi list,
>>>> I'm struggling to show GetFeatureInfo results in a GeoExtPopup.
>>>> I used the sample code for openLayers / GeoExt.popup.
>>>> That's the code:
>>>> ...
>>>> var featureInfo = new OpenLayers.Control.WMSGetFeatureInfo();
>>>> featureInfo.events.on({
>>>> getfeatureinfo: function(e) {
>>>> new GeoExt.Popup({
>>>> title: "Info",
>>>> width: 200,
>>>> height: 150,
>>>> autoScroll: true,
>>>> maximizable: true,
>>>> map: map,
>>>> lonlat: map.getLonLatFromPixel(e.xy),
>>>> html: e.text
>>>> }).show();
>>>> }
>>>> });
>>>>
>>>> map.addControl(featureInfo);
>>>> featureInfo.activate();
>>>> ...
>>>> My WMS comes from MapServer (and FeatureInfo apparently works on the
>>>> selected layers).
>>>> When checking the request (copied from firebug) directly in the browser
>>>> I get the following error message:
>>>> 'loadMap(): Web application error. CGI variable "map" is not set.'
>>>>
>>>> And that's actually true. When adding the "map" parameter manually
>>>> everything works well.
>>>> However, I thought the requests "map" and "layers" parameter were given
>>>> by "map:map".
>>>>
>>>> Maybe I simply missed something but currently I don't know what.
>>>>
>>>>
>>>> cheerrs,
>>>> Sven
>>>>
>>>>
>>>>
>>>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
More information about the Users
mailing list