If you work with features coming from wfs, gml, kml, etc., then you can
register 'featureselected' for the vector layer.
If the source of the features have an attribute with the specific url, you
can retrieve the url from the feature and execute your function.
var aktLayer = 1; //index of a vectorlayer
map.layers[aktLayer].events.register('featureselected',
map.layers[aktLayer], regFeatureSelected);
function regFeatureSelected()
{
var objF = this.selectedFeatures[0];
theUrl = objF.attributes['name'] ? objF.attributes['name'] :
"http://www.google.de";
window.open(theUrl);
}
Arnd Wippermann
-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im
Auftrag von darrepac
Gesendet: Dienstag, 14. Oktober 2008 17:45
An: [email protected]
Betreff: [OpenLayers-Users] Best strategy to add many clickable rectangle
areas?
Hello,
New to openlayers, I am starting to put my hands on it. I have seen how
powerful openlayers is, which also make feel a little bit lost in front of
so much and deep functionalities. I require your experience to oriente me in
the things I am trying to do.
I would like to have many rectangles area (about 100) which will delimit
some geographical area and which will be clickable by the user to activate
dedicate and specific URL (the rectangle could only be a box or a
semi-transparent filled color).
I don't know what is the best system for doing so. So far I have seen the
boxes example (but also a non answered question related to my needs here:
http://www.nabble.com/Box-Click-Event-to13782689.html), I have seen that we
can overlayed GML where you can define rectangle (but not sure if we can
assign unique URL for each one?)... may-be other solution?
Thanks for your thoughts.
--
View this message in context:
http://www.nabble.com/Best-strategy-to-add-many-clickable-rectangle-areas--t
p19975759p19975759.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users