[OpenLayers-Users] WMSGetFeatureInfo with IE

Micho Gar michogar at gmail.com
Thu Sep 3 11:03:28 EDT 2009


Very strange.

I have been investigating in the OpenLayers code and I have seen that the
wms petition for the same point generate two diferent url. For FireFox
respond with data and for IExplorer 7 not. The unique diference between both
is the bbox. I dont understand anything.

FF:
http://192.168.11.159:8090/geoserver/wms?service=WMS&version=1.1.0&request=GetFeatureInfo&layers=osmius%3Ausuarios_instancias,osmius%3Ausuarios_servicios&query_layers=osmius%3Ausuarios_instancias,osmius%3Ausuarios_servicios&styles=,&bbox=-403214.87876%2C4928941.444487%2C-393278.065085%2C4934387.582751&srs=EPSG%3A900913&feature_count=10&x=520&y=283&height=570&width=1040&info_format=application%2Fvnd.ogc.gml&cql_filter=IDN_USER%3D'ROOT<http://192.168.11.159:8090/geoserver/wms?service=WMS&version=1.1.0&request=GetFeatureInfo&layers=osmius%3Ausuarios_instancias,osmius%3Ausuarios_servicios&query_layers=osmius%3Ausuarios_instancias,osmius%3Ausuarios_servicios&styles=,&bbox=-403214.87876%2C4928941.444487%2C-393278.065085%2C4934387.582751&srs=EPSG%3A900913&feature_count=10&x=520&y=283&height=570&width=1040&info_format=application%2Fvnd.ogc.gml&cql_filter=IDN_USER%3D%27ROOT>
'
IE:
http://192.168.11.159:8090/geoserver/wms?service=WMS&version=1.1.0&request=GetFeatureInfo&layers=osmius%3Ausuarios_instancias,osmius%3Ausuarios_servicios&query_layers=osmius%3Ausuarios_instancias,osmius%3Ausuarios_servicios&styles=,&bbox=-403195.769503%2C4928941.444487%2C-393297.174342%2C4934387.582751&srs=EPSG%3A900913&feature_count=10&x=504&y=283&height=570&width=1036&info_format=application%2Fvnd.ogc.gml&cql_filter=IDN_USER%3D'ROOT<http://192.168.11.159:8090/geoserver/wms?service=WMS&version=1.1.0&request=GetFeatureInfo&layers=osmius%3Ausuarios_instancias,osmius%3Ausuarios_servicios&query_layers=osmius%3Ausuarios_instancias,osmius%3Ausuarios_servicios&styles=,&bbox=-403195.769503%2C4928941.444487%2C-393297.174342%2C4934387.582751&srs=EPSG%3A900913&feature_count=10&x=504&y=283&height=570&width=1036&info_format=application%2Fvnd.ogc.gml&cql_filter=IDN_USER%3D%27ROOT>
'





2009/9/3 Micho Gar <michogar at gmail.com>

> Here the control creation and activation in the init
>
> ...
>     infoControls = {
>             clickInstance: new OpenLayers.Control.WMSGetFeatureInfo({
>                 url: context + '/geoserver/wms',
>                 title: 'Identifica las features por click',
>                 infoFormat: 'application/vnd.ogc.gml',
>                 layers: [Instancias,Servicios],
>                 queryVisible: true,
>                 vendorParams:{ cql_filter: "IDN_USER='" + user + "'"}
>             })
>     };
>
>     map.addLayers([Instancias,Servicios,MapnikLayer,OSMLayer]);
>
>     infoControls['clickInstance'].events.register("getfeatureinfo", this,
> getObject);
>     map.addControl(infoControls['clickInstance']);
>     infoControls['clickInstance'].activate();
>
>     map.addControl(new OpenLayers.Control.Navigation());
>     map.addControl(new OpenLayers.Control.PanPanel());
>     map.addControl(new OpenLayers.Control.ZoomPanel());
>     var layerSwitcher = new OpenLayers.Control.LayerSwitcher();
>     layerSwitcher.activeColor='#E3F6CE';
>     map.addControl(layerSwitcher);
>     map.addControl(new OpenLayers.Control.Scale);
>     map.addControl(new OpenLayers.Control.MousePosition);
>
> ...
>
> and here the method is execute by control
>
> function getObject(evt){
>     /*
>      *
>      */
>
>      g = new OpenLayers.Format.WMSGetFeatureInfo();
>      var features = g.read(evt.text);
>      if (features.length==0) return;
>
>      if (features.length>1){
>          if (repeats(features)==false){
>              alert(msgOverObject);
>              return;
>          }
>      }
>
>      var idFeature=features[0].attributes['IDN_INSTANCE'];
>      if (idFeature!=null){
>         xyInfo = evt.xy;
>         idObject=idFeature;
>
>         var _url = context +
> "/geoserver/wfs?VERSION=1.1.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAME=instancias_informacion&Filter=<Filter><PropertyIsEqualTo><PropertyName>IDN_INSTANCE</PropertyName><Literal>"
> + idFeature + "</Literal></PropertyIsEqualTo></Filter>";
>         OpenLayers.loadURL(_url, "", null, showInstanceInfo, isError);
>      }else{
>          var idService=features[0].attributes['IDN_SERVICE'];
>          xyInfo= (new
> OpenLayers.LonLat(features[0].geometry.x,features[0].geometry.y)).transform(proj4326,proj900913);
>          idObject=idService;
>
>         var _url = context +
> "/geoserver/wfs?VERSION=1.1.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAME=usuarios_instancias&Filter=<Filter><And><PropertyIsEqualTo><PropertyName>IDN_SERVICE</PropertyName><Literal>"
> + idService +
> "</Literal></PropertyIsEqualTo><PropertyIsEqualTo><PropertyName>IDN_USER</PropertyName><Literal>"
> + user + "</Literal></PropertyIsEqualTo></And></Filter>";
>         OpenLayers.loadURL(_url, "", null, showServiceInstance, isError);
>
>      }
>
> }
>
> the evt param in the getObject method is empty in IE.
>
>
> Thanks to all.
>
>
> 2009/9/2 Eric Lemoine <eric.lemoine at camptocamp.com>
>
> On Wed, Sep 2, 2009 at 7:13 PM, Micho Gar<michogar at gmail.com> wrote:
>> > Hi all,
>> >
>> > I have a code to realise a GetFeatureInfo and runs well on Firefox but
>> not
>> > return any result in IE. Reading the documentation I have not seen
>> nothing
>> > about this. I think it work the same for both.
>> >
>> > Something about this??
>>
>> Some code to show the list?
>>
>>
>> --
>> Eric Lemoine
>>
>> Camptocamp France SAS
>> Savoie Technolac, BP 352
>> 73377 Le Bourget du Lac, Cedex
>>
>> Tel : 00 33 4 79 44 44 96
>> Mail : eric.lemoine at camptocamp.com
>> http://www.camptocamp.com
>>
>
>
>
> --
> # michogar
> # Analista Programador SIG
> # GNU/Linux Counter 462666
> # http://www.openstreetmap.org/user/michogar
>
> Una visión personal:
> http://michogar.wordpress.com
>
> El día a día:
> http://twitter.com/michogar
>
>
>
>


-- 
# michogar
# Analista Programador SIG
# GNU/Linux Counter 462666
# http://www.openstreetmap.org/user/michogar

Una visión personal:
http://michogar.wordpress.com

El día a día:
http://twitter.com/michogar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090903/a24e2459/attachment.html


More information about the Users mailing list