[Portugal] Re: OpenLayers+WFS+Modified Portuguese Grid (solved)

Luís de Sousa luis.a.de.sousa at gmail.com
Wed Feb 10 16:31:10 EST 2010


Olá a todos,

Estou a tentar usar os serviços do IGP com o código que vem em anexo.
O tema WMS carrega sem problemas, num amarelo que quase não se vê. Mas
o pedido ao WFS não recebe resposta. A Joana indicou há dias ter
conseguido com código muito semelhante. Estará o serviço em baixo?

Obrigado,

Luís


map = new OpenLayers.Map( "map",
{
  maxExtent: new OpenLayers.Bounds(-500000,-500000,500000,500000),
  units: 'm',
  maxResolution: 'auto',
  projection:"EPSG:27492"
} );

var layerWFS = new OpenLayers.Layer.WFS(
 "Distritos WFS",
 "http://mapas.igeo.pt/wfs/caop/continente",
 { typeName: "Distritos",
   extractAttributes: false,
   srs: 'EPSG:27492'
 });
				
var layerBase = new OpenLayers.Layer.WMS(
 "Distritos",
 "http://mapas.igeo.pt/wms/caop/continente",
 {layers: 'Distritos',
  format: 'image/png'
 });

map.addLayer(layerBase);
map.addLayer(layerWFS);
map.zoomToMaxExtent();


2010/1/31 Jo <doublebyte at gmail.com>:
> O erro (bug?) estava em que nao e possivel fazer o set da propriedade
> 'baselayer' no construtor do layer (nao funciona!), mas pode se fazer
> posteriormente; com este codigo, ja funciona (tb faltava definir o
> 'typename')
>
>    var map = new OpenLayers.Map( "map", { maxExtent: new
> OpenLayers.Bounds(-39009.671875,47852.468750,-15311.562500,75956.718750),
> units: 'm', maxResolution: 'auto', projection:"EPSG:27492"} );
>    var layer = new OpenLayers.Layer.WFS( "Distritos",
> "http://mapas.igeo.pt/wfs/caop/continente?", { typeName: "Distritos",
> extractAttributes: false} );
>
>    map.addLayer(layer);
>    map.setBaseLayer(layer);
>    map.zoomToMaxExtent();
>                                                       Joana


More information about the Portugal mailing list