Class MapSource
Represents the map source that reads the shape source from the local file, URL, stream or embedded resource.
Inheritance
System.Object
MapSource
Namespace: Syncfusion.Maui.Maps
Assembly: Syncfusion.Maui.Maps.dll
Syntax
public class MapSource : Object
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 |
---|---|---|
System.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 |
---|---|---|
System.IO.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 |
---|---|---|
System.IO.Stream | shapeStream | The shapefile stream. |
System.IO.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 |
---|---|---|
System.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(Stream to MapSource)
Method to implicitly check the stream from the xaml.
Declaration
public static implicit operator MapSource(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream. |
Returns
Type |
---|
MapSource |
Implicit(String to MapSource)
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 |
---|---|---|
System.String | source | The source. |
Returns
Type |
---|
MapSource |
Implicit(Uri to MapSource)
Method to implicitly check the string is Uri from the xaml.
Declaration
public static implicit operator MapSource(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | uri | The uri. |
Returns
Type |
---|
MapSource |