MapView QML Type

A MapView that renders data in a map and allows users to interact with the map. More...

Import Statement: import Esri.ArcGISRuntime 100.15
Since: Esri.ArcGISRuntime 100.0
Inherits:

GeoView

Properties

Signals

Methods

Detailed Description

In a Model-View-Controller (MVC) architecture, a map view represents the view and a map represents the model.

This QML type supports the following default properties. A default property may be declared inside another declared object without being assigned explicitly to a property.

Refer to the GeoView documentation for any additional default properties.

Example:

Create MapView that contains a Map with the Imagery with Labels Basemap:

MapView {
    anchors.fill: parent

    Component.onCompleted: {
        // Set the focus on MapView to initially enable keyboard navigation
        forceActiveFocus();
    }

    Map {
        Basemap {
            initStyle: Enums.BasemapStyleArcGISImagery
        }
    }
}

See also Cancelable, Map, and GeoView.

Property Documentation

allowMagnifierToPanMap : bool

Whether the magnifier should be allowed to pan the map.


[default] backgroundGrid : BackgroundGrid

Various settings applied to the map view's background.

The background grid determines the color and context grid of a map view when no MapView.map has been set.

The Map displays on top of the background grid or the optional Map.backgroundColor to determine what is displayed under transparent areas of the map.

If Map.backgroundColor is not null, then backgroundGrid is ignored and Map.backgroundColor will be used as the background color of the map.


calloutData : CalloutData

The data and location used for displaying a callout on the map.

The callout data that is returned can be modified, and then used with a view for display.


[default] grid : ArcGISGrid

The map view's grid. The grid displays over the map.


locationDisplay : LocationDisplay

The location display used for displaying device location from a datasource such as a GPS sensor.


magnifierEnabled : bool

Whether the magnifier is enabled.


[default] map : Map

The map that is currently set to the map view.

Setting a non-loaded map to a view starts the load process of the map so the map can be displayed once loaded.


mapRotation : double

Returns the rotation of the MapView in degrees (read-only).


mapScale : double

Returns the scale of the MapView (read-only).


rotationByPinchingEnabled : bool

Whether rotation of the MapView by multi-touch pinching is enabled.


[default] sketchEditor : SketchEditor

Sets the map view's sketch editor to sketchEditor.

This property was introduced in Esri.ArcGISRuntime 100.12.


unitsPerDIP : double

Returns the units per device independent pixel of the MapView (read-only).


visibleArea : Polygon

Returns the visible area of the MapView (read-only).


wrapAroundMode : Enums.WrapAroundMode


zoomByPinchingEnabled : bool

Whether zooming of the MapView by multi-touch pinching is enabled.


Signal Documentation

allowMagnifierToPanMapChanged()

Emitted when the allowMagnifierToPanMap property changes.

Note: The corresponding handler is onAllowMagnifierToPanMapChanged.


backgroundGridChanged()

Emitted when the backgroundGrid property changes.

Note: The corresponding handler is onBackgroundGridChanged.


calloutDataChanged()

Emitted when the calloutData property changes.

Note: The corresponding handler is onCalloutDataChanged.


gridChanged()

Emitted when the grid property changes.

Note: The corresponding handler is onGridChanged.


locationDisplayChanged()

Emitted when the locationDisplay property changes.

Note: The corresponding handler is onLocationDisplayChanged.


magnifierEnabledChanged()

Emitted when the magnifierEnabled property changes.

Note: The corresponding handler is onMagnifierEnabledChanged.


mapChanged()

Emitted when the map property changes.

Note: The corresponding handler is onMapChanged.


mapRotationChanged()

Emitted when the mapRotation property changes.

Note: The corresponding handler is onMapRotationChanged.


mapScaleChanged()

Emitted when the mapScale property changes.

Note: The corresponding handler is onMapScaleChanged.


rotationByPinchingEnabledChanged()

Emitted when the rotationByPinchingEnabled property changes.

Note: The corresponding handler is onRotationByPinchingEnabledChanged.


sketchEditorChanged()

Emitted when the sketchEditor property changes.

Note: The corresponding handler is onSketchEditorChanged.

This signal was introduced in Esri.ArcGISRuntime 100.9.


visibleAreaChanged()

Emitted when the visibleArea property changes.

Note: The corresponding handler is onVisibleAreaChanged.


wrapAroundModeChanged()

Emitted when the wrapAroundMode property changes.

Note: The corresponding handler is onWrapAroundModeChanged.


zoomByPinchingEnabledChanged()

Emitted when the zoomByPinchingEnabled property changes.

Note: The corresponding handler is onZoomByPinchingEnabledChanged.


Method Documentation

point locationToScreen(Point mapPoint)

Converts mapPoint within the map view's spatial reference to a screen coordinate.

If the Enums.WrapAroundMode on the map view is enabled, this method returns the closest screen location matching the specified map location. If the closest screen coordinate is visible then that location is returned. Otherwise, the screen coordinate for the frame where the location is the closest to the center of the view is returned.

This method cannot be called until a map has been given to the map view. If this method is called before the map view is ready, an error will occur.


Point screenToLocation(double screenX, double screenY)

Converts screenX and screenY screen coordinates to a Point in map view coordinates.


string setViewpointCenter(Point center)

Sets the viewpoint with a center point.

  • center - The center point to set.

Returns a task ID that can be used to cancel the setViewpointCenter task.

See also Cancelable.


string setViewpointCenterAndScale(Point center, double scale)

Sets the viewpoint with a center point and scale.

  • center - The center point to set.
  • scale - The scale to zoom to.

Returns a task ID that can be used to cancel the setViewpointCenterAndScale task.

See also Cancelable.


string setViewpointGeometry(Geometry boundingGeometry)

Sets the viewpoint with a bounding geometry.

  • boundingGeometry - The bounding geometry to set.

Returns a task ID that can be used to cancel the setViewpointGeometry task.

See also Cancelable.


string setViewpointGeometryAndPadding(Geometry boundingGeometry, double paddingInDIPS)

Sets the viewpoint with a bounding geometry and padding.

  • boundingGeometry - The bounding geometry to set.
  • paddingInDIPS - The space in device independent pixels (DIPS) to expand the viewport by.

Returns a task ID that can be used to cancel the setViewpointGeometryAndPadding task.

See also Cancelable.


string setViewpointRotation(double angleDegrees)

Sets the viewpoint with rotation.

  • angleDegrees - The angle of the rotation to set in degrees.

Returns a task ID that can be used to cancel the setViewpointRotation task.

See also Cancelable.


string setViewpointScale(double scale)

Sets the viewpoint with scale.

  • scale - The scale to zoom to.

Returns a task ID that can be used to cancel the setViewpointScale task.

See also Cancelable.


string setViewpointWithAnimationCurve(Viewpoint viewpoint, real durationSeconds, AnimationCurve curve)

Sets the viewpoint with custom animation options.

  • viewpoint - The viewpoint to set.
  • durationSeconds - The number of seconds for the animation to take.
  • curve - The Enums.AnimationCurve type to use.

Returns a task ID that can be used to cancel the setViewpointWithAnimationCurve task.

See also Cancelable.


Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.