Skip to content

GoogleMapTilesOverlay

Namespace: ThinkGeo.UI.Maui

Represents a TileOverlay that displays Google Map Tiles API 2D tiles.

public class GoogleMapTilesOverlay : WebXyzTileOverlay`1, System.ComponentModel.INotifyPropertyChanged, Microsoft.Maui.Controls.Internals.IDynamicResourceHandler, Microsoft.Maui.Controls.IElementDefinition, Microsoft.Maui.Controls.Internals.INameScope, Microsoft.Maui.Controls.IElementController, Microsoft.Maui.IVisualTreeElement, Microsoft.Maui.IElement, Microsoft.Maui.Controls.IEffectControlProvider, Microsoft.Maui.IToolTipElement, Microsoft.Maui.IContextFlyoutElement, Microsoft.Maui.Controls.IControlsElement, Microsoft.Maui.IHandlerDisconnectPolicies, Microsoft.Maui.Controls.StyleSheets.IStyleSelectable, Microsoft.Maui.Controls.Internals.INavigationProxy, Microsoft.Maui.Controls.IAnimatable, Microsoft.Maui.Controls.IVisualElementController, Microsoft.Maui.Controls.IResourcesProvider, Microsoft.Maui.Controls.IStyleElement, Microsoft.Maui.Controls.IFlowDirectionController, Microsoft.Maui.Controls.IPropertyPropagationController, Microsoft.Maui.Controls.IVisualController, Microsoft.Maui.Controls.IWindowController, Microsoft.Maui.IView, Microsoft.Maui.ITransform, Microsoft.Maui.Controls.IControlsVisualElement, Microsoft.Maui.IConstrainedView, Microsoft.Maui.Controls.StyleSheets.IStylable, Microsoft.Maui.Controls.IViewController, Microsoft.Maui.Controls.Internals.IGestureController, Microsoft.Maui.Controls.IGestureRecognizers, Microsoft.Maui.IPropertyMapperView, Microsoft.Maui.HotReload.IHotReloadableView, Microsoft.Maui.IReplaceableView, Microsoft.Maui.Controls.IControlsView, Microsoft.Maui.ILayout, Microsoft.Maui.IContainer, System.Collections.Generic.IList`1[[Microsoft.Maui.IView, Microsoft.Maui, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Collections.Generic.ICollection`1[[Microsoft.Maui.IView, Microsoft.Maui, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Collections.Generic.IEnumerable`1[[Microsoft.Maui.IView, Microsoft.Maui, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Collections.IEnumerable, Microsoft.Maui.ISafeAreaView, Microsoft.Maui.IPadding, Microsoft.Maui.ICrossPlatformLayout, Microsoft.Maui.Controls.IBindableLayout, Microsoft.Maui.Controls.IPaddingElement, Microsoft.Maui.Controls.IInputTransparentContainerElement, Microsoft.Maui.ISafeAreaView2, Microsoft.Maui.ISafeAreaElement, Microsoft.Maui.IAbsoluteLayout, System.IDisposable

Inheritance object → BindableObject → Element → StyleableElement → NavigableElement → VisualElement → View → Layout → AbsoluteLayout → Overlay → TileOverlay → XyzTileOverlay<GoogleMapTilesAsyncLayer> → WebXyzTileOverlay<GoogleMapTilesAsyncLayer> → GoogleMapTilesOverlay
Implements INotifyPropertyChanged, IDynamicResourceHandler, IElementDefinition, INameScope, IElementController, IVisualTreeElement, IElement, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IControlsElement, IHandlerDisconnectPolicies, IStyleSelectable, INavigationProxy, IAnimatable, IVisualElementController, IResourcesProvider, IStyleElement, IFlowDirectionController, IPropertyPropagationController, IVisualController, IWindowController, IView, ITransform, IControlsVisualElement, IConstrainedView, IStylable, IViewController, IGestureController, IGestureRecognizers, IPropertyMapperView, IHotReloadableView, IReplaceableView, IControlsView, ILayout, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IBindableLayout, IPaddingElement, IInputTransparentContainerElement, ISafeAreaView2, ISafeAreaElement, IAbsoluteLayout, IDisposable

Remarks:

This overlay uses the official Google Map Tiles API and does not enable persistent tile caching by default. Applications must display Google Maps attribution and comply with Google Map Tiles API policies.

Fields

transientNamescope

public INameScope transientNamescope;

Properties

ApiKey

Gets or sets the Google Maps Platform API key.

public string ApiKey { get; set; }

Property Value

string

MapType

Gets or sets the Google Map Tiles 2D map theme.

public GoogleMapTilesMapType MapType { get; set; }

Property Value

GoogleMapTilesMapType

RequestLanguage

Gets or sets the BCP-47 language code supplied to the Google Map Tiles API session request.

public string RequestLanguage { get; set; }

Property Value

string

Region

Gets or sets the CLDR region identifier supplied to the Google Map Tiles API session request.

public string Region { get; set; }

Property Value

string

ImageFormat

Gets or sets the preferred image format for the Google Map Tiles API session.

public GoogleMapTilesImageFormat ImageFormat { get; set; }

Property Value

GoogleMapTilesImageFormat

IsStreetViewLayerEnabled

Gets or sets a value indicating whether the Street View availability layer is overlaid on the map.

public bool IsStreetViewLayerEnabled { get; set; }

Property Value

bool

IsTrafficLayerEnabled

Gets or sets a value indicating whether traffic conditions are overlaid on the map.

public bool IsTrafficLayerEnabled { get; set; }

Property Value

bool

TileCache

Gets or sets the overlay tile cache.

public RasterTileCache TileCache { get; set; }

Property Value

RasterTileCache

Exceptions

NotSupportedException
Thrown when assigning a non-null cache.

Remarks:

Google Map Tiles API content is not cached by this overlay. Assigning a non-null cache is blocked so the MAUI overlay cannot persist Google tile content through ThinkGeo tile-cache APIs.

ProjectedTileCache

Gets or sets the projected tile cache.

public RasterTileCache ProjectedTileCache { get; set; }

Property Value

RasterTileCache

Exceptions

NotSupportedException
Thrown when assigning a non-null cache.

Remarks:

Projected tile caching is disabled so derived Google tile imagery is not persisted by the overlay.

IsCacheOnly

Gets or sets whether the overlay should draw from cache only.

public bool IsCacheOnly { get; set; }

Property Value

bool

Exceptions

NotSupportedException
Thrown when assigning true.

Remarks:

Cache-only rendering is disabled because this overlay does not support a Google tile cache.

TileBuffer

Gets or sets the number of extra tile rows and columns requested around the viewport.

public int TileBuffer { get; set; }

Property Value

int

Exceptions

NotSupportedException
Thrown when assigning a value other than zero.

Remarks:

Extra tile buffering is disabled to avoid prefetching Google tile content outside the current viewport.

TileWidth

Gets or sets the tile width.

public int TileWidth { get; set; }

Property Value

int

Exceptions

NotSupportedException
Thrown when assigning a value other than 256.

Remarks:

Google Map Tiles API 2D tiles are requested by this overlay as 256 pixel tiles.

TileHeight

Gets or sets the tile height.

public int TileHeight { get; set; }

Property Value

int

Exceptions

NotSupportedException
Thrown when assigning a value other than 256.

Remarks:

Google Map Tiles API 2D tiles are requested by this overlay as 256 pixel tiles.

CurrentZoomTileCacheCapacity

Gets or sets the number of current zoom tile views retained in memory.

public int CurrentZoomTileCacheCapacity { get; set; }

Property Value

int

Exceptions

NotSupportedException
Thrown when assigning a value other than zero.

Remarks:

Tile-view retention is disabled because retained MAUI image controls can keep Google tile bytes alive.

ZoomOutTileCacheCapacity

Gets or sets the number of zoom-out tile views retained in memory.

public int ZoomOutTileCacheCapacity { get; set; }

Property Value

int

Exceptions

NotSupportedException
Thrown when assigning a value other than zero.

Remarks:

Zoom-out tile-view retention is disabled for the same reason as GoogleMapTilesOverlay.CurrentZoomTileCacheCapacity.

TileType

Gets or sets the tile rendering mode.

public TileType TileType { get; set; }

Property Value

TileType

Exceptions

NotSupportedException
Thrown when assigning a value other than .

Remarks:

This overlay always uses regular multi-tile rendering for Google Map Tiles API content.

Session

Gets what the Google Map Tiles API answered when the current session was created, or null before the layer has one.

public GoogleMapTilesSession Session { get; }

Property Value

GoogleMapTilesSession

WebProxy

Gets or sets the Web Proxy for web service.

public IWebProxy WebProxy { get; set; }

Property Value

IWebProxy

TimeoutInSeconds

Gets or sets the length of time, in seconds, before the request times out.

public int TimeoutInSeconds { get; set; }

Property Value

int

ProjectionConverter

Gets or sets the projection converter used when requesting tiles.

public ProjectionConverter ProjectionConverter { get; set; }

Property Value

ProjectionConverter

MaxConcurrentTileDraws

Maximum number of tiles drawn concurrently per refresh in MultiTile mode. Defaults to int.MaxValue (unbounded) to match historical behavior. Lower it (for example to 4 or 8) to cap memory and threadpool pressure on slow networks or low-memory devices. Mirrors ThinkGeo.UI.Desktop.TileOverlay.MaxConcurrentTileDraws.

public int MaxConcurrentTileDraws { get; set; }

Property Value

int

Remarks:

The cap covers both the per-tile draw stage and the subsequent post-to-UI stage of a single refresh. Has no effect on SingleTile rendering.

Tile drawing (Skia bitmap allocation and path rendering) is CPU-bound work, so strictly speaking this knob caps the degree of parallelism, not just concurrency. The "Concurrent" name is kept to align with the related throttles elsewhere in the SDK (MaxConcurrentTileLoads, MaxConcurrentRequests) so a single autocomplete prefix surfaces them together.

TransitionEffect

Gets or sets the tile transition effect.

public TransitionEffect TransitionEffect { get; set; }

Property Value

TransitionEffect
The tile snapping mode.

RenderingOptions

Gets or sets all Skia rendering options applied when tiles are drawn.

public RenderingOptions RenderingOptions { get; set; }

Property Value

RenderingOptions

ZoomLevelSet

Gets or sets the ZoomLevelSet for the TileOverlay. By default, this will snap to the scales defined in the ZoomLevelSet to fetch the internal data.

public ZoomLevelSet ZoomLevelSet { get; set; }

Property Value

ZoomLevelSet

Remarks:

Ensure that the ZoomLevelSet scales align with those of the tile provider, especially when using third-party data.

Name

Gets or sets the name of this overlay.

public string Name { get; set; }

Property Value

string

Attribution

Gets the attribution text displayed for this overlay.

public string Attribution { get; protected set; }

Property Value

string

Remarks:

Set by derived overlays to describe the data source rendered on the map.

DrawingExceptionMode

This property gets and sets the DrawingExceptionMode used when an exception occurs during drawing.

public DrawingExceptionMode DrawingExceptionMode { get; set; }

Property Value

DrawingExceptionMode
The drawing exception mode.

IsEmpty

This property gets if this overlay is empty or not.

public bool IsEmpty { get; }

Property Value

bool

Remarks:

This property enhances the performance of the overlay while drawing. If is true, we will skip drawing this overlay and continue drawing the next overlay.

Children

public IList<IView> Children { get; }

Property Value

IList<IView>

Count

public int Count { get; }

Property Value

int

IsReadOnly

public bool IsReadOnly { get; }

Property Value

bool

Item

public IView Item { get; set; }

Property Value

IView

IsClippedToBounds

public bool IsClippedToBounds { get; set; }

Property Value

bool

Padding

public Thickness Padding { get; set; }

Property Value

Thickness

SafeAreaEdges

public SafeAreaEdges SafeAreaEdges { get; set; }

Property Value

SafeAreaEdges

IgnoreSafeArea

public bool IgnoreSafeArea { get; set; }

Property Value

bool

CascadeInputTransparent

public bool CascadeInputTransparent { get; set; }

Property Value

bool

GestureRecognizers

public IList<IGestureRecognizer> GestureRecognizers { get; }

Property Value

IList<IGestureRecognizer>

HorizontalOptions

public LayoutOptions HorizontalOptions { get; set; }

Property Value

LayoutOptions

Margin

public Thickness Margin { get; set; }

Property Value

Thickness

VerticalOptions

public LayoutOptions VerticalOptions { get; set; }

Property Value

LayoutOptions

Visual

public IVisual Visual { get; set; }

Property Value

IVisual

FlowDirection

public FlowDirection FlowDirection { get; set; }

Property Value

FlowDirection

Window

public Window Window { get; }

Property Value

Window

AnchorX

public double AnchorX { get; set; }

Property Value

double

AnchorY

public double AnchorY { get; set; }

Property Value

double

BackgroundColor

public Color BackgroundColor { get; set; }

Property Value

Color

Background

public Brush Background { get; set; }

Property Value

Brush

Behaviors

public IList<Behavior> Behaviors { get; }

Property Value

IList<Behavior>

Bounds

public Rect Bounds { get; }

Property Value

Rect

Height

public double Height { get; }

Property Value

double

HeightRequest

public double HeightRequest { get; set; }

Property Value

double

InputTransparent

public bool InputTransparent { get; set; }

Property Value

bool

IsEnabled

public bool IsEnabled { get; set; }

Property Value

bool

IsFocused

public bool IsFocused { get; }

Property Value

bool

IsVisible

public bool IsVisible { get; set; }

Property Value

bool

MinimumHeightRequest

public double MinimumHeightRequest { get; set; }

Property Value

double

MinimumWidthRequest

public double MinimumWidthRequest { get; set; }

Property Value

double

MaximumHeightRequest

public double MaximumHeightRequest { get; set; }

Property Value

double

MaximumWidthRequest

public double MaximumWidthRequest { get; set; }

Property Value

double

Opacity

public double Opacity { get; set; }

Property Value

double

Rotation

public double Rotation { get; set; }

Property Value

double

RotationX

public double RotationX { get; set; }

Property Value

double

RotationY

public double RotationY { get; set; }

Property Value

double

Scale

public double Scale { get; set; }

Property Value

double

ScaleX

public double ScaleX { get; set; }

Property Value

double

ScaleY

public double ScaleY { get; set; }

Property Value

double

TranslationX

public double TranslationX { get; set; }

Property Value

double

TranslationY

public double TranslationY { get; set; }

Property Value

double

Triggers

public IList<TriggerBase> Triggers { get; }

Property Value

IList<TriggerBase>

Width

public double Width { get; }

Property Value

double

WidthRequest

public double WidthRequest { get; set; }

Property Value

double

X

public double X { get; }

Property Value

double

Y

public double Y { get; }

Property Value

double

Clip

public Geometry Clip { get; set; }

Property Value

Geometry

Batched

public bool Batched { get; }

Property Value

bool

DisableLayout

public bool DisableLayout { get; set; }

Property Value

bool

IsInPlatformLayout

public bool IsInPlatformLayout { get; set; }

Property Value

bool

IsPlatformStateConsistent

public bool IsPlatformStateConsistent { get; set; }

Property Value

bool

IsPlatformEnabled

public bool IsPlatformEnabled { get; set; }

Property Value

bool

Resources

public ResourceDictionary Resources { get; set; }

Property Value

ResourceDictionary

Frame

public Rect Frame { get; set; }

Property Value

Rect

Handler

public IViewHandler Handler { get; set; }

Property Value

IViewHandler

Shadow

public Shadow Shadow { get; set; }

Property Value

Shadow

ZIndex

public int ZIndex { get; set; }

Property Value

int

DesiredSize

public Size DesiredSize { get; protected set; }

Property Value

Size

IsLoaded

public bool IsLoaded { get; }

Property Value

bool

public INavigation Navigation { get; internal set; }

Property Value

INavigation

public NavigationProxy NavigationProxy { get; }

Property Value

NavigationProxy

Style

public Style Style { get; set; }

Property Value

Style

StyleClass

public IList<string> StyleClass { get; set; }

Property Value

IList<string>

class

public IList<string> class { get; set; }

Property Value

IList<string>

AutomationId

public string AutomationId { get; set; }

Property Value

string

ClassId

public string ClassId { get; set; }

Property Value

string

Effects

public IList<Effect> Effects { get; }

Property Value

IList<Effect>

Id

public Guid Id { get; }

Property Value

Guid

StyleId

public string StyleId { get; set; }

Property Value

string

LogicalChildren

public ReadOnlyCollection<Element> LogicalChildren { get; }

Property Value

ReadOnlyCollection<Element>

RealParent

public Element RealParent { get; }

Property Value

Element

Parent

public Element Parent { get; set; }

Property Value

Element

EffectControlProvider

public IEffectControlProvider EffectControlProvider { get; set; }

Property Value

IEffectControlProvider

Handler

public IElementHandler Handler { get; set; }

Property Value

IElementHandler

Dispatcher

public IDispatcher Dispatcher { get; }

Property Value

IDispatcher

BindingContext

public object BindingContext { get; set; }

Property Value

object

Constructors

GoogleMapTilesOverlay()

Initializes a new instance of the GoogleMapTilesOverlay class without an API key.

public GoogleMapTilesOverlay()

GoogleMapTilesOverlay(string)

Initializes a new instance of the GoogleMapTilesOverlay class.

public GoogleMapTilesOverlay(string apiKey)

Parameters

apiKey string
The Google Maps Platform API key.

GoogleMapTilesOverlay(string, GoogleMapTilesMapType)

Initializes a new instance of the GoogleMapTilesOverlay class.

public GoogleMapTilesOverlay(string apiKey, GoogleMapTilesMapType mapType)

Parameters

apiKey string
The Google Maps Platform API key.

mapType GoogleMapTilesMapType
The Google Map Tiles 2D map theme to display.

Methods

GetAttributionAsync(RectangleShape, double)

Gets copyright and attribution text for the displayed viewport.

public Task<string> GetAttributionAsync(RectangleShape extentInDecimalDegree, double scale)

Parameters

extentInDecimalDegree RectangleShape
The viewport extent in decimal degrees.

scale double
The current map scale.

Returns

Task<string>
A task that returns the attribution string, or an empty string when none is available.

GetAttributionAsync()

Gets copyright and attribution text for the current map viewport.

public Task<string> GetAttributionAsync()

Returns

Task<string>
A task that returns the attribution string, or an empty string when the overlay is not opened.

GetTileCore()

protected TileView GetTileCore()

Returns

TileView

OpenAsyncCore(IMapView, CancellationToken)

protected Task OpenAsyncCore(IMapView mapView, CancellationToken cancellationToken)

Parameters

mapView IMapView

cancellationToken CancellationToken

Returns

Task

DrawAsyncCore(OverlayRefreshType, CancellationToken)

protected Task DrawAsyncCore(OverlayRefreshType refreshType, CancellationToken cancellationToken)

Parameters

refreshType OverlayRefreshType

cancellationToken CancellationToken

Returns

Task

DrawWithoutPostingAsyncCore(OverlayRefreshType, CancellationToken)

protected Task DrawWithoutPostingAsyncCore(OverlayRefreshType refreshType, CancellationToken cancellationToken)

Parameters

refreshType OverlayRefreshType

cancellationToken CancellationToken

Returns

Task

PostAsyncCore(CancellationToken)

protected Task PostAsyncCore(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task

TransformCore(RectangleShape, IMapView)

protected void TransformCore(RectangleShape extent, IMapView mapView)

Parameters

extent RectangleShape

mapView IMapView

Returns

void

GetTileMatrixCore(double, int, int, GeographyUnit)

protected TileMatrix GetTileMatrixCore(double scale, int tileWidth, int tileHeight, GeographyUnit boundingBoxUnit)

Parameters

scale double

tileWidth int

tileHeight int

boundingBoxUnit GeographyUnit

Returns

TileMatrix

Events

SendingHttpRequest

Occurs before an HTTP request is sent to retrieve a tile.

public event EventHandler<SendingHttpRequestMessageEventArgs> SendingHttpRequest;

ReceivedHttpResponse

Occurs after an HTTP response is received from the tile server.

public event EventHandler<ReceivedHttpResponseMessageEventArgs> ReceivedHttpResponse;

DrawingTile

The event raised before Drawing a tile

public event EventHandler<DrawingTileTileOverlayEventArgs> DrawingTile;

PostedTile

The event raised after Posted a tile

public event EventHandler<PostedTileTileOverlayEventArgs> PostedTile;

CreatingSKTypefaceForCharacter

Raised when a tile needs to resolve a custom for a character that is missing in the default font set.

public event EventHandler<CreatingSKTypefaceForCharacterEventArgs> CreatingSKTypefaceForCharacter;

Drawing

This event raises before the overlay is drawing.

public event EventHandler<DrawingOverlayEventArgs> Drawing;

Drawn

This event raises after the overlay is drawn.

public event EventHandler<DrawnOverlayEventArgs> Drawn;

ChildrenReordered

public event EventHandler ChildrenReordered;

Focused

public event EventHandler<FocusEventArgs> Focused;

MeasureInvalidated

public event EventHandler MeasureInvalidated;

SizeChanged

public event EventHandler SizeChanged;

Unfocused

public event EventHandler<FocusEventArgs> Unfocused;

BatchCommitted

public event EventHandler<EventArg<VisualElement>> BatchCommitted;

FocusChangeRequested

public event EventHandler<FocusRequestArgs> FocusChangeRequested;

Loaded

public event EventHandler Loaded;

Unloaded

public event EventHandler Unloaded;

ChildAdded

public event EventHandler<ElementEventArgs> ChildAdded;

ChildRemoved

public event EventHandler<ElementEventArgs> ChildRemoved;

DescendantAdded

public event EventHandler<ElementEventArgs> DescendantAdded;

DescendantRemoved

public event EventHandler<ElementEventArgs> DescendantRemoved;

ParentChanging

public event EventHandler<ParentChangingEventArgs> ParentChanging;

ParentChanged

public event EventHandler ParentChanged;

HandlerChanging

public event EventHandler<HandlerChangingEventArgs> HandlerChanging;

HandlerChanged

public event EventHandler HandlerChanged;

PropertyChanged

public event PropertyChangedEventHandler PropertyChanged;

PropertyChanging

public event PropertyChangingEventHandler PropertyChanging;

BindingContextChanged

public event EventHandler BindingContextChanged;