Xojo Conferences
MBSOct2019CologneDE

Platforms to show: All Mac Windows Linux Cross-Platform

MKOverlayRendererMBS.canDrawMapRect(Rect as MKMapRectMBS, zoomScale as Double) as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 19.0 Yes No No Yes, macOS only No
Function: Returns a Boolean value indicating whether the overlay view is ready to draw its content.
Notes:
mapRect: The map rectangle that needs to be updated.
zoomScale: The current scale factor applied to the map.

Returns true if this overlay renderer is ready to draw its contents on the map or false if it is not.

Overlay renderers can override this method in situations where they may depend on the availability of other information to draw their contents. For example, a renderer showing traffic information might want to delay drawing until it has all of the traffic data it needs. In such a case, it can return NO from this method to indicate that it is not ready. An overlay renderer might also return NO if it does not draw content in the specified rectangle.

If you return NO from this method, your application is responsible for calling the setNeedsDisplayInMapRect method when the overlay renderer subsequently becomes ready to draw its contents.
The default implementation of this method returns true.

Feedback, Comments & Corrections

MKOverlayRendererMBS.Constructor(overlay as MKOverlayMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 19.0 Yes No No Yes, macOS only No
Function: Initializes and returns the overlay renderer and associates it with the specified overlay object.
Notes:
overlay: The overlay object to use when drawing the overlay content on the map. This object provides the data needed to draw the overlay’s shape. The overlay renderer stores a strong reference to this object.
Return Value

Initially, the overlay renderer assumes that the overlay is fully opaque and that it has a content scale factor of 1.0. You can change these values as needed using the alpha and contentScaleFactor properties.

Feedback, Comments & Corrections

MKOverlayRendererMBS.drawMapRect(Rect as MKMapRectMBS, zoomScale as Double, context as CGContextMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 19.0 Yes No No Yes, macOS only No
Function: Draws the overlay’s contents at the specified location on the map.
Notes:
mapRect: The map rectangle that needs to be updated. Your drawing code should avoid drawing outside of this rectangle.
zoomScale: The current zoom factor applied to the map content. You can use this value for configuring the stroke width of lines or other attributes that might be affected by the scale of the map’s contents.
context: The graphics context to use for drawing the overlay’s contents.

The default implementation of this method does nothing. Subclasses are expected to override this method and use it to draw the overlay’s contents.

When determining where to draw content, make your initial calculations relative to the map itself. In other words, compute the position and size of any overlay content using map points and map rectangles, convert those values to regular CGPoint and CGRect types using the methods of this class, and then pass the converted points to any drawing primitives.
It is recommended that you use Core Graphics to draw any content for your overlays.

To improve drawing performance, the map view may divide your overlay into multiple tiles and render each one on a separate thread. Your implementation of this method must therefore be capable of safely running from multiple threads simultaneously. In addition, you should avoid drawing the entire contents of the overlay each time this method is called. Instead, always take the mapRect parameter into consideration and avoid drawing content outside that rectangle.

Feedback, Comments & Corrections

MKOverlayRendererMBS.mapPointForPoint(point as CGPointMBS) as MKMapPointMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 19.0 Yes No No Yes, macOS only No
Function: Returns the point on the map that corresponds to the specified point in the overlay renderer’s drawing area.
Notes:
point: The point in the overlay’s drawing area that you want to convert.
Returns the point on the two-dimensional map projection corresponding to the specified point.

Feedback, Comments & Corrections

MKOverlayRendererMBS.mapRectForRect(Rect as CGRectMBS) as MKMapRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 19.0 Yes No No Yes, macOS only No
Function: Returns the rectangle on the map that corresponds to the specified rectangle in the overlay renderer’s drawing area.
Notes:
rect: The rectangle in the overlay’s drawing area that you want to convert.

Returns the rectangle on the two-dimensional map projection corresponding to the specified rectangle.

Feedback, Comments & Corrections

MKOverlayRendererMBS.pointForMapPoint(mapRect as MKMapPointMBS) as CGPointMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 19.0 Yes No No Yes, macOS only No
Function: Returns the point in the overlay renderer’s drawing area corresponding to the specified point on the map.
Notes:
mapPoint: A point on the two-dimensional map projection. If you have a coordinate value (latitude and longitude), you can use the MKMapPointForCoordinate function to convert that coordinate to a map point.

Returns the point in the overlay’s drawing area that corresponds to the map point.

Feedback, Comments & Corrections

MKOverlayRendererMBS.RectForMapRect(mapRect as MKMapRectMBS) as CGRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 19.0 Yes No No Yes, macOS only No
Function: Returns the rectangle in the overlay renderer’s drawing area corresponding to the specified rectangle on the map.
Notes:
mapRect: A rectangle on the two-dimensional map projection.

Returns the rectangle in the overlay’s drawing area that corresponds to the map rectangle.

Feedback, Comments & Corrections

MKOverlayRendererMBS.setNeedsDisplay
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 19.0 Yes No No Yes, macOS only No
Function: Invalidates the entire contents of the overlay for all zoom scales.
Notes: This method causes the entire contents of the overlay to be redrawn during the next update cycle. This method invalidates the overlay regardless of the current zoom scale associated with the map.

Feedback, Comments & Corrections

MKOverlayRendererMBS.setNeedsDisplayInMapRect(mapRect as MKMapRectMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 19.0 Yes No No Yes, macOS only No
Function: Invalidates the specified portion of the overlay at all zoom scales.
Notes:
mapRect: The portion of the overlay to update. Specify this value using a map coordinates.

Marking a rectangle as invalid causes that portion of the overlay to be redrawn during the next update cycle. This method invalidates the overlay regardless of the current zoom scale associated with the map.

See also:

Feedback, Comments & Corrections

MKOverlayRendererMBS.setNeedsDisplayInMapRect(mapRect as MKMapRectMBS, zoomScale as double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 19.0 Yes No No Yes, macOS only No
Function: Invalidates the specified portion of the overlay but only at the specified zoom scale.
Notes:
mapRect: The portion of the overlay to update. Specify this value using a map coordinates.
zoomScale: The zoom scale for which you want to invalidate the overlay.

Marking a rectangle as invalid causes that portion of the overlay to be redrawn during the next update cycle. This method invalidates the overlay only at the specified zoom scale.

See also:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacFrameworks Plugin.

The biggest plugin in space...




Links
MBS Xojo Plugins