Feature layers don't display on the map (WPF Application)

6370
21
10-16-2014 03:05 AM
deleted-user-i8mW0s-ySag1
New Contributor

With the release of ArcGIS Runtime SDK 10.2.4, I've read the developer's guide and tried to do the various tutorials.

But I have a problem with the part "Add a feature layer to provide operational data" (https://developers.arcgis.com/net/desktop/guide/access-feature-data-in-the-cloud.htm).

When I add a feature layer on the base map, it doesn't display at all, no matter how I try (by XAML or by code). I even used the layer.InitializationException to check if it was correctly loaded. All I can see is the basemap without the swimming pool permits layer.

For your informations, I'm working with Visual Studio 2013 Express Edition.

Can you please help me to find what I'm doing wrong?

Thanks in advance for your answers.

Here's the code I use for my basic project (WPF Application in Visual Basic):

<Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
    Title="MainWindow" Height="536.596" Width="888.705">
    <Grid>
        <esri:MapView x:Name="MyMapView">
            <esri:Map x:Name="MyMap">
                <esri:ArcGISTiledMapServiceLayer ID="BaseMap"
                    ServiceUri="http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>
                <esri:FeatureLayer ID="PoolPermits">
                    <esri:FeatureLayer.FeatureTable>
                        <esri:ServiceFeatureTable
                           ServiceUri="http://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer/0"/>
                    </esri:FeatureLayer.FeatureTable>
                </esri:FeatureLayer>
                <esri:Map.InitialViewpoint>
                    <esri:ViewpointExtent XMin="-13075816.40"
                   YMin="4014771.46"
                   XMax="-13073005.67"
                   YMax="4016869.78"/>
                </esri:Map.InitialViewpoint>
            </esri:Map>
        </esri:MapView>
    </Grid>
</Window>

Grégoire

0 Kudos
21 Replies
DominiqueBroux
Esri Frequent Contributor

Looks like the PoolPermit feature server<http://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer> is no longer working well.

Even the arcgis.com viewer<http://www.arcgis.com/home/webmap/viewer.html?url=http%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FPoolPermits%2FFeatureServer&source=sd> is not able to display the features.

Error returned by the server:

{"error":{"code":500,"message":"Error performing query operation","details":[]}}

/Dominique

0 Kudos
deleted-user-i8mW0s-ySag1
New Contributor

Indeed, you're right, thanks. But the PoolPermit feature service was working yesterday! I was able to open it directly in arcgis.com.

Homever, my problem remains. I've tried to create an application with internal datas using an

ArcGISDynamicMapServiceLayer and a FeatureLayer (like the example). The first was visible but not the second. And I could see all my features with the ArcGIS.com Map viewer.

0 Kudos
DominiqueBroux
Esri Frequent Contributor

PoolPermit service is up again. I tested your code and it seems working.

Could you try again?

If you are experiencing issue with another services, please share your code so we can reproduce the issue.

Thanks.

0 Kudos
deleted-user-i8mW0s-ySag1
New Contributor

Thank you for your help.

Indeed, The PoolPermit is up again. But my code still doesn't work on my side. For your information, I've created a WPF application (Visual Basic) in Visual Studio Express 2013 (my test platform is on Windows 7). I've pasted my code in the MainWindow.xaml and this is the result I get:

ArcGISRuntimeTest.jpg

Could it be a problem with the Visual "Express" edition? Or with some parameters of the solution? (I've left everything by default) I've also tried a WPF application in C# with the same result.

0 Kudos
AnttiKajanus1
Occasional Contributor III

Have you checked if there is any errors when layer is loaded? You can access to that from MapView.LayerLoaded event.

Also could you check what data is fetched from the server using Fiddler etc.

0 Kudos
deleted-user-i8mW0s-ySag1
New Contributor

Thank you for your tips.

I've tried the mapView.LayerLoaded event and the PoolPermits layer was loaded successfully.

And here's a screenshot of the traffic data through Fiddler:

Fiddler.jpg

Everything seems allright.

0 Kudos
deleted-user-i8mW0s-ySag1
New Contributor

I've opened the tiles under the FeatureServer (in Fiddler) and there isn't any pool drawed on the map (only the base map).

Here's the complete url sent:

/arcgis/rest/services/PoolPermits/FeatureServer/0/query?outFields=objectid%2Chas_pool&outSR=3857&returnGeometry=true&geometry=%7B%22rings%22%3A%5B%5B%5B-13076254.949469188%2C4014763.0498995488%5D%2C%5B-13076254.949469188%2C4016878.190100451%5D%2C%5B-13072567.120530812%2C4016878.190100451%5D%2C%5B-13072567.120530812%2C4014763.0498995488%5D%2C%5B-13076254.949469188%2C4014763.0498995488%5D%5D%5D%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&geometryType=esriGeometryPolygon&inSR=102100&spatialRel=esriSpatialRelIntersects&f=json

0 Kudos
AnttiKajanus1
Occasional Contributor III

What was the response from the server?

I tried the code that you posted in the original post and it seems to work for me. Going to test that in express edition but need to install it first.

Just for kicks, can you try to set CultureInfo to en-US or GB and see if that helps. I assume that you are using some other. Or can you let me know what you are using?

0 Kudos
deleted-user-i8mW0s-ySag1
New Contributor

Here's the response from the Server:

{"objectIdFieldName":"objectid","globalIdFieldName":"","geometryType":"esriGeometryPolygon","spatialReference":{"wkid":102100,"latestWkid":3857},"fields":[{"name":"objectid","alias":"OBJECTID","type":"esriFieldTypeOID"},{"name":"has_pool","alias":"Has_Pool","type":"esriFieldTypeInteger"}],"features":[{"geometry":{"rings":[[[-13073563.808187518,4016000.5893990993],[-13073539.07662103,4015994.5016283691],[-13073500.561194843,4015994.182299681],[-13073501.322782392,4015900.7540653944],[-13073501.607079294,4015893.4926456138],[-13073502.34006433,4015886.2629382163],[-13073503.519120546,4015879.0929854736],[-13073505.139425823,4015872.010486193],[-13073507.195057658,4015865.0431517512],[-13073509.677879972,4015858.2176130638],[-13073512.578285273,4015851.5601492599],[-13073515.021006852,4015846.6929872781],[-13073518.624360956,4015840.3916177973], ...

I've tried to change the CultureInfo to en-US without success. My CultureInfo is "fr-CH".

Thanks for your help.

0 Kudos