[OpenLayers-Users] Problem with gml layer.

David Martinez Morata damarmo at gmail.com
Wed Jun 25 09:29:04 EDT 2008


Thanks for your answeres! :)
but now in the same point with gml features changing coordinates in the map.

In options for the mep object I define this projections:

var options = {numZoomLevels: 20,
               projection: new OpenLayers.Projection("EPSG:900913"),
               displayProjection: new OpenLayers.Projection("EPSG:4623")};

and for my GML layer i try with:

map.addLayer(new OpenLayers.Layer.GML("GML",
    "http://10.192.160.133/OpenLayers/ngo9_wgs84_01meu_cables_lille32.gml",
     {format: OpenLayers.Format.GML,
       formatOptions: {
          extractStyles: true,
           extractAttributes: true}
        }
      )
 );

And defining the external and internal projection and alwais the same
problem...my layer in the middle of Atlantic ocean, when I zoom to a
village, the error its minimal, but if I pam to the map the layer chages
location!!!
Any sugestion to fix it?
Thanks

2008/6/25 Christopher Schmidt <crschmidt at metacarta.com>:

> On Wed, Jun 25, 2008 at 02:52:19PM +0200, David Martinez Morata wrote:
> > Hello,
> > I try to put this layer in a map but...
> >
> > map.addLayer(new OpenLayers.Layer.GML("GML",
> >                "
> > http://10.192.160.133/OpenLayers/ngo9_wgs84_01meu_cables_lille32.gml",
> >             {format: OpenLayers.Format.KML},
> >             {formatOptions: {
> >               extractAttributes: true,
> >               internalProjection: new
> OpenLayers.Projection('EPSG:900913'),
> >               externalProjection: new OpenLayers.Projection('EPSG:4326')}
> >               }
> >                )
> >                    );
> > I don't have a graphical image of the elements!!!
> > You have a sugestion?
>
> format and formatOptions are both options to the layer. They belong in
> the same hash/argument, not two different ones.
>
> You don't have extractStyles in your formatOptions. You may need that to
> actually get the styles.
>
> You don't need to define internalProjection and externalProjection:
> instead, just put in a 'projection: new OpenLayers.Projection(4326)'
> option.
>
> Your filename is GML, but your foramt is KML. That seems weird.
>
> Regards,
> --
> Christopher Schmidt
> MetaCarta
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080625/d2f04bbc/attachment.html


More information about the Users mailing list