[Portugal] duvidas sobre openlayers

Pedro Costa pedrocostaarma sapo.pt
Quinta-Feira, 1 de Dezembro de 2011 - 07:41:57 EST


Pessoal será que podiam ajudar-me com as seguintes dúvidas do 
openlayeres, as dúvidas são relativas ao exemplo disponivel aqui:

http://geobox.geospot.pt/pt/index.php/Edi%C3%A7%C3%A3o_com_OpenLayers


*1)  O que sgnificam estas diferentes partes do código:*

<link  rel="stylesheet"  href="/openlayers/theme/default/style.css"  type="text/css"  />


OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";


*2) Porquê é que aqui a classe map é nula?*

var map = null;

*3) NO exemplo em questão que segue em baixo, temos de por o schema para o layer do geoserver em questão, trata-se de
  um url? Como posso descobrir url para o layer que pretendo? Tentei trocar o nome deste exemplo (participante)
  por um layer que tenho e colar no browser mas não abre nada...
POdem dar-me uma dicas?


4)Quando devo utilizar a livraria do openlayers no localhost e quando devo utilizar a online?Tanto faz ou quais as vantagens
de um e de outro?


Obrigado
Bom feriado a todos
*







<html  xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>Participantes</title>
		<meta  http-equiv="Content-Type"  content="text/html; charset=UTF-8"  />
		<link  rel="stylesheet"  href="/openlayers/theme/default/style.css"  type="text/css"  />
		<script  src="/openlayers/OpenLayers.js"></script>
		<script  type="text/javascript">		
			OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";
			var map = null;
			function init() {
				var bounds = new OpenLayers.Bounds(
				-23941, 208039,
				-21480, 210148
				);
				var options = {
					controls: [ new OpenLayers.Control.Navigation(), new OpenLayers.Control.PanZoom(), new OpenLayers.Control.LayerSwitcher()],
					maxExtent: bounds,
					maxResolution: 9.61328125,
					projection: "EPSG:3763",
					units: 'm'
				};
				map = new OpenLayers.Map('map', options);
				var wms = new OpenLayers.Layer.WMS(
				"WMS Participantes", "http://localhost:8080/geoserver/wms", {
					layers: 'topp:participante',
				}, { }
				);
				var wfs = new OpenLayers.Layer.Vector("WFS Participantes", {
					strategies: [new OpenLayers.Strategy.BBOX()],
					protocol: new OpenLayers.Protocol.WFS({
						version: "1.1.0",
						srsName: "EPSG:3763",
						url: "http://localhost:8080/geoserver/wfs",
						featureType: "participante",
						featureNS: "http://www.openplans.org/topp",
						geometryName: "the_geom",
						schema: "http://localhost:8080/geoserver/topp/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=topp:participante",
					})
				});
				map.addLayers([wms, wfs]);
				map.zoomToMaxExtent();
			}
		</script>
	</head>
	<body  onload="init()">
		<h1  id="title">Participantes</h1>
		<div  id="map"  class="smallmap">
		</div>
	</body>
</html>


-------------- próxima parte ----------
Um anexo em HTML foi limpo...
URL: http://lists.osgeo.org/pipermail/portugal/attachments/20111201/9505a706/attachment.html


Mais informações acerca da lista Portugal