[OpenLayers-Users] new state for features - 'viewed'

Brian Busch bdbuschg at gmail.com
Thu Aug 8 15:44:48 PDT 2013


wow -- that worked. by adding a new style keyed by 'viewed', all I had to
do in my select feature code was:

f.renderIntent = 'viewed';
f.layer.drawFeature(f, 'viewed');

and it now is that state.

-bdb



On Thu, Aug 8, 2013 at 6:18 PM, Brian Busch <bdbuschg at gmail.com> wrote:

> I'm trying something just like that now -- adding a new 'renderIntent'
> like:
>
>        var selectStyle = style.clone();
>         if (options.iconOptions &&
> options.iconOptions.selectedExternalGraphic) {
>             selectStyle.context.externalGraphic = function (feature) {
>                 if (!feature.cluster) {
>                     return
> feature.layer.iconOptions.selectedExternalGraphic;
>                 }
>                 return "";
>             };
>         }
>         selectStyle.defaultStyle.strokeColor = '#33ffff';
>         selectStyle.defaultStyle.strokeWidth = 4;
>
> var viewedStyle = style.clone();
>         if (options.iconOptions &&
> options.iconOptions.viewedExternalGraphic) {
>             viewedStyle.context.externalGraphic = function (feature) {
>                 if (!feature.cluster) {
>                     return feature.layer.iconOptions.viewedExternalGraphic;
>                 }
>                 return "";
>             };
>         }
>         viewedStyle.defaultStyle.strokeColor = '#33ffff';
>         viewedStyle.defaultStyle.strokeWidth = 4;
>         var styleMap = new OpenLayers.StyleMap({ "default": style,
> 'select': selectStyle, "viewed": viewedStyle });
>
> and hoping to just set feature.renderIntent in the click event handler
> (then call layer.drawFeature(feature, renderIntent). I'm very new to OL.
>
> Thanks!
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130808/72a07354/attachment.html>


More information about the Users mailing list