)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to add sub shape file layer for ImageryLayer in Xamarin.Forms SfMaps

Platform: Xamarin.Forms |
Control: SfMaps |
Published Date: June 28, 2019 |
Last Revised Date: June 28, 2019

The Layers property in the SfMaps control is used to add imagery layer. Using SubLayers support, you can add sub shape file layer over the imager layer to highlight the map or show the road or river view on map. 

The following code snippet demonstrates how to add sub shape file layer over ImageryLayer.

XAML

<maps:SfMaps >
    <maps:SfMaps.Layers>
        <maps:ImageryLayer> 
            <maps:ImageryLayer.Sublayers>
                <maps:ShapeFileLayer Uri="africa.shp">
                    <maps:ShapeFileLayer.ShapeSettings>
                        <maps:ShapeSetting ShapeFill="Red"/>
                    </maps:ShapeFileLayer.ShapeSettings>
                </maps:ShapeFileLayer>
            </maps:ImageryLayer.Sublayers>           
        </maps:ImageryLayer>
    </maps:SfMaps.Layers>
    
</maps:SfMaps>

 

C#

SfMaps maps = new SfMaps();
ImageryLayer imageryLayer = new ImageryLayer();
ShapeFileLayer shapeFileLayer = new ShapeFileLayer();
shapeFileLayer.Uri = "africa.shp";
shapeFileLayer.ShapeSettings.ShapeFill = Color.Red;
imageryLayer.Sublayers.Add(shapeFileLayer);
maps.Layers.Add(imageryLayer);

 

You can find the sample in the following link: Sample

 

Output:

 

Sub layer of shape file layer using xamarin SfMaps

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon