[OpenLayers-Dev] Control.SelectFeature.select and
feature.originalStyle
Andreas Hocevar
andreas.hocevar at gmail.com
Tue Jan 22 09:00:57 EST 2008
Christopher Schmidt wrote:
> On Tue, Jan 22, 2008 at 02:47:06PM +0100, Andreas Hocevar wrote:
>
>> 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.
>
Oh, I understand. That makes sense. Thanks!
> 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.)
>
If we want to change the whole vector styling to be based on rendering
intents, we should probably think about that. A feature could have a
renderIntent property and a hash of style objects (or style hashes),
keyed with the render intent names. Whoever wants to control how the
feature should look, would then change this renderIntent property
instead of feature.style.
Regards,
Andreas.
More information about the Dev
mailing list