Interface IIconPainter
Image.
 This class can be used on any thread, so its implementation must be thread-safe.
Performance considerations: to make sure the rendering backend can avoid as much work as possible
- IIconPainter#paintmust be as performant as possible. This can for example be done by implementing this function lazily, i.e. avoid generating the image in the constructor of the- IIconPainterimplementation.
- The same goes for the getWidth/getHeight, getAnchorX/getAnchorY methods. If possible, make these as performant as possible. If there is a more performant way to calculate these without painting the image, that is preferred. The reason is that the rendering backend might need these properties to determine if an icon should effectively be visible or not on theMap.
- 
Method SummaryModifier and TypeMethodDescriptiondoubleReturns thexcoordinate of the anchor point in pixels.doubleReturns theycoordinate of the anchor point in pixels.doubleReturns the display scale for which this painter is optimized.longReturns the height of this icon.longgetWidth()Returns the width of this icon.paint()Paints theIIconas an image.
- 
Method Details- 
paint- Returns:
- the image of this icon, never null.
 
- 
getWidthlong getWidth()Returns the width of this icon.I.e. the width of the Imagethat is returned byIIconPainter#paint.- Remarks
- This method may be invoked from different threads.
 - Returns:
- the width of this icon.
 
- 
getHeightlong getHeight()Returns the height of this icon.I.e. the height of the Imagethat is returned byIIconPainter#paint- Remarks
- This method may be invoked from different threads.
 - Returns:
- the height of this icon.
 
- 
getAnchorXdouble getAnchorX()Returns thexcoordinate of the anchor point in pixels.The anchor point is the location of the icon that (by default) is attached to another object, e.g. a location on the map. This must be a value in the [0,range. A good default implementation is to returngetWidth()]getWidth()/ 2.0.- Remarks
- This method may be invoked from different threads.
 - Returns:
- the x coordinate of the anchor point in pixels.
 
- 
getAnchorYdouble getAnchorY()Returns theycoordinate of the anchor point in pixels.The anchor point is the location of the icon that (by default) is attached to another object, e.g. a location on the map. This must be a value in the [0,range. A good default implementation is to returngetHeight()]getHeight()/ 2.0.- Remarks
- This method may be invoked from different threads.
 - Returns:
- the y coordinate of the anchor point in pixels.
 
- 
getDisplayScaledouble getDisplayScale()Returns the display scale for which this painter is optimized.This is not necessarily the same display as the one that was used to create this painter. Some icons may only have a limited number scaled versions of their icon available. This method can then be used by the rendering backend to discover this, and to paint it at the intended size. - Remarks
- This method may be invoked from different threads.
 - Returns:
- the display scale for which this painter is optimized.
 
 
-