Markers are the fundamental building blocks of annotations in marker.js 3. They define both the visual appearance and styling options for annotation elements that users can add to images.
Markers represent different types of visual annotations like:
Each marker type defines:
Markers in marker.js 3 follow a hierarchical structure starting with (abstract) base marker classes that provide common functionality:
marker.js 3 includes these built-in marker types for common annotation needs:
User-driven marker creation is initiated in the MarkerArea editor component. To create a new marker, use the createMarker() method and specify the marker type:
markerArea.createMarker(ArrowMarker);
// or
markerArea.createMarker('ArrowMarker');
Each marker maintains its own state including:
The marker states are included in the overall annotation state when saving/restoring annotations.
Markers are part of the Core module in marker.js 3 since they are used by all main components:
When none of the built-in markers satisfy your needs you may want to create a custom marker. The marker should be a descendant of MarkerBase (quite likely one of the base classes above is a better candidate to inherit) and should be able to generate its visual as well as provide and restore its state.
For mor information on creating custom markers please check this tutorial.