If you want to guarantee optimal performance for your application, take the following guidelines into account when you activate labeling:

  • Do not create new label and text style JavaScript object literals in the paintLabel method of your feature painter. Instead, create the required style objects once, and store them as instance variables.

  • Drawing many rotated labels on a path can slow down the application. To increase performance, disable label rotation.

  • When a label is being positioned on the map, each allowed position is considered as a possible candidate for placing the label.

    This means that each allowed position will be checked until a valid, non-overlapping, position is found. If there are many labels, resulting in significant decluttering, the requirement to check multiple positions per label can slow down your application.

    You can prevent this by limiting the number of allowed positions.