Class MapSource
Represents the map source that reads the shape source from the local file, URL, stream or embedded resource.
Inherited Members
Namespace: Syncfusion.Maui.Maps
Assembly: Syncfusion.Maui.Maps.dll
Syntax
public class MapSource
Constructors
MapSource()
Declaration
public MapSource()
Methods
FromFile(string)
Returns a new MapSource that reads from file.
Declaration
public static MapSource FromFile(string file)
Parameters
| Type | Name | Description |
|---|---|---|
| string | file | The file. |
Returns
| Type | Description |
|---|---|
| MapSource | Returns file map source. |
FromStream(Stream)
Returns a new MapSource that reads from json stream.
Declaration
public static MapSource FromStream(Stream jsonStream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | jsonStream | The json stream. |
Returns
| Type | Description |
|---|---|
| MapSource | Returns json stream map source. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"/>
</map:SfMaps.Layer>
</map:SfMaps>
FromStream(Stream, Stream)
Returns a new MapSource that reads from shapefile stream.
Declaration
public static MapSource FromStream(Stream shapeStream, Stream dbfStream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | shapeStream | The shapefile stream. |
| Stream | dbfStream | The dbf stream. |
Returns
| Type | Description |
|---|---|
| MapSource | Returns shape stream map source. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer" />
</map:SfMaps.Layer>
</map:SfMaps>
FromUri(Uri)
Returns a new MapSource that reads from uri.
Declaration
public static MapSource FromUri(Uri uri)
Parameters
| Type | Name | Description |
|---|---|---|
| Uri | uri | The shape source uri. |
Returns
| Type | Description |
|---|---|
| MapSource | Returns uri map source. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json"/>
</map:SfMaps.Layer>
</map:SfMaps>
Operators
implicit operator MapSource(Stream)
Method to implicitly check the stream from the xaml.
Declaration
public static implicit operator MapSource(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream. |
Returns
| Type |
|---|
| MapSource |
implicit operator MapSource(string)
Method to implicitly check the string is Uri or file source from the xaml.
Declaration
public static implicit operator MapSource(string source)
Parameters
| Type | Name | Description |
|---|---|---|
| string | source | The source. |
Returns
| Type |
|---|
| MapSource |
implicit operator MapSource(Uri)
Method to implicitly check the string is Uri from the xaml.
Declaration
public static implicit operator MapSource(Uri uri)
Parameters
| Type | Name | Description |
|---|---|---|
| Uri | uri | The uri. |
Returns
| Type |
|---|
| MapSource |