[OpenLayers-Users] new state for features - 'viewed'
Brian Busch
bdbuschg at gmail.com
Thu Aug 8 15:18:05 PDT 2013
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/5a3a8905/attachment.html>
More information about the Users
mailing list