1

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.

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.