How can I show the geometries from a GML file using a specific format? The problem is that Nothing is shown. No error messages.
In my Angular project, I first set the specific projection.
proj4.defs("EPSG:28992", "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.040,49.910,465.840,-0.40939,0.35971,-1.86849,4.0772 +units=m +no_defs");
register(proj4)
this.dutchProjection = GetProjection('EPSG:28992');
This is how I read the GML file (without errors):
this.gmlFeatures = new GML3().readFeatures(this.fileText, {
featureProjection: 'EPSG:28992', dataProjection: 'EPSG:28992' });
Finally I found the solution.
Special about the solution is: it contains a specific projection and using GML3!
Step 1 - Loading the features from a file.
Step 1.A: Define the specific projection first
Define the specific projection:
Step 1.B: Load the features.
In this case I read from a file, but it could be reading from URL. It is important to first define the projection, otherwise you get Axis error message, etc.
Step 2 - show the read feature collection
I used a specific Map/Projection of the Netherlands. You can easily exchange that with an OSM variant.
And the adding of the features:
Example file: