ThinkGeoVectorTileOverlay¶
Namespace: ThinkGeo.UI.Maui
ThinkGeo's vector basemap as an overlay: the newer ThinkGeo vector tiles, drawn from a MapLibre style document. The successor to ThinkGeoVectorOverlay.
public class ThinkGeoVectorTileOverlay : TileOverlay, 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 → ThinkGeoVectorTileOverlay
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:
The overlay is a ThinkGeoVectorTileAsyncLayer and the tiling around it: what is drawn is the layer's business, and when, in how many pieces and out of which cache is the overlay's. Changing the style or the background redraws the tiles on screen. A TileOverlay.TileCache is left alone: it holds pictures of the map as one style drew it, so give each style a cache of its own rather than one cache to share.
Fields¶
transientNamescope¶
public INameScope transientNamescope;
Properties¶
ApiKey¶
The apiKey every tile request carries. Required before the first draw; given to the constructor, or set here by XAML.
public string ApiKey { get; set; }
Property Value¶
StyleUri¶
The style document the map is drawn from - its address or its text. ThinkGeoVectorStyles names the published ones, so light and dark are ThinkGeoVectorStyles.Light and ThinkGeoVectorStyles.Dark; any other MapLibre document is given the same way. Light by default. Setting it redraws from the new document without the vector tiles being fetched again.
public string StyleUri { get; set; }
Property Value¶
TransparentBackground¶
Draws the ink and nothing else: every area fill left out and the background left clear, so whatever is underneath shows through. What to put a street map on top of aerial imagery with. False by default.
public bool TransparentBackground { get; set; }
Property Value¶
LabelDisplayMode¶
What the overlay draws: the shapes and the labels (the default), the shapes alone, or the labels alone. With both, the shapes go into the tiles and the labels are drawn once over the whole view on top of them, so no tile edge runs through a label; a single-tile overlay draws both into its one tile. The halves are for two overlays over one map, the shapes in tiles under something of the application's own and the labels above it.
public LabelDisplayMode LabelDisplayMode { get; set; }
Property Value¶
LabelDisplayMode
VectorTileCache¶
Where the vector tiles are kept on disk once they have been downloaded, so that a tile is asked of the server once. Null, the default, keeps nothing. These are the tiles themselves and serve every style; TileOverlay.TileCache holds the pictures drawn from them, which are of one style.
public FileTileCache VectorTileCache { get; set; }
Property Value¶
FileTileCache
WebProxy¶
The proxy the tile requests go through, or null for none.
public IWebProxy WebProxy { get; set; }
Property Value¶
TimeoutInSeconds¶
How long a tile request may take, in seconds; 15 by default.
public int TimeoutInSeconds { get; set; }
Property Value¶
ShowDebugInfo¶
Outlines every vector tile a view was drawn from and writes its zoom, column and row over it. For finding out which tiles a view asks for; false by default.
public bool ShowDebugInfo { get; set; }
Property Value¶
TileWidth¶
Gets or sets the width of the tile.
public int TileWidth { get; set; }
Property Value¶
int
The width of the tile.
TileHeight¶
Gets or sets the height of the tile.
public int TileHeight { get; set; }
Property Value¶
int
The height of the tile.
IsCacheOnly¶
Gets or sets a value indicating whether this instance is cache only.
public bool IsCacheOnly { get; set; }
Property Value¶
bool
true if this instance is cache only; otherwise, false.
TileBuffer¶
Gets or sets the number of extra tile rows and columns drawn around the minimum grid needed to cover the map.
public int TileBuffer { get; set; }
Property Value¶
Remarks:
Increasing this value can reduce blank areas during pan gestures because tiles just outside the viewport are already drawn. The default value is 0.
CurrentZoomTileCacheCapacity¶
Gets or sets the maximum number of current zoom tile views retained in memory.
public int CurrentZoomTileCacheCapacity { get; set; }
Property Value¶
Remarks:
Retained tile views can be reused during pan gestures to reduce blank areas while newly requested tiles are still drawing. The default value is 8.
ZoomOutTileCacheCapacity¶
Gets or sets the maximum number of zoom-out tile views retained in memory.
public int ZoomOutTileCacheCapacity { get; set; }
Property Value¶
Remarks:
Retained zoom-out tile views can be stretched temporarily during zoom or fast pan gestures until current zoom tiles are available. The default value is 16.
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¶
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.
TileCache¶
Gets or sets the tile cache.
public RasterTileCache TileCache { get; set; }
Property Value¶
RasterTileCache
The tile cache.
TileType¶
Gets and sets the overlay is formed by multiple tiles or single tile.
public TileType TileType { get; set; }
Property Value¶
TileType
The type of the tile.
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¶
Attribution¶
Gets the attribution text displayed for this overlay.
public string Attribution { get; protected set; }
Property Value¶
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¶
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¶
Count¶
public int Count { get; }
Property Value¶
IsReadOnly¶
public bool IsReadOnly { get; }
Property Value¶
Item¶
public IView Item { get; set; }
Property Value¶
IsClippedToBounds¶
public bool IsClippedToBounds { get; set; }
Property Value¶
Padding¶
public Thickness Padding { get; set; }
Property Value¶
SafeAreaEdges¶
public SafeAreaEdges SafeAreaEdges { get; set; }
Property Value¶
IgnoreSafeArea¶
public bool IgnoreSafeArea { get; set; }
Property Value¶
CascadeInputTransparent¶
public bool CascadeInputTransparent { get; set; }
Property Value¶
GestureRecognizers¶
public IList<IGestureRecognizer> GestureRecognizers { get; }
Property Value¶
HorizontalOptions¶
public LayoutOptions HorizontalOptions { get; set; }
Property Value¶
Margin¶
public Thickness Margin { get; set; }
Property Value¶
VerticalOptions¶
public LayoutOptions VerticalOptions { get; set; }
Property Value¶
Visual¶
public IVisual Visual { get; set; }
Property Value¶
FlowDirection¶
public FlowDirection FlowDirection { get; set; }
Property Value¶
Window¶
public Window Window { get; }
Property Value¶
AnchorX¶
public double AnchorX { get; set; }
Property Value¶
AnchorY¶
public double AnchorY { get; set; }
Property Value¶
BackgroundColor¶
public Color BackgroundColor { get; set; }
Property Value¶
Background¶
public Brush Background { get; set; }
Property Value¶
Behaviors¶
public IList<Behavior> Behaviors { get; }
Property Value¶
Bounds¶
public Rect Bounds { get; }
Property Value¶
Height¶
public double Height { get; }
Property Value¶
HeightRequest¶
public double HeightRequest { get; set; }
Property Value¶
InputTransparent¶
public bool InputTransparent { get; set; }
Property Value¶
IsEnabled¶
public bool IsEnabled { get; set; }
Property Value¶
IsFocused¶
public bool IsFocused { get; }
Property Value¶
IsVisible¶
public bool IsVisible { get; set; }
Property Value¶
MinimumHeightRequest¶
public double MinimumHeightRequest { get; set; }
Property Value¶
MinimumWidthRequest¶
public double MinimumWidthRequest { get; set; }
Property Value¶
MaximumHeightRequest¶
public double MaximumHeightRequest { get; set; }
Property Value¶
MaximumWidthRequest¶
public double MaximumWidthRequest { get; set; }
Property Value¶
Opacity¶
public double Opacity { get; set; }
Property Value¶
Rotation¶
public double Rotation { get; set; }
Property Value¶
RotationX¶
public double RotationX { get; set; }
Property Value¶
RotationY¶
public double RotationY { get; set; }
Property Value¶
Scale¶
public double Scale { get; set; }
Property Value¶
ScaleX¶
public double ScaleX { get; set; }
Property Value¶
ScaleY¶
public double ScaleY { get; set; }
Property Value¶
TranslationX¶
public double TranslationX { get; set; }
Property Value¶
TranslationY¶
public double TranslationY { get; set; }
Property Value¶
Triggers¶
public IList<TriggerBase> Triggers { get; }
Property Value¶
Width¶
public double Width { get; }
Property Value¶
WidthRequest¶
public double WidthRequest { get; set; }
Property Value¶
X¶
public double X { get; }
Property Value¶
Y¶
public double Y { get; }
Property Value¶
Clip¶
public Geometry Clip { get; set; }
Property Value¶
Batched¶
public bool Batched { get; }
Property Value¶
DisableLayout¶
public bool DisableLayout { get; set; }
Property Value¶
IsInPlatformLayout¶
public bool IsInPlatformLayout { get; set; }
Property Value¶
IsPlatformStateConsistent¶
public bool IsPlatformStateConsistent { get; set; }
Property Value¶
IsPlatformEnabled¶
public bool IsPlatformEnabled { get; set; }
Property Value¶
Resources¶
public ResourceDictionary Resources { get; set; }
Property Value¶
Frame¶
public Rect Frame { get; set; }
Property Value¶
Handler¶
public IViewHandler Handler { get; set; }
Property Value¶
Shadow¶
public Shadow Shadow { get; set; }
Property Value¶
ZIndex¶
public int ZIndex { get; set; }
Property Value¶
DesiredSize¶
public Size DesiredSize { get; protected set; }
Property Value¶
IsLoaded¶
public bool IsLoaded { get; }
Property Value¶
Navigation¶
public INavigation Navigation { get; internal set; }
Property Value¶
NavigationProxy¶
public NavigationProxy NavigationProxy { get; }
Property Value¶
Style¶
public Style Style { get; set; }
Property Value¶
StyleClass¶
public IList<string> StyleClass { get; set; }
Property Value¶
class¶
public IList<string> class { get; set; }
Property Value¶
AutomationId¶
public string AutomationId { get; set; }
Property Value¶
ClassId¶
public string ClassId { get; set; }
Property Value¶
Effects¶
public IList<Effect> Effects { get; }
Property Value¶
Id¶
public Guid Id { get; }
Property Value¶
StyleId¶
public string StyleId { get; set; }
Property Value¶
LogicalChildren¶
public ReadOnlyCollection<Element> LogicalChildren { get; }
Property Value¶
RealParent¶
public Element RealParent { get; }
Property Value¶
Parent¶
public Element Parent { get; set; }
Property Value¶
EffectControlProvider¶
public IEffectControlProvider EffectControlProvider { get; set; }
Property Value¶
Handler¶
public IElementHandler Handler { get; set; }
Property Value¶
Dispatcher¶
public IDispatcher Dispatcher { get; }
Property Value¶
BindingContext¶
public object BindingContext { get; set; }
Property Value¶
Constructors¶
ThinkGeoVectorTileOverlay()¶
Initializes a new instance with no apiKey yet - for XAML, which constructs first and sets properties after. ThinkGeoVectorTileOverlay.ApiKey must be set before the first draw.
public ThinkGeoVectorTileOverlay()
ThinkGeoVectorTileOverlay(string)¶
Initializes a new instance over the published WorldStreets tiles, drawn in the light style.
public ThinkGeoVectorTileOverlay(string apiKey)
Parameters¶
apiKey string
Your ThinkGeo apiKey; every tile request carries it.
ThinkGeoVectorTileOverlay(string, string)¶
Initializes a new instance over the published WorldStreets tiles, drawn from the style document given.
public ThinkGeoVectorTileOverlay(string apiKey, string styleUri)
Parameters¶
apiKey string
Your ThinkGeo apiKey; every tile request carries it.
styleUri string
The style document: see .
Methods¶
GetBoundingBoxCore()¶
protected RectangleShape GetBoundingBoxCore()
Returns¶
RectangleShape
GetTileCore()¶
protected TileView GetTileCore()
Returns¶
OpenAsyncCore(IMapView, CancellationToken)¶
protected Task OpenAsyncCore(IMapView mapView, CancellationToken cancellationToken)
Parameters¶
mapView IMapView
cancellationToken CancellationToken
Returns¶
CloseAsyncCore(CancellationToken)¶
protected Task CloseAsyncCore(CancellationToken cancellationToken)
Parameters¶
cancellationToken CancellationToken
Returns¶
DrawAsyncCore(OverlayRefreshType, CancellationToken)¶
protected Task DrawAsyncCore(OverlayRefreshType refreshType, CancellationToken cancellationToken)
Parameters¶
refreshType OverlayRefreshType
cancellationToken CancellationToken
Returns¶
DrawWithoutPostingAsyncCore(OverlayRefreshType, CancellationToken)¶
protected Task DrawWithoutPostingAsyncCore(OverlayRefreshType refreshType, CancellationToken cancellationToken)
Parameters¶
refreshType OverlayRefreshType
cancellationToken CancellationToken
Returns¶
PostAsyncCore(CancellationToken)¶
protected Task PostAsyncCore(CancellationToken cancellationToken)
Parameters¶
cancellationToken CancellationToken
Returns¶
TransformCore(RectangleShape, IMapView)¶
protected void TransformCore(RectangleShape extent, IMapView mapView)
Parameters¶
extent RectangleShape
mapView IMapView
Returns¶
Events¶
SendingHttpRequest¶
Raised before each tile request is sent: rewrite the request, or set Cancel to skip it.
public event EventHandler<SendingHttpRequestMessageEventArgs> SendingHttpRequest;
ReceivedHttpResponse¶
Raised when a tile response has arrived, before its status is read.
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 SKTypeface 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;