Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Next items

MKMapViewMBS.addAnnotation(annotation as Variant)
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 Variant)
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.addJavascriptTag(urlString as string)
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 additional javascript.

Feedback, Comments & Corrections

MKMapViewMBS.addOverlay(overlay as Variant)
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 MKOverlay protocol.

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.

Feedback, Comments & Corrections

MKMapViewMBS.addOverlays(overlays() as Variant)
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 MKOverlay protocol.

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.

Feedback, Comments & Corrections

MKMapViewMBS.addStylesheetTag(urlString as string)
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 additional style sheet.

Feedback, Comments & Corrections

MKMapViewMBS.annotations as Variant()
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.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 Variant, 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.

Feedback, Comments & Corrections

MKMapViewMBS.insertOverlayAboveOverlay(overlay as Variant, aboveOverlay as Variant)
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 Variant, 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.

Feedback, Comments & Corrections

MKMapViewMBS.insertOverlayBelowOverlay(overlay as Variant, belowOverlay as Variant)
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.overlays as Variant()
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 MKOverlay protocol. 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.removeAnnotation(annotation as Variant)
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: Removes the specified annotation object from the map view.
Notes:
annotation: The annotation object to remove. This object must conform to the MKAnnotation protocol.

If the annotation is currently associated with an annotation view, and that view has a reuse identifier, this method removes the annotation view and queues it internally for later reuse. You can retrieve queued annotation views (and associate them with new annotations) using the dequeueReusableAnnotationViewWithIdentifier method.

Removing an annotation object disassociates it from the map view entirely, preventing it from being displayed on the map. Thus, you would typically call this method only when you want to hide or delete a given annotation.

Feedback, Comments & Corrections

MKMapViewMBS.removeAnnotations(annotations() as Variant)
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: Removes an array of annotation objects from the map view.
Notes:
annotations: The array of annotations to remove. Objects in the array must conform to the MKAnnotation protocol.

If any annotation object in the array has an associated annotation view, and if that view has a reuse identifier, this method removes the annotation view and queues it internally for later reuse. You can retrieve queued annotation views (and associate them with new annotations) using the dequeueReusableAnnotationViewWithIdentifier method.

Removing annotation objects disassociates them from the map view entirely, preventing them from being displayed on the map. Thus, you would typically call this method only when you want to hide or delete the specified annotations.

Feedback, Comments & Corrections

MKMapViewMBS.removeOverlay(overlay as Variant)
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: Removes a single overlay object from the map.
Notes:
overlay: The overlay object to remove.

This method removes the overlay regardless of the level that it is in. Removing an overlay also removes its corresponding renderer, if one is in use. If the specified overlay is not currently associated with the map view, this method does nothing.

Feedback, Comments & Corrections

MKMapViewMBS.removeOverlays(overlays() as Variant)
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: Removes one or more overlay objects from the map.
Notes:
overlays: An array of objects, each of which conforms to the MKOverlay protocol.

This method removes the specified overlays regardless of which level each one is in. Removing an overlay also removes its corresponding renderer, if one is in use. If a given overlay object is not associated with the map view, it is ignored.

Feedback, Comments & Corrections

MKMapViewMBS.selectAnnotation(annotation as Variant, 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: Selects the specified annotation and displays a callout view for it.
Notes:
annotation: The annotation object to select.
animated: If true, the callout view is animated into position.

If the specified annotation is not onscreen, and therefore does not have an associated annotation view, this method has no effect.

Feedback, Comments & Corrections

MKMapViewMBS.selectedAnnotations as Variant()
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 annotations that are currently selected.
Notes: Assigning a new array to this property selects only the first annotation in the array.

Feedback, Comments & Corrections

MKMapViewMBS.setCenterCoordinate(Latitude as Double, Longitude as Double, Animated as boolean = true)
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: Changes the center coordinate of the map and optionally animates the change.
Notes:
Latitude and Longitude: The new center coordinate for the map.
animated: Specify true if you want the map view to scroll to the new location or false if you want the map to display the new location immediately.

Changing the center coordinate centers the map on the new coordinate without changing the current zoom level. It also updates the value in the region property to reflect the new center coordinate and the new span values needed to maintain the current zoom level.

Feedback, Comments & Corrections

Next items

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




Links
MBS Xojo PDF Plugins