Xojo Conferences
MBSOct2019CologneDE

Platforms to show: All Mac Windows Linux Cross-Platform

Next items

MKMapViewMBS.addAnnotation(annotation as MKAnnotationMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Adds the specified annotation to the map view.
Example:
dim mapview as MKMapViewMBS // your map view

// new pin
dim pin as new MKPointAnnotationMBS

pin.coordinate = mapView.centerCoordinate
pin.title = "Hello"

// show on map
mapView.addAnnotation pin

Feedback, Comments & Corrections

MKMapViewMBS.addAnnotations(annotations() as MKAnnotationMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Adds an array of annotation objects to the map view.

Feedback, Comments & Corrections

MKMapViewMBS.addOverlay(overlay as MKOverlayMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Adds a single overlay object to the map.
Example:
dim mapview as MKMapViewMBS // your map view
dim centerCoordinate as CLLocationCoordinate2DMBS = mapview.centerCoordinate
dim radius as Integer = 300 // 300 meter

dim circle as MKCircleMBS = MKCircleMBS.circleWithCenterCoordinate(centerCoordinate, radius)
mapview.addOverlay circle
Notes:
overlay: The overlay object to add. This object must conform to the MKOverlayMBS interface.

The specified object is added to the group of overlay objects in the MKOverlayLevelAboveLabels level. Adding an overlay causes the map view to begin monitoring the area represented by that overlay. As soon as the bounding rectangle of an overlay intersects the visible portion of the map, the map view adds a corresponding overlay view to the map. The overlay view is provided by the mapViewViewForOverlay event.

To remove an overlay from a map, use the removeOverlay method.

See also:

Feedback, Comments & Corrections

MKMapViewMBS.addOverlay(overlay as MKOverlayMBS, level as integer)
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: Adds the overlay object to the map at the specified level.
Notes:
overlay: The overlay object to add. This object must conform to the MKOverlayMBS interface.
level: The map level at which to place the overlay. For a list of possible values for this parameter, see level constants.

Positioning an overlay at a specific level places that overlay’s visual representation in front of or behind other map content such as map labels and point-of-interest icons.
This method adds the specified overlay to the end of the list of overlay objects at the given level. Adding an overlay also causes the map view to begin monitoring the area they represent. As soon as the bounding rectangle of the overlay intersects the visible portion of the map, the map view calls your rendererForOverlay event to get the renderer object to use when drawing the overlay.
To remove an overlay from a map, use the removeOverlay: method.

See also:

Feedback, Comments & Corrections

MKMapViewMBS.addOverlays(overlays() as MKOverlayMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Adds an array of overlay objects to the map.
Notes:
overlays: An array of objects, each of which must conform to the MKOverlayMBS interface.

The specified objects are added to the group of overlay objects in the MKOverlayLevelAboveLabels level. Adding an overlay causes the map view to begin monitoring the area represented by that overlay. As soon as the bounding rectangle of the overlay intersects the visible portion of the map, the map view tries to draw the overlay. As soon as the bounding rectangle of an overlay intersects the visible portion of the map, the map view adds a corresponding overlay view to the map. The overlay view is provided by the mapViewViewForOverlay method of the map view's delegate object.

To remove multiple overlays from a map, use the removeOverlays method.

See also:

Feedback, Comments & Corrections

MKMapViewMBS.addOverlays(overlays() as MKOverlayMBS, level as integer)
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: Adds an array of overlay objects to the map at the specified level.
Notes:
overlays: The array of overlay objects to add. Each object in the array must conform to the MKOverlayMBS interface.
level: The map level at which to place the overlays. For a list of possible values for this parameter, see MKOverlayLevel.

Positioning an overlay at a specific level places that overlay’s visual representation in front of or behind other map content such as map labels and point-of-interest icons.

This method adds the specified overlays to the end of the list of overlay objects at the given level. Adding the overlays also causes the map view to begin monitoring the area they represent. As soon as the bounding rectangle of an overlay intersects the visible portion of the map, the map view calls your rendererForOverlay event to get the renderer object to use when drawing that overlay.

To remove multiple overlays from a map, use the removeOverlays method.

See also:

Feedback, Comments & Corrections

MKMapViewMBS.annotations as MKAnnotationMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: The complete list of annotations associated with the receiver.
Notes: If no annotations are associated with the map view, the value of this property is empty.

Feedback, Comments & Corrections

MKMapViewMBS.annotationsInMapRect(mapRect as MKMapRectMBS) as MKAnnotationMBS()
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 annotation objects located in the specified map rectangle.
Notes:
mapRect: The portion of the map that you want to search for annotations.

Returns the array of annotation objects located in mapRect.

This method offers a fast way to retrieve the annotation objects in a particular portion of the map. This method is much faster than doing a linear search of the objects in the annotations property yourself.

Feedback, Comments & Corrections

MKMapViewMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Creates a new box view with size 100/100 and position 0/0
Example:
dim x as new MKMapViewMBS
Notes: On success the handle property is not zero.

See also:

Feedback, Comments & Corrections

MKMapViewMBS.Constructor(Handle as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Creates an object based on the given NSView handle.
Example:
dim t as new MKMapViewMBS(0, 0, 100, 100)
dim v as new MKMapViewMBS(t.handle)

MsgBox str(v.Bounds.Width)+" x "+str(v.Bounds.Height)
Notes: The handle is casted to a MKMapView and the plugin retains this handle.

See also:

Feedback, Comments & Corrections

MKMapViewMBS.Constructor(left as Double, top as Double, width as Double, height as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Creates a new control with the given size and position.
Example:
dim left,top,width,height as Integer
// define rectangle
dim x as new MKMapViewMBS(left, top, width, height)
Notes: On success the handle property is not zero.

See also:

Feedback, Comments & Corrections

MKMapViewMBS.convertCoordinateToPointToView(coordinate as CLLocationCoordinate2DMBS, view as NSViewMBS) as NSPointMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Converts a map coordinate to a point in the specified view.
Notes:
coordinate: The map coordinate for which you want to find the corresponding point.
view: The view in whose coordinate system you want to locate the specified map coordinate. If this parameter is nil, the returned point is specified in the window's coordinate system. If view is not nil, it must belong to the same window as the map view.

Returns the point (in the appropriate view or window coordinate system) corresponding to the specified latitude and longitude value.

Feedback, Comments & Corrections

MKMapViewMBS.convertPointToCoordinateFromView(point as NSPointMBS, view as NSViewMBS) as CLLocationCoordinate2DMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Converts a point in the specified view's coordinate system to a map coordinate.
Notes:
point: The point you want to convert.
view: The view that serves as the reference coordinate system for the point parameter.

Returns the map coordinate at the specified point.

Feedback, Comments & Corrections

MKMapViewMBS.convertRectToRegionFromView(rect as NSRectMBS, view as NSViewMBS) as MKCoordinateRegionMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Converts a rectangle in the specified view's coordinate system to a map region.
Notes:
rect: The rectangle you want to convert.
view: The view that serves as the reference coordinate system for the rect parameter.

Returns the map region corresponding to the specified view rectangle.

Feedback, Comments & Corrections

MKMapViewMBS.convertRegionToRectToView(region as MKCoordinateRegionMBS, view as NSViewMBS) as NSRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Converts a map region to a rectangle in the specified view.
Notes:
region: The map region for which you want to find the corresponding view rectangle.
view: The view in whose coordinate system you want to locate the specified map region. If this parameter is nil, the returned rectangle is specified in the window's coordinate system. If view is not nil, it must belong to the same window as the map view.

Returns the rectangle corresponding to the specified map region.

Feedback, Comments & Corrections

MKMapViewMBS.dequeueReusableAnnotationViewWithIdentifier(identifier as string) as MKAnnotationViewMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Returns a reusable annotation view located by its identifier.
Notes:
identifier: A string identifying the annotation view to be reused. This string is the same one you specify when initializing the annotation view using the Constructor method.

Returns an annotation view with the specified identifier, or nil if no such object exists in the reuse queue.

For performance reasons, you should generally reuse MKAnnotationView objects in your map views. As annotation views move offscreen, the map view moves them to an internally managed reuse queue. As new annotations move onscreen, and your code is prompted to provide a corresponding annotation view, you should always attempt to dequeue an existing view before creating a new one. Dequeueing saves time and memory during performance-critical operations such as scrolling.

Feedback, Comments & Corrections

MKMapViewMBS.deselectAnnotation(annotation as MKAnnotationMBS, animated as boolean)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Deselects the specified annotation and hides its callout view.
Notes:
annotation: The annotation object to deselect.
animated: If true, the callout view is animated offscreen.

Feedback, Comments & Corrections

MKMapViewMBS.Destructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: The destructor.

Feedback, Comments & Corrections

MKMapViewMBS.exchangeOverlay(index1 as Integer, index2 as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Exchanges the positions of the two overlay objects.
Notes:
index1: The index of an overlay in the MKOverlayLevelAboveLabels map level.
index2: The index of another overlay in the MKOverlayLevelAboveLabels map level.

If you need to exchange overlays in other map levels, use the exchangeOverlay method.

See also:

Feedback, Comments & Corrections

MKMapViewMBS.exchangeOverlay(Overlay1 as MKOverlayMBS, Overlay2 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: Exchanges the positions of the two overlay objects.
Notes: If the overlays are in the same map level, they exchange positions within that level’s array of overlay objects. If they are in different map levels, the two objects also swap levels. Swapping the position of the overlays affects their visibility in the map view.

See also:

Feedback, Comments & Corrections

MKMapViewMBS.insertOverlayAboveOverlay(overlay as MKOverlayMBS, aboveOverlay as MKOverlayMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Inserts one overlay object on top of another.
Notes:
overlay: The overlay object to insert.
sibling: An existing object in the overlays array. This object must exist in the array and must not be nil.

This method inserts the overlay into the MKOverlayLevelAboveLabels level and positions it relative to the specified sibling. When displayed, this leads to the overlay's contents being displayed above that of its sibling. If sibling is not in the same map level, this method appends the overlay to the end of the list of overlays at the indicated level.

Feedback, Comments & Corrections

MKMapViewMBS.insertOverlayAtIndex(overlay as MKOverlayMBS, index as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Inserts an overlay object into the list associated with the map.
Notes:
overlay: The overlay object to insert.
index: The index at which to insert the overlay object. If this value is greater than the number of objects in the overlays property, this method appends the object to the end of the array.

This method inserts the overlay into the MKOverlayLevelAboveLabels level.

See also:

Feedback, Comments & Corrections

MKMapViewMBS.insertOverlayAtIndex(overlay as MKOverlayMBS, index as integer, level as integer)
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: Inserts an overlay object into the level at the specified index.
Notes:
overlay: The overlay object to insert.
index: The index at which to insert the overlay object. If this value is greater than the number of objects in the overlays property, this method appends the object to the end of the array.
level: The map level at which to place the overlay. For a list of possible values for this parameter, see level constants.

Inserting an overlay at a specific level places that overlay’s visual representation in front of or behind other map content such as map labels and point-of-interest icons.

See also:

Feedback, Comments & Corrections

MKMapViewMBS.insertOverlayBelowOverlay(overlay as MKOverlayMBS, belowOverlay as MKOverlayMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: Inserts one overlay object below another.
Notes:
overlay: The overlay object to insert.
sibling: An existing object in the overlays array. This object must exist in the array and must not be nil.

This method inserts the overlay into the MKOverlayLevelAboveLabels level and positions it relative to the specified sibling. When displayed, this leads to the overlay's contents being displayed beneath that of its sibling. If sibling is not in the same map level, this method appends the overlay to the end of the list of overlays at the indicated level.

Feedback, Comments & Corrections

MKMapViewMBS.mapRectThatFits(mapRect as MKMapRectMBS) 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: Adjusts the aspect ratio of the specified map rectangle to ensure that it fits in the map view’s frame.
Notes:
mapRect: The initial map rectangle whose width and height you want to adjust.

Returns a map rectangle that is still centered on the same point of the map but whose width and height are adjusted to fit in the map view’s frame.

You can use this method to normalize map rectangle values before displaying the corresponding area. This method returns a new map rectangle that both contains the specified rectangle and fits neatly inside the map view’s frame.

See also:

Feedback, Comments & Corrections

MKMapViewMBS.mapRectThatFits(mapRect as MKMapRectMBS, edgePaddingLeft as Double, edgePaddingTop as Double, edgePaddingRight as Double, edgePaddingBottom as Double) 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: Adjusts the aspect ratio of the specified map rectangle, incorporating the specified inset values.
Notes: A map rectangle that is still centered on the same point of the map but whose width and height are adjusted to fit in the map view’s frame minus the inset values.

See also:

Feedback, Comments & Corrections

MKMapViewMBS.overlays as MKOverlayMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MapKit MBS MacFrameworks Plugin 14.1 Yes No No Yes, macOS only No
Function: The overlay objects currently associated with the map view.
Notes:
This property contains the union of all overlays at the different levels of the map. The objects in this array must adopt the MKOverlayMBS interface. If no overlays are associated with the map view, the value of this property is an empty array.

The order of the objects in this array does not necessary reflect their visual order on the map.

Feedback, Comments & Corrections

MKMapViewMBS.overlaysInLevel(level as Integer) 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: The overlay objects in the specified level of the map.
Notes:
level: The map level whose overlays you want. For a list of possible values for this parameter.

Returns an array of objects conforming to the MKOverlayMBS interfaces that display in the specified map level. If there are no overlays at the specified level, this method returns an empty array.

You can use this method to get all of the overlays assigned to a specific map level, which might be a subset of the complete set of overlay objects. For overlapping overlay objects, the order of objects in the array represents their visual order when displayed on the map, with objects in the beginning of the array located behind those at later indexes.

Feedback, Comments & Corrections

MKMapViewMBS.regionThatFits(region as MKCoordinateRegionMBS) as MKCoordinateRegionMBS
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: Adjusts the aspect ratio of the specified region to ensure that it fits in the map view’s frame.
Notes:
region: The initial region whose span you want to adjust.

Returns a region that is still centered on the same point of the map but whose span values are adjusted to fit in the map view’s frame.

You can use this method to normalize the region values before displaying them in the map. This method returns a new region that both contains the specified region and fits neatly inside the map view’s frame.

Feedback, Comments & Corrections

Next items

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




Links
MBS Xojo blog