Platforms to show: All Mac Windows Linux Cross-Platform
MKMapViewMBS class
Super class: NSViewMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | MapKit | MBS MacFrameworks Plugin | 14.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
You use this class as-is to display map information and to manipulate the map contents from your application. You can center the map on a given coordinate, specify the size of the area you want to display, and annotate the map with custom information.
In the IDE we show a generic map image as preview as the control itself doesn't perform well inside the Xojo IDE.
Subclass of the NSViewMBS class.
- 20 properties
- property annotationVisibleRect as NSRectMBS
- property camera as MKMapCameraMBS
- property centerCoordinate as CLLocationCoordinate2DMBS
- property mapType as Integer
- property PitchEnabled as Boolean
- property region as MKCoordinateRegionMBS
- property RotateEnabled as Boolean
- property scrollEnabled as Boolean
- property showsBuildings as Boolean
- property ShowsCompass as Boolean
- property showsPointsOfInterest as Boolean
- property showsScale as Boolean
- property showsTraffic as Boolean
- property showsUserLocation as Boolean
- property showsZoomControls as Boolean
- property userLocation as MKUserLocationMBS
- property userLocationVisible as Boolean
- property visibleMapRect as MKMapRectMBS
- property zoomEnabled as Boolean
- property zoomLevel as Double
- 49 methods
- method addAnnotation(annotation as MKAnnotationMBS)
- method addAnnotations(annotations() as MKAnnotationMBS)
- method addOverlay(overlay as MKOverlayMBS)
- method addOverlay(overlay as MKOverlayMBS, level as integer)
- method addOverlays(overlays() as MKOverlayMBS)
- method addOverlays(overlays() as MKOverlayMBS, level as integer)
- method annotations as MKAnnotationMBS()
- method annotationsInMapRect(mapRect as MKMapRectMBS) as MKAnnotationMBS()
- method annotationViews as MKAnnotationViewMBS()
- method Constructor
- method Constructor(Handle as Integer)
- method Constructor(left as Double, top as Double, width as Double, height as Double)
- method convertCoordinateToPointToView(coordinate as CLLocationCoordinate2DMBS, view as NSViewMBS) as NSPointMBS
- method convertPointToCoordinateFromView(point as NSPointMBS, view as NSViewMBS) as CLLocationCoordinate2DMBS
- method convertRectToRegionFromView(rect as NSRectMBS, view as NSViewMBS) as MKCoordinateRegionMBS
- method convertRegionToRectToView(region as MKCoordinateRegionMBS, view as NSViewMBS) as NSRectMBS
- method dequeueReusableAnnotationViewWithIdentifier(identifier as string) as MKAnnotationViewMBS
- method deselectAnnotation(annotation as MKAnnotationMBS, animated as boolean)
- method Destructor
- method exchangeOverlay(index1 as Integer, index2 as Integer)
- method exchangeOverlay(Overlay1 as MKOverlayMBS, Overlay2 as MKOverlayMBS)
- method insertOverlayAboveOverlay(overlay as MKOverlayMBS, aboveOverlay as MKOverlayMBS)
- method insertOverlayAtIndex(overlay as MKOverlayMBS, index as Integer)
- method insertOverlayAtIndex(overlay as MKOverlayMBS, index as integer, level as integer)
- method insertOverlayBelowOverlay(overlay as MKOverlayMBS, belowOverlay as MKOverlayMBS)
- method mapRectThatFits(mapRect as MKMapRectMBS) as MKMapRectMBS
- method mapRectThatFits(mapRect as MKMapRectMBS, edgePaddingLeft as Double, edgePaddingTop as Double, edgePaddingRight as Double, edgePaddingBottom as Double) as MKMapRectMBS
- method overlays as MKOverlayMBS()
- method overlaysInLevel(level as Integer) as MKOverlayMBS()
- method regionThatFits(region as MKCoordinateRegionMBS) as MKCoordinateRegionMBS
- method removeAnnotation(annotation as MKAnnotationMBS)
- method removeAnnotations(annotations() as MKAnnotationMBS)
- method removeOverlay(overlay as MKOverlayMBS)
- method removeOverlays(overlays() as MKOverlayMBS)
- method rendererForOverlay(overlay as MKOverlayMBS) as MKOverlayRendererMBS
- method selectAnnotation(annotation as MKAnnotationMBS, animated as boolean)
- method selectedAnnotations as MKAnnotationMBS()
- method setCamera(camera as MKMapCameraMBS, Animated as boolean = true)
- method setCenterCoordinate(centerCoordinate as CLLocationCoordinate2DMBS, zoomLevel as double, animated as boolean)
- method setCenterCoordinate(coordinate as CLLocationCoordinate2DMBS, Animated as boolean = true)
- method setRegion(c as CLLocationCoordinate2DMBS, animated as boolean = false)
- method setRegion(region as MKCoordinateRegionMBS, animated as boolean = false)
- method setVisibleMapRect(coordinate as MKMapRectMBS, Animated as boolean = true)
- method setVisibleMapRect(mapRect as MKMapRectMBS, edgePaddingLeft as Double, edgePaddingTop as Double, edgePaddingRight as Double, edgePaddingBottom as Double, animated as boolean)
- method setZoomLevel(zoomLevel as double, animated as boolean)
- method showAddress(address as string)
- method ShowAllAnnotations(withOverlays as boolean = false)
- method showAnnotations(annotations() as MKAnnotationMBS, animated as boolean)
- method viewForAnnotation(annotation as MKAnnotationMBS) as MKAnnotationViewMBS
- 4 shared methods
- shared method available as Boolean
- shared method MKErrorDomain as String
- shared method MKMapViewDefaultAnnotationViewReuseIdentifier as String
- shared method MKMapViewDefaultClusterAnnotationViewReuseIdentifier as String
- 16 constants
Errors
Constant | Value | Description |
---|---|---|
ErrorDirectionsNotFound | 4 |
The specified directions could not be found. |
ErrorLoadingThrottled | 2 |
The data was not loaded because data throttling is in effect. This error can occur if an app makes frequent requests for data over a short period of time. |
ErrorPlacemarkNotFound | 3 |
The specified placemark could not be found. |
ErrorServerFailure | 1 |
The map server was unable to return the desired information. |
ErrorUnknown | 0 |
An unknown error occurred. |
Feature visibility
Constant | Value | Description |
---|---|---|
FeatureVisibilityAdaptive | 0 |
For features in the normal state, title text is displayed and subtitle text is hidden. When a feature is selected, the title and subtitle text are hidden when the feature requires a callout. |
FeatureVisibilityHidden | 1 |
Always hidden. |
FeatureVisibilityVisible | 2 |
Always visible. |
Map Types
Constant | Value | Description |
---|---|---|
MapTypeHybrid | 2 |
Displays a satellite image of the area with road and road name information layered on top. |
MapTypeHybridFlyover | 4 |
A hybrid satellite image with flyover data where available. |
MapTypeMutedStandard | 5 |
A street map where your data is emphasized over the underlying map details. |
MapTypeSatellite | 1 |
Displays satellite imagery of the area. |
MapTypeSatelliteFlyover | 3 |
A satellite image of the area with flyover data where available. |
MapTypeStandard | 0 |
Displays a street map that shows the position of all roads and some road names. |
Overlay Levels
Constant | Value | Description |
---|---|---|
OverlayLevelAboveLabels | 1 |
Above labels |
OverlayLevelAboveRoads | 0 |
Above roads |
Super class NSViewMBS
- 43 properties
- property acceptsTouchEvents as boolean
- property allowsVibrancy as Boolean
- property alphaValue as Double
- property autoresizesSubviews as boolean
- property autoresizingMask as Integer
- property bounds as NSRectMBS
- property boundsRotation as Double
- property canBecomeKeyView as boolean
- property canDraw as boolean
- property canDrawConcurrently as boolean
- property className as string
- property classPath as string
- property clipsToBounds as Boolean
- property focusRingType as Integer
- property frame as NSRectMBS
- property frameCenterRotation as Double
- property frameHeight as Double
- property frameLeft as Double
- property frameRotation as Double
- property frameTop as Double
- property frameWidth as Double
- property identifier as string
- property isFlipped as Boolean
- property isHidden as Boolean
- property isHiddenOrHasHiddenAncestor as Boolean
- property isOpaque as Boolean
- property isRotatedFromBase as Boolean
- property isRotatedOrScaledFromBase as Boolean
- property layer as Variant
- property layerUsesCoreImageFilters as Boolean
- property needsDisplay as Boolean
- property nextKeyView as NSViewMBS
- property opaqueAncestor as NSViewMBS
- property RetainCount as Integer
- property superview as NSViewMBS
- property toolTip as string
- property userInteractionEnabled as Boolean
- property visibleRect as NSRectMBS
- property wantsDefaultClipping as boolean
- property wantsLayer as Boolean
- property wantsRestingTouches as boolean
- property window as NSWindowMBS
- property compositingFilter as variant
- 58 methods
- method addSubview(subview as NSViewMBS)
- method addSubview(subview as NSViewMBS, positioned as Integer, relativeToView as NSViewMBS)
- method addToolTipRect(rect as NSRectMBS, tooltip as NSViewTooltipMBS)
- method ancestorSharedWithView(view as NSViewMBS) as NSViewMBS
- method animator as NSViewMBS
- method backgroundFilters as variant()
- method beginDraggingSessionWithItems(items() as Variant, e as NSEventMBS, source as NSViewMBS) as Variant
- method Constructor
- method Constructor(Handle as Integer)
- method Constructor(left as Double, top as Double, width as Double, height as Double)
- method contentFilters as variant()
- method convertPointFromView(point as NSPointMBS, View as NSViewMBS) as NSPointMBS
- method convertPointToView(point as NSPointMBS, View as NSViewMBS) as NSPointMBS
- method convertRectFromView(rect as NSRectMBS, View as NSViewMBS) as NSRectMBS
- method convertRectToView(rect as NSRectMBS, View as NSViewMBS) as NSRectMBS
- method convertSizeFromView(Size as NSSizeMBS, View as NSViewMBS) as NSSizeMBS
- method convertSizeToView(Size as NSSizeMBS, View as NSViewMBS) as NSSizeMBS
- method dataWithEPSInsideRect(left as Double, top as Double, width as Double, height as Double) as Memoryblock
- method dataWithPDFInsideRect(left as Double, top as Double, width as Double, height as Double) as Memoryblock
- method dataWithPDFInsideRect(r as NSRectMBS) as Memoryblock
- method dragImage(image as NSImageMBS, viewLocation as NSPointMBS, offset as NSSizeMBS, NSEvent as NSEventMBS, pboard as NSPasteboardMBS, source as NSViewMBS, slideFlag as boolean)
- method drawFocusRingMask
- method enclosingMenuItem as Variant
- method enclosingScrollView as Variant
- method focusRingMaskBounds as NSRectMBS
- method hitTest(x as double, y as double) as NSViewMBS New in 24.4
- method isDescendantOf(view as NSViewMBS) as boolean
- method makeBackingLayer as Variant
- method nextValidKeyView as NSViewMBS
- method noteFocusRingMaskChanged
- method pageFooter as NSAttributedStringMBS
- method pageHeader as NSAttributedStringMBS
- method previousKeyView as NSViewMBS
- method previousValidKeyView as NSViewMBS
- method print
- method registeredDraggedTypes as string()
- method registerForDraggedTypes(Types() as string)
- method removeAllToolTips
- method removeFromSuperview
- method removeFromSuperviewWithoutNeedingDisplay
- method RenderImage(subviews as boolean = false, flipped as boolean = false) as variant
- method replaceSubview(oldView as NSViewMBS, newView as NSViewMBS)
- method rotateByAngle(angle as Double)
- method scaleUnitSquareToSize(size as NSSizeMBS)
- method Screenshot as Picture
- method setBackgroundFilters(Filters() as variant)
- method setBoundsOrigin(origin as NSPointMBS)
- method setBoundsOrigin(x as Double, y as Double)
- method setBoundsSize(size as NSSizeMBS)
- method setBoundsSize(width as Double, height as Double)
- method setContentFilters(Filters() as variant)
- method setFocus
- method setFrameOrigin(origin as NSPointMBS)
- method setFrameOrigin(x as Double, y as Double)
- method setFrameSize(size as NSSizeMBS)
- method setFrameSize(width as Double, height as Double)
- method subviews(recursive as boolean = false) as NSViewMBS()
- method unregisterDraggedTypes
- 5 shared methods
- shared method NSViewBoundsDidChangeNotification as string
- shared method NSViewDidUpdateTrackingAreasNotification as string
- shared method NSViewFocusDidChangeNotification as string
- shared method NSViewFrameDidChangeNotification as string
- shared method NSViewGlobalFrameDidChangeNotification as string
- 21 constants
Constants
Constant | Value | Description |
---|---|---|
NSBezelBorder | 2 |
One of the constants to specify the type of a view's border.
A concave border that makes the view look sunken. |
NSFocusRingTypeDefault | 0 |
One of the constants for the focusringtype property.
The default focus ring type for NSView or NSCell. |
NSFocusRingTypeExterior | 2 |
One of the constants for the focusringtype property.
The standard Aqua focus ring. |
NSFocusRingTypeNone | 1 |
One of the constants for the focusringtype property.
No focus ring. If you set the focus ring type to this value, NSView and NSCell will not draw any focus ring. |
NSGrooveBorder | 3 |
One of the constants to specify the type of a view's border.
A thin border that looks etched around the image. |
NSLineBorder | 1 |
One of the constants to specify the type of a view's border.
A black line border around the view. |
NSNoBorder | 0 |
One of the constants to specify the type of a view's border.
No border. |
NSViewHeightSizable | 16 |
One of the constants for the autoresizingMask property.
The receiver's height is flexible. |
NSViewLayerContentsRedrawBeforeViewResize | 3 | One of the view layer content redraw policy constants. |
NSViewLayerContentsRedrawDuringViewResize | 2 | One of the view layer content redraw policy constants. |
NSViewLayerContentsRedrawNever | 0 | One of the view layer content redraw policy constants. |
NSViewLayerContentsRedrawOnSetNeedsDisplay | 1 | One of the view layer content redraw policy constants. |
NSViewMaxXMargin | 4 |
One of the constants for the autoresizingMask property.
The right margin between the receiver and its superview is flexible. |
NSViewMaxYMargin | 32 |
One of the constants for the autoresizingMask property.
The top margin between the receiver and its superview is flexible. |
NSViewMinXMargin | 1 |
One of the constants for the autoresizingMask property.
The left margin between the receiver and its superview is flexible. |
NSViewMinYMargin | 8 |
One of the constants for the autoresizingMask property.
The bottom margin between the receiver and its superview is flexible. |
NSViewNotSizable | 0 |
One of the constants for the autoresizingMask property.
The receiver cannot be resized. |
NSViewWidthSizable | 2 |
One of the constants for the autoresizingMask property.
The receiver's width is flexible. |
Window Order Constants
Constant | Value | Description |
---|---|---|
NSWindowAbove | 1 |
Moves the window above the indicated window. |
NSWindowBelow | -1 |
Moves the window below the indicated window. |
NSWindowOut | 0 |
Moves the window off the screen. |
Super class NSResponderMBS
- 3 properties
- property Handle as Integer
- property menu as NSMenuMBS
- property nextResponder as NSResponderMBS
- 123 methods
- method beginGestureWithEvent(e as NSEventMBS)
- method cancelOperation
- method capitalizeWord
- method centerSelectionInVisibleArea
- method changeCaseOfLetter
- method complete
- method Constructor Private
- method cursorUpdate(e as NSEventMBS)
- method deleteBackward
- method deleteBackwardByDecomposingPreviousCharacter
- method deleteForward
- method deleteToBeginningOfLine
- method deleteToBeginningOfParagraph
- method deleteToEndOfLine
- method deleteToEndOfParagraph
- method deleteToMark
- method deleteWordBackward
- method deleteWordForward
- method endGestureWithEvent(e as NSEventMBS)
- method flagsChanged(e as NSEventMBS)
- method flushBufferedKeyEvents
- method helpRequested(e as NSEventMBS)
- method indent
- method insertBacktab
- method insertContainerBreak
- method insertDoubleQuoteIgnoringSubstitution
- method insertLineBreak
- method insertNewline
- method insertNewlineIgnoringFieldEditor
- method insertParagraphSeparator
- method insertSingleQuoteIgnoringSubstitution
- method insertTab
- method insertTabIgnoringFieldEditor
- method keyDown(e as NSEventMBS)
- method keyUp(e as NSEventMBS)
- method lowercaseWord
- method magnifyWithEvent(e as NSEventMBS)
- method makeBaseWritingDirectionLeftToRight
- method makeBaseWritingDirectionNatural
- method makeBaseWritingDirectionRightToLeft
- method makeTextWritingDirectionLeftToRight
- method makeTextWritingDirectionNatural
- method makeTextWritingDirectionRightToLeft
- method mouseDown(e as NSEventMBS)
- method mouseDragged(e as NSEventMBS)
- method mouseEntered(e as NSEventMBS)
- method mouseExited(e as NSEventMBS)
- method mouseMoved(e as NSEventMBS)
- method mouseUp(e as NSEventMBS)
- method moveBackward
- method moveBackwardAndModifySelection
- method moveDown
- method moveDownAndModifySelection
- method moveForward
- method moveForwardAndModifySelection
- method moveLeft
- method moveLeftAndModifySelection
- method moveParagraphBackwardAndModifySelection
- method moveParagraphForwardAndModifySelection
- method moveRight
- method moveRightAndModifySelection
- method moveToBeginningOfDocument
- method moveToBeginningOfDocumentAndModifySelection
- method moveToBeginningOfLine
- method moveToBeginningOfLineAndModifySelection
- method moveToBeginningOfParagraph
- method moveToBeginningOfParagraphAndModifySelection
- method moveToEndOfDocument
- method moveToEndOfDocumentAndModifySelection
- method moveToEndOfLine
- method moveToEndOfLineAndModifySelection
- method moveToEndOfParagraph
- method moveToEndOfParagraphAndModifySelection
- method moveToLeftEndOfLine
- method moveToLeftEndOfLineAndModifySelection
- method moveToRightEndOfLine
- method moveToRightEndOfLineAndModifySelection
- method moveUp
- method moveUpAndModifySelection
- method moveWordBackward
- method moveWordBackwardAndModifySelection
- method moveWordForward
- method moveWordForwardAndModifySelection
- method moveWordLeft
- method moveWordLeftAndModifySelection
- method moveWordRight
- method moveWordRightAndModifySelection
- method otherMouseDown(e as NSEventMBS)
- method otherMouseDragged(e as NSEventMBS)
- method otherMouseUp(e as NSEventMBS)
- method pageDown
- method pageDownAndModifySelection
- method pageUp
- method pageUpAndModifySelection
- method performMnemonic(theString as string) as boolean
- method presentError(e as NSErrorMBS) as boolean
- method rightMouseDown(e as NSEventMBS)
- method rightMouseDragged(e as NSEventMBS)
- method rightMouseUp(e as NSEventMBS)
- method rotateWithEvent(e as NSEventMBS)
- method scrollLineDown
- method scrollLineUp
- method scrollPageDown
- method scrollPageUp
- method scrollToBeginningOfDocument
- method scrollToEndOfDocument
- method scrollWheel(e as NSEventMBS)
- method selectAll
- method selectLine
- method selectParagraph
- method selectToMark
- method selectWord
- method setMark
- method showContextHelp
- method swapWithMark
- method swipeWithEvent(e as NSEventMBS)
- method tabletPoint(e as NSEventMBS)
- method tabletProximity(e as NSEventMBS)
- method transpose
- method transposeWords
- method undoManager as NSUndoManagerMBS
- method uppercaseWord
- method yank
This class has no sub classes.
Some properties using for this class:
- DesktopMapKitViewControlMBS.View as MKMapViewMBS
- MapKitIOSControlMBS.View as MKMapViewMBS
- MapKitViewControlMBS.View as MKMapViewMBS
Some events using this class:
- DesktopMapKitViewControlMBS.didAddAnnotationViews(mapView as MKMapViewMBS, AnnotationViews() as MKAnnotationViewMBS)
- DesktopMapKitViewControlMBS.DidAddOverlayRenderers(mapView as MKMapViewMBS, renderers() as MKOverlayRendererMBS)
- DesktopMapKitViewControlMBS.didAddOverlayViews(mapView as MKMapViewMBS, overlayViews() as NSViewMBS)
- DesktopMapKitViewControlMBS.didStopLocatingUser(mapView as MKMapViewMBS)
- MapKitIOSControlMBS.didAddOverlayViews(mapView as MKMapViewMBS, overlayViews() as NSViewMBS)
- MapKitIOSControlMBS.didDeselectAnnotationView(mapView as MKMapViewMBS, view as MKAnnotationViewMBS)
- MapKitIOSControlMBS.willStartLocatingUser(mapView as MKMapViewMBS)
- MapKitViewControlMBS.didDeselectAnnotationView(mapView as MKMapViewMBS, view as MKAnnotationViewMBS)
- MapKitViewControlMBS.didFailToLocateUserWithError(mapView as MKMapViewMBS, error as NSErrorMBS)
- MapKitViewControlMBS.regionDidChangeAnimated(mapView as MKMapViewMBS, animated as boolean)
Some examples using this class:
- /MacFrameworks/MapKit/MapKit Custom Icons example
- /MacFrameworks/MapKit/MapKit Custom Image
- /MacFrameworks/MapKit/MapKit iOS
- /MacFrameworks/MapKit/MapKit Local Search
- /MacFrameworks/MapKit/MapKit Test
Blog Entries
- MBS Xojo Plugins, version 22.4pr5
- News from the MBS Xojo Plugins Version 22.0
- MonkeyBread Software Releases the MBS Xojo Plugins in version 22.0
- MBS Xojo Plugins, version 21.6pr1
- MonkeyBread Software Releases the MBS Xojo Plugins in version 20.4
- MBS Xojo Plugins, version 20.4pr6
- MBS Xojo Plugins, version 20.1pr3
- MBS Xojo Plugins, version 19.5pr8
- MBS Xojo Plugins, version 19.5pr1
- MapKit Framework for Xojo
Xojo Developer Magazine
- 20.2, page 10: News
- 19.1, pages 87 to 88: Maps Part 8, Implementing Maps in Xojo desktop apps with the MapKitMBS plugin by Markus Winter
- 18.6, page 79: MapKit Part 7, Implementing Maps in Xojo desktop apps with the MapKitMBS plugin by Markus Winter
- 18.6, page 76: MapKit Part 7, Implementing Maps in Xojo desktop apps with the MapKitMBS plugin by Markus Winter
- 18.6, page 74: MapKit Part 7, Implementing Maps in Xojo desktop apps with the MapKitMBS plugin by Markus Winter
- 18.6, page 65: MapKit Part 7, Implementing Maps in Xojo desktop apps with the MapKitMBS plugin by Markus Winter
- 18.6, page 10: News
- 18.5, pages 86 to 87: Maps (Part 6), A deep dive into Annotations by Markus Winter
- 18.5, page 80: Maps (Part 6), A deep dive into Annotations by Markus Winter
Videos
Release notes
- Version 22.4
- Added withOverlays parameter to ShowAllAnnotations method in MKMapViewMBS class.
- Version 22.0
- Added ShowAllAnnotations for MKMapViewMBS class.
- Version 20.4
- Added annotationViews function to MKMapViewMBS class.
- Version 20.1
- Changed ShowAddress method in MKMapViewMBS to use the region size to zoom.
- Version 19.5
- Added setCenterCoordinate and setZoomLevel to zoom in MKMapViewMBS class.
- Added zoomLevel property to MKMapViewMBS class.
- Fixed bug in ZoomLevel in MKMapViewMBS class to increase precision.
- Version 19.3
- Fixed MKMapViewMBS.showAddress method to correctly center on the found placemark instead of the region for that placemark.
The items on this page are in the following plugins: MBS MacBase Plugin, MBS MacFrameworks Plugin.
MKMapSnapshotterMBS - MKMarkerAnnotationViewMBS