Share via


MapControlDataHelper.CreateMapControl(Boolean) Method

Definition

Creates a MapControl in raster-mode.

Note

This API is not available to all Windows apps. Unless your developer account is specially provisioned by Microsoft, calls to this API will fail at runtime. For more information about this API and the Windows.Services.Maps.LocalSearch namespace, please work with your Microsoft Account Team representative.

public:
 static MapControl ^ CreateMapControl(bool rasterRenderMode);
 static MapControl CreateMapControl(bool const& rasterRenderMode);
public static MapControl CreateMapControl(bool rasterRenderMode);
function createMapControl(rasterRenderMode)
Public Shared Function CreateMapControl (rasterRenderMode As Boolean) As MapControl

Parameters

rasterRenderMode
Boolean

bool

Specifies whether to create the MapControl in raster-mode.

Returns

A MapControl

Windows requirements

Device family
Windows Desktop Extension SDK (introduced in 10.0.16299.0)
Windows Mobile Extension SDK (introduced in 10.0.16299.0)
Windows Team Extension SDK (introduced in 10.0.16299.0)
Windows 10, version 1809 (introduced in 10.0.17763.0)
API contract
Windows.Services.Maps.LocalSearchContract (introduced in v4.0)

Examples

This example creates a MapControl in raster-mode.

public void AddMapControl()
{
  var map = MapControlDataHelper.CreateMapControl(true);

  // Configure the map control and register for events
  map.Center = new Geopoint(new BasicGeoposition()
  {
    Latitude = 47.604,
    Longitude = -122.329
  });
  map.ZoomLevel = 12;

  map.PanInteractionMode = MapPanInteractionMode.Disabled;
  map.RotateInteractionMode = MapInteractionMode.Disabled;
  map.TiltInteractionMode = MapInteractionMode.Disabled;
  map.ZoomInteractionMode = MapInteractionMode.Disabled;

  map.MapContextRequested += MapControl_MapContextRequested;

  MyParentGrid.Children.Add(map);
}

Remarks

If you create a MapControl in raster-mode, you can't change the map control into vector mode.

Applies to