I am trying to get a tooltip like effect on top of many WMS layers when
hovering over the layer so that it can display featureinfo. I have briefly
experimented with the WMSGetFeatureInfo and a click event /info object but
should I use this for a hover event as well? I need to display data from
many layers (sometimes over 20) as mouseovers and click so is this the best
method or is there any other faster way such as straight SQL queries over a
WMS feature? If there isn't that much overhead on a hover event of the
WMSGetFeatureInfo and I can indeed use this to display info from over 20
layers at the same time without speed issues can someone point me to an
example of being able to use the hover delay but having the previous popup
close so that only one displays at a time? My tooltip control was displayed
like the following except it does not close the other window when a new one
shows which is what I need. Also there seems to be an issue with my layer as
I have defined max feature as 1 but I still see all features coming from my
layer.. this is because I have grouped my layer with many individual
layers.. can these be pulled out somehow to make specific ones for them?
Appreciate any advice on the best way to do this to accomplish tooltips for
features.
//Define hotspot
info = new OpenLayers.Control.WMSGetFeatureInfo({
url: 'http://localhost/WebServices/Request.aspx',
title: 'Identify features by clicking',
queryVisible: false,
infoFormat: 'text/html',
layers: [layer_Base],
maxFeatures: 1,
hover:true
});
info.events.on({
getfeatureinfo: function(e) {
infopop = new GeoExt.Popup({ //utilizing the GeoExt popup
functionality
title: "Hotspot Information",
autoheight: true,
width: 300,
autoScroll: true,
panIn: false,
map: map,
lonlat: map.getLonLatFromPixel(e.xy),
html: e.text
})
infopop.show();
etext = e.text;
if (etext.length == 146)
{
infopop.close();
}
}});
// Base Group Layers
var layer_Base = new OpenLayers.Layer.WMS("Base",
"http://localhost/WebServices/Request.aspx",
{
layers: ['Rural_Lot_Line', 'Rural_Block_Line',
'Section_Lines', 'School_Sites', 'Linear_Parks', 'Recreation_Sites',
'Neighbourhood_Parks', 'Major_Parks', 'Neighbourhood_Boundary',
'Neighbourhood_Area__clear_', 'Hydrology', 'City_Boundary',
'Street_Secondary_Segment', 'Street_Segment', 'Arterial', 'Highway',
'Rural_Highway', 'Bridge'],
VERSION: "1.1.1",
transparent: true
},
{ isBaseLayer: false,
singleTile: true,
visibility: false,
buffer: 1,
ratio: 1
}
);
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Question-on-using-WMSGetFeatureInfo-as-tooltips-for-over-20-layers-practical-tp5823297p5823297.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users