[OpenLayers-Users] Center fo a line geometry? click event...

paweluz paweluz at o2.pl
Mon Jan 18 04:22:49 EST 2010


Hi

I have a problem with openlayers. I Have a roads on my map that are serve by
WFS. I used function onFeatureSelect(feature) to get to the attributes of
this geometry. I show them in a popup menu. The problem is shown on the
screen below.

http://zapodaj.net/1574e8d9d73c.jpg.html

The blue arrow shows the place where I clicked. I want to show popup menu in
the place when I click , not in the center of geometry. This may work with
point geometry but not in line geometry. The click example i took from the
openlayers example page:http://openlayers.org/dev/examples/click.html My
popup menu looks like this:

            popup = new OpenLayers.Popup.FramedCloud("chicken", 
                                    
feature.geometry.getBounds().getCenterLonLat(),
                                     new OpenLayers.Size(200,200),
                                     "<div style='font-size:.8em'>Feature: "
+ selectedFeature.attributes['shapeid'] +"<br />Area: " +
selectedFeature.attributes['shapename']+"</div>",
                                     null, true, onPopupClose);


When I have both onFeatureSelect and click it does not work. Does anyone
have an idea how to place popup menu in place where I clicked on a line
geometry????

Regards,
Poul

-- 
View this message in context: http://n2.nabble.com/Center-fo-a-line-geometry-click-event-tp4412669p4412669.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list