ClassMapSource
Abstract base class for all data sources that provide shapefile data to the MapShapeReader. Provides factory methods to create MapSource instances from various sources including embedded resources, files, streams, and URIs.
Definition
Namespace:Telerik.Maui.Controls.Map
Assembly:Telerik.Maui.Controls.dll
Syntax:
public abstract class MapSource : NotifyPropertyChangedBase, INotifyPropertyChanged
Inheritance: objectNotifyPropertyChangedBaseMapSource
Derived Classes:
Implements:
Inherited Members
Constructors
MapSource()
Declaration
protected MapSource()
Methods
FromFile(string)
Creates a MapSource from a file path on the local file system. Use this method to load shapefiles from the device's storage or application bundle.
FromResource(string, Assembly)
Creates a MapSource from an embedded resource within an assembly. This is the most common way to include shapefile data with your application.
Declaration
public static MapSource FromResource(string resource, Assembly sourceAssembly = null)
Parameters
resource
The full name of the embedded resource containing the shapefile (e.g., "MyApp.Data.world.shp").
sourceAssembly
The assembly containing the embedded resource. If null, uses the calling assembly.
Returns
A MapSource that reads from the specified embedded resource.
FromResource(string, Type)
Creates a MapSource from an embedded resource using a type to resolve the assembly. This is a convenience overload that automatically determines the assembly from the provided type.
Declaration
public static MapSource FromResource(string resource, Type resolvingType)
Parameters
resource
The full name of the embedded resource containing the shapefile.
resolvingType
A type from the assembly containing the embedded resource.
Returns
A MapSource that reads from the specified embedded resource.
FromStream(Stream)
Operators
implicit operator MapSource(Stream)
implicit operator MapSource(string)
Provides implicit conversion from a string file path to a MapSource. This allows direct assignment of file paths to MapSource properties.