Sorry about the images. I can't take code as text out of the development environment.
We are converting an old system based on version 10 to the latest 100 version. When using a shapefile as a layer using this code:
We get this. But...
using the same files but the older version of the API I get the following. It looks like the projection is okay but the extent is messed up. How do I match the extent of the shapefile with the base-map?
Thanks so much for any help!
In the 100.x generation Shapefiles are now supported directly by the ArcGIS Runtime API, without needing to go via the Local Server component. While it's not directly solving the question, I'd recommend trying this approach.
For API ref and sample code see https://developers.arcgis.com/net/wpf/api-reference/html/T_Esri_ArcGISRuntime_Data_ShapefileFeatureT...
Thanks for your speedy reply.
Looking at your reply and the code I sent leaves me a bit confused. I am not using LocalServer. In fact I got the code I am using from the page you recommended.
I assumed that the line:
await MyMapView.SetViewpointGeometryAsync(newFeatureLayer.FullExtent, 50);
Would set the width and height of the shape file or the basemap so that they match. I know that the API does not re-project the shapefile so you have to make sure that the projections are the same but that doesn't appear to be the issue here (They are both WKID:4269). There has to be a way somehow to make the two use the same starting dimensions.
Sorry - I read the first part involving "_emptyMpkPath" and assumed you were using the Local Server.
You are of course correct: you are using the direct API when using ShapefileFeatureTable.
The API should re-project on-the-fly to match the spatial reference of the map.
Possibly you need the additional 'Project Engine' files? (this is a guess, but worth a try I think)
Take a look at this topic which explains the additional PE files: https://developers.arcgis.com/net/spatial-and-data-analysis/spatial-references/
Looking at the two layers as I try to display them I see the following WKTEXT for the map and for the layer I am about to add.
Once I add the layer AllLayers looks like the following.
Does that look right?