# \donttest{
#Example 1: 'auto' mode
#label ASDs in bold and red
ASDs=load_ASDs()
plot(st_geometry(ASDs))
add_labels(mode='auto',layer='ASDs',fontsize=1,fonttype=2,col='red')
#add EEZs and their labels in large, green and vertical text
EEZs=load_EEZs()
plot(st_geometry(EEZs),add=TRUE,border='green')
add_labels(mode='auto',layer='EEZs',fontsize=2,col='green',angle=90)
#Example 2: 'manual' mode (you will have to do it yourself)
#Examples 2 and 3 below are commented (remove the # to test)
#library(terra)
#plot(SmallBathy())
#ASDs=load_ASDs()
#plot(st_geometry(ASDs),add=TRUE)
#MyLabels=add_labels(mode='manual')
#Example 3: Re-use the label table generated in Example 2
#plot(SmallBathy())
#plot(st_geometry(ASDs),add=TRUE)
#add_labels(mode='input',LabelTable=MyLabels)
# }
Run the code above in your browser using DataLab