How do I tell whether an OL3 feature is a point, line, or polygon? I need to highlight features on mouseover, and the style required is different for points, so I need to be able to tell which geometry type a feature is, so that I can apply the correct style.

2 Answers 2


Found it: feature.getGeometry().getType()


This is the link to the official documentation of OL3 API for getType(). Its not available in the list of functions defined for Geometry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.