[OpenLayers-Users] Launch a Popup for a Polygon object

Arnd Wippermann arnd.wippermann at web.de
Mon Oct 6 13:28:38 EDT 2008


Perhaps you have your control not activated

yourSelectControl = new OpenLayers.Control.SelectFeature(polygonLayer,
                {onSelect: onFeatureSelect, onUnselect: onFeatureUnselect});

yourSelectControl.activate();

Arnd Wippermann

-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Transmatrix
Gesendet: Montag, 6. Oktober 2008 18:22
An: users at openlayers.org
Betreff: Re: [OpenLayers-Users] Launch a Popup for a Polygon object


This has sent me down the right path, but I'm still lost.  I am trying to
modify this script to work for a polygon that was already drawn, and doesn't
require the radio buttons.

I tried just adding this to my script:
map.addControl(new OpenLayers.Control.SelectFeature(polygonLayer,
                {onSelect: onFeatureSelect, onUnselect:
onFeatureUnselect}));

Along with the onPopupClose, onFeatureSelect, and and onFeatureUnselect
functions, but nothing happens when I click on the polygon. I tried just
changing it to: 

map.addControl(new OpenLayers.Control.SelectFeature(polygonLayer,
                {onSelect: alert("popup test")}));

However, the alert shows up when the page loads, and not when I click on the
polygon...



Arnd Wippermann wrote:
> 
> Hi, try this
> http://openlayers.org/dev/examples/select-feature-openpopup.html
> 
> Arnd Wippermann
> 
--
View this message in context:
http://www.nabble.com/Launch-a-Popup-for-a-Polygon-object-tp19807459p1984122
4.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list