[OpenLayers-Users] Highlight on hover

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Fri Sep 4 10:24:07 EDT 2009


I got this in the response <gml:Box srsName="EPSG:900913">
which is the same as the map projection.

I forgot to say that even if the feature is added to the vector layer I 
get this message in line 724 of OpenLayers.js
xmldom.loadXML(text);return xmldom;}),this),function(){return new 
DOMParser().parseFromString(text,'text/xml');},function(){var req=new 
XMLHttpRequest();req.open("GET","data:"+"text/xml"+";charset=utf-8,"+encodeURIComponent(text),false);if(req.overrideMimeType){req.overrideMimeType("text/xml");} 


I click on Continue button and then the features are added.
Steve

Steve Toutant, M. Sc.
Analyste en géomatique
Secteur environnement
Direction des risques biologiques, environnementaux et occupationnels
Institut national de santé publique du Québec
945, avenue Wolfe
Québec, Qc G1V 5B3 
Tél.: (418) 650-5115 #5281
Fax.: (418) 654-3144
steve.toutant at inspq.qc.ca
http://www.inspq.qc.ca
 




François Van Der Biest 
<francois.vanderbiest at camptocamp.com>@openlayers.org 
Envoyé par : users-bounces at openlayers.org
04/09/2009 10:13 AM

A
Steve.Toutant at inspq.qc.ca
cc
users at openlayers.org
Objet
Re: [OpenLayers-Users] Highlight on hover








Hi Steve.

A potential reason is that the GML you're receiving does not use the
same SRS as the one of your map.
You may check this using FireBug.

I know GeoServer does not handle reprojecting features returned by WMS
getFeatureInfo.

Cheers,
F.


On Fri, Sep 4, 2009 at 3:52 PM, <Steve.Toutant at inspq.qc.ca> wrote:
>
> Hello,
> With the code below, a GetFeatureInfo request is succesfully launched to
> mapserver when I stop moving the mouse. In firebug I see the XML 
response
> with the msGMLOutput tag.
> I can see that the highlightLayer has feature added to it but I don't 
see
> them on the map. Like there is no geometry.
> What could be the reasons for that please? Is there some params missing?
>
> Thanks
> Steve
>
> var highlight_style = { fillColor:'#99CCFF', strokeColor:'#3399FF',
> fillOpacity:0.7 };
> highlightLayer = new OpenLayers.Layer.Vector("HighlightedFeatures",
> {displayInLayerSwitcher: false, features:[], isBaseLayer: false,
> visibility:true, style:highlight_style});
>
> infoControls =
> {
>                    hover: new OpenLayers.Control.WMSGetFeatureInfo
>                 ({
>                 title: 'Identify features by clicking',
>                 layers: [overlays['national_2006']],
>                 hover: true,
>                 queryVisible: true
>                 ,infoFormat:'application/vnd.ogc.gml'
>                 })
> }
> // add layers to the map
> addLayersToMap();
>
> for (var i in infoControls)
> {
>         infoControls[i].events.register("getfeatureinfo", this, 
showInfo);
>         map.addControl(infoControls[i]);
>         infoControls[i].activate();
> }
>
> function showInfo(evt)
> {
>         if (evt.features && evt.features.length)
>         {
>                  highlightLayer.destroyFeatures();
>                  highlightLayer.addFeatures(evt.features);
>                  highlightLayer.redraw();
>         }
> }
>
>
> Steve Toutant, M. Sc.
> Analyste en géomatique
> Secteur environnement
> Direction des risques biologiques, environnementaux et occupationnels
> Institut national de santé publique du Québec
> 945, avenue Wolfe
> Québec, Qc G1V 5B3
>
> Tél.: (418) 650-5115 #5281
> Fax.: (418) 654-3144
> steve.toutant at inspq.qc.ca
> http://www.inspq.qc.ca
>
>
>
> _______________________________________________
> 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



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090904/e1b1a949/attachment.html


More information about the Users mailing list