# FeatureLayer doesn't display

**URL:** <https://community.thinkgeo.com/t/featurelayer-doesnt-display/10300>\
**Category:** Blazor\
**Created:** [January 12, 2023, 2:02am UTC](https://community.thinkgeo.com/t/featurelayer-doesnt-display/10300 "2023-01-12T02:02:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![willson\_sam](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@willson\_sam](https://community.thinkgeo.com/u/willson_sam)\
**Post date:** [January 12, 2023, 2:02am UTC](https://community.thinkgeo.com/t/featurelayer-doesnt-display/10300/1 "2023-01-12T02:02:39Z")

</div>

I have built a Blazor Map.  
This is the code.

```
@page "/"
<div class="mapview">
    <MapView Id="map" @ref="@map" MapUnit="@mapUnit" MapViewSizeUnitType="MapViewSizeUnitType.Percentage" Center="@centerPoint"
    Zoom="@zoomInt" Width="100" Height="100" OnCurrentExtentChanged="@OnMapExtentChanged" OnMouseMove="@OnMouseMoveEvent">
        <OverlaysSetting>
            <LayerOverlay Id="vectorLayer" Layers="@vectorLayers"></LayerOverlay>
        </OverlaysSetting>
        <MapToolsSetting>
            <MapTools>
                <ZoomBarMapTool Location="ZoomBarLocation.UpperRight"></ZoomBarMapTool>
            </MapTools>
        </MapToolsSetting>
    </MapView>
</div>
<div class="sidebar"></div>

@code{
    private MapView? map;
    private PointShape centerPoint = new PointShape(-8137421, 5133000);
    private int zoomInt = 3;
    private GeographyUnit mapUnit = GeographyUnit.Meter;
    GeoCollection<Layer> vectorLayers = new GeoCollection<Layer>();

    protected override void OnInitialized()
    {
        base.OnInitialized();
        string ConectionStr = "Data Source=(localdb)\\MSSQLLocalDB;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False";
        SqlServerFeatureLayer torringtonLayer = new SqlServerFeatureLayer(ConectionStr, "Vector_Worldcountries", "ID");
        torringtonLayer.Name = "TorringtonVectorLayer";
        torringtonLayer.FeatureSource.ProjectionConverter = new ProjectionConverter(Projection.GetWgs84ProjString(), Projection.GetSphericalMercatorProjString());
        //torringtonLayer.FeatureSource.ProjectionConverter = new ProjectionConverter(2234, 3857);

        torringtonLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = new AreaStyle(new GeoSolidBrush(GeoColor.FromArgb(50, GeoColors.Orange)));
        //torringtonLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = new TextStyle("Portal_Name", new GeoFont("Arial", 14), new GeoSolidBrush(GeoColor.FromHtml("#21FF00")));
        //torringtonLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.YOffsetInPixel = 5;
        torringtonLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.FillBrush = new GeoSolidBrush(GeoColor.FromArgb(50, GeoColors.Orange));
        torringtonLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen = new GeoPen(GeoColors.Red);
        torringtonLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

        vectorLayers.Add(torringtonLayer);
    }
    private void OnMapExtentChanged(CurrentExtentChangedMapViewEventArgs args)
    {

    }
    private void OnMouseMoveEvent(MouseMovingMapViewEventArgs args)
    {
        
    }
}

```

But, In my browser doesn’t display.  
The country layer that previously appeared on the map no longer suddenly doesn’t appear.

 ![image](https://community.thinkgeo.com/uploads/default/original/3X/6/b/6b99e1885bc578bd521f501bfc0a9d6b71c059dc.png)

---

<div class="post-metadata">

**Author:** ![Leo\_Liu](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/leo_liu/32/25689_2.png) [@Leo\_Liu](https://community.thinkgeo.com/u/Leo_Liu)\
**Post date:** [January 17, 2023, 12:38pm UTC](https://community.thinkgeo.com/t/featurelayer-doesnt-display/10300/2 "2023-01-17T12:38:07Z")

</div>

hi @willson_sam,

Your code looks good, maybe you could check if your projection works. And did you see any errors?

Thanks,  
Leo

---

<div class="post-metadata">

**Author:** ![willson\_sam](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@willson\_sam](https://community.thinkgeo.com/u/willson_sam)\
**Post date:** [January 17, 2023, 12:48pm UTC](https://community.thinkgeo.com/t/featurelayer-doesnt-display/10300/3 "2023-01-17T12:48:48Z")

</div>

Thanks Leo.  
I have resolved that.  
It was my fault.  
In the connection string, there was no database name string.

---

<div class="post-metadata">

**Author:** ![Kyle\_Day](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/kyle_day/32/25613_2.png) [@Kyle\_Day](https://community.thinkgeo.com/u/Kyle_Day)\
**Post date:** [January 24, 2023, 4:42pm UTC](https://community.thinkgeo.com/t/featurelayer-doesnt-display/10300/4 "2023-01-24T16:42:22Z")

</div>

Hey @willson_sam,

Ok, glad that you got the issue resolved. Closing.

Thanks,  
Kyle
