[OpenLayers-Users] ModifyFeature with SelectFeature hover/highlight type capability

Phil Scadden p.scadden at gns.cri.nz
Mon May 10 22:21:28 EDT 2010


The key bits from example are:
                        kmlHoverSelectControl = new 
OpenLayers.Control.SelectFeature(kmlLayers,{hover:true, highlightOnly: 
true, renderIntent: "temporary" });
                        kmlSelectControl = new 
OpenLayers.Control.SelectFeature(kmlLayers,{clickout: true});
                        kmlSelectControl.events.on({
                                 "featurehighlighted": onKmlFeatureSelect,
                                 "featureunhighlighted": 
onKmlFeatureUnselect
                        });
                        map.addControl(kmlHoverSelectControl);
                        map.addControl(kmlSelectControl);
                        kmlHoverSelectControl.activate();
                        kmlSelectControl.activate();
kmlLayers is array of layers (in this case kml). Order matters. 
HoverSelect control , the SelectControl.

With this, I highlight features as you mouse over, then select on click.

-- 
Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St, 
Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232

Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.




More information about the Users mailing list