Checking whether layer is vector or not in OpenLayers 2? Simply test the javascript instanceof operator against OpenLayers.Layer.Vector or Vector