[OpenLayers-Dev] Control.SelectFeature.select and feature.originalStyle

Christopher Schmidt crschmidt at metacarta.com
Tue Jan 22 08:49:31 EST 2008


On Tue, Jan 22, 2008 at 02:47:06PM +0100, Andreas Hocevar wrote:
> Hi,
> 
> I wonder if there is a reason (other than to make 
> test_SelectFeature.html work) why we change feature.style in the select 
> and unselect methods of Control.SelectFeature.  Wouldn't it be 
> sufficient to call layer.drawFeature with the optional second style 
> parameter?  What am I missing here?

When you zoom the map, the redraw of the feature is performed without
any knowledge of the current feature style: drawFeature is called again
by the renderer in a case which is out of the control of the
SelectFeature control.

It's possible we could modify the code to not adjust the style
properties when changing the zoom. (I think?) But it would be a
modification to the current code. (I think.)

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Dev mailing list