I am trying to add a vector layer to a map, wich is working fine if included like this:

var gmlfeature = new OpenLayers.Layer.Vector("GML", {
                      protocol: new OpenLayers.Protocol.HTTP({
                        url: "gmltest.xml",
                        format: new OpenLayers.Format.GML()
                      strategies: [new OpenLayers.Strategy.Fixed()]

map.addLayer( gmlfeature );

I wanted to be able to upload .gml Files to the webpage, though. After parsing the GML content and reprojecting the coordinates, I would like to include the features from a string (wich has the same content as 'gmltest.xml). I tried to follow the method described in this post with no luck. Here is what I've come up with so far: jsFiddle, the Features seem to load but they are not projected as expected. A sample GML can be downloaded here.

  • Why do you have openlayers-3 as a tag, it's version 2? – bartvde Dec 8 '16 at 19:10
  • @Christoph I suggest you merge your two accounts. See this link. – Fezter Dec 9 '16 at 0:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.