instanceof check to avoid ducktyping

This commit is contained in:
ahocevar
2013-08-30 23:18:17 +02:00
parent 9dfbfab648
commit cbf7f91cfb

View File

@@ -101,7 +101,7 @@ ol.interaction.Select.prototype.select =
if (!goog.isDef(selectionLayer)) {
selectionLayer = new ol.layer.Vector({
source: new ol.source.Vector({parser: null}),
style: goog.isFunction(layer.getStyle) ? layer.getStyle() : null
style: layer instanceof ol.layer.Vector ? layer.getStyle() : null
});
selectionLayer.setTemporary(true);
map.addLayer(selectionLayer);