Viva Pedro,<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div bgcolor="#FFFFFF" text="#000000">
    Como fixar o zoom com base numa unica layer de modo a que não seja
    possivel mover o mapa para além desse mesmo layer?Mesmo que exista
    outros com áreas superiores.<br>
    <br></div></blockquote><div><br></div><div>Existem alguns métodos para obter o Extent dos dados da layer em questão, veja em:</div><div><a href="http://dev.openlayers.org/docs/files/OpenLayers/Layer-js.html#OpenLayers.Layer.getExtent">http://dev.openlayers.org/docs/files/OpenLayers/Layer-js.html#OpenLayers.Layer.getExtent</a></div>
<div><br></div><div>No caso dos WMS, os &quot;dados&quot; devolvidos são apenas imagens, e pode centrar o mapa com recurso a map.setCenter()</div><div><a href="http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html#OpenLayers.Map.setCenter">http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html#OpenLayers.Map.setCenter</a></div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div bgcolor="#FFFFFF" text="#000000">
    <br>
    Adicionando layer como wms/png é possível depois editar (como
    vectores) e adicionar eventos com base em mouse events?<br>
    <br></div></blockquote><div><br></div><div>O serviço WMS apenas devolve imagens, não devolve dados vectoriais. É possivel adicionar eventos ao mapa. Procure nos exemplos por events.</div><div><a href="http://openlayers.org/dev/examples/">http://openlayers.org/dev/examples/</a></div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div bgcolor="#FFFFFF" text="#000000">
    <br>
    Devido a ter muitas camadas parte do layer switcher fica oculto como
    posso resolver este problema sem ter de aumentar ao tamanho da
    pagina?é possivel fixar-lo no canto superior esquerdo?(mais para
    cima) e colocar o tamanho das letras mais pequeno?<br>
    <br></div></blockquote><div><br></div><div>Existem várias formas de custumizar o Layer Switcher. Uma delas é alterar o respectivo CSS; pode ainda criar o seu próprio Layer Switcher.</div><div>Por exemplo com a framework GeoExt pode criar uma árvore de camadas. <a href="http://api.geoext.org/1.0/examples/tree.html">http://api.geoext.org/1.0/examples/tree.html</a></div>
<div>Ou simplesmente pode esconder algumas das suas layers utilizando a opção <b>displayInLayerSwitcher: false;</b></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#FFFFFF" text="#000000">
    <br>
    Como posso ajustar automaticamente o tamanho da janela do openlayers
    ao tamanho da pagina?<br>
    <br></div></blockquote><div><br></div><div>Basicamente é definir no CSS a largura e altura da div #map para 100%.</div><div><a href="http://openlayers.org/dev/examples/fullScreen.html">http://openlayers.org/dev/examples/fullScreen.html</a></div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    Obrigado<div><div class="h5"><br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    On 02-12-2011 17:21, Jorge de Jesus wrote:
    <blockquote type="cite">
      
      Oi<br>
      <br>
      Normalmente uso o Google Earth, a unica chatice eh que tens de ter
      o WMS com suporte para o sistema EPSG:900913 (Spherical Mercator),
      ou entao tens de usar OpenLayer.Layer.TMS que funciona como uma
      proxy para o WMS<br>
      <br>
      Se queres um exemplo ve este site:<br>
      <a href="http://rsg.pml.ac.uk/wps/example/index.html" target="_blank">http://rsg.pml.ac.uk/wps/example/index.html</a><br>
      <br>
      Da uma vista de olhos  ao codigo que podes descarregar num
      ficheiro comprimido<br>
      <br>
      Bom fim de semana, eu vou beber umas pints<br>
      <br>
      Jorge<br>
      <br>
      <br>
      On 02/12/11 17:15, Pedro Costa wrote:
      <blockquote type="cite">
        
        Pois não tem muita lógica, estou só a testar a ver se aprendo
        alguma coisa :-).<br>
        <br>
        Qual camada é que costumas usar como base layer? Tenho de
        encontrar uma simples...<br>
        <br>
        Obrigado, vou seguir as dicas<br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        On 02-12-2011 15:31, Jorge de Jesus wrote:
        <blockquote type="cite">
          
          <br>
          Oi<br>
          <br>
          Um conselho, tenta usar o pastbin (<a href="http://pastebin.com/" target="_blank">http://pastebin.com/</a>)
          assim mandas so um link em vez de uma catrafada de javascript<br>
          <br>
          O que se passa em e&#39; que ao selectionares a camada OSM ela
          fica sobreposta a camada wms_ruas e deixas de ver, o que e&#39;
          logico :)<br>
          <br>
          Talvez a solucao seja adicional as propriedades da camada OSM
          algum valor de transparencia (&#39;opacity&#39;: 0.5)<br>
          <br>
          Mas uma pergunta, pelo que vejo tens uma baseLayer que bem de
          um WMS + uma camada com Ruas, nao consiguo percebe a utilidade
          da OSM.<br>
          <br>
          Nao basta usar a OSM como baseLayer + WMS_ruas ?<br>
          <br>
          Normalmente o uso mais comum do OpenLayers e&#39; teres uma image
          raster e depois em cima varias camadas vectoriais, ja que nas
          camadas vectoriais e&#39; mais facil de modificar as
          transparencias de cada objecto<br>
          <br>
          Alguem tem mais ideas, sugestoes ?<br>
          Jorge<br>
          <br>
          On 02/12/11 15:20, Pedro Costa wrote:
          <blockquote type="cite">
            
            Tentei assim:<br>
            <br>
            <br>
            &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>
            &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
            &quot;DTD/xhtml1-strict.dtd&quot;&gt;<br>
            &lt;html xmlns=<a href="http://www.w3.org/1999/xhtml" target="_blank">&quot;http://www.w3.org/1999/xhtml&quot;</a>&gt;<br>
                &lt;head&gt;<br>
                    &lt;title&gt;O meu primeiro mapa&lt;/title&gt;<br>
                    &lt;meta http-equiv=&quot;Content-Type&quot;
            content=&quot;text/html; charset=UTF-8&quot; /&gt;<br>
                    &lt;script src=<a href="http://openlayers.org/api/OpenLayers.js" target="_blank">&quot;http://openlayers.org/api/OpenLayers.js&quot;</a>&gt;&lt;/script&gt;<br>
                    &lt;script type=&quot;text/javascript&quot;&gt;<br>
                        var map;<br>
                        function init() {<br>
            <br>
                            var bounds = new OpenLayers.Bounds(<br>
                            -15699, 188532, -13689, 190828);<br>
            <br>
                            var options = {<br>
                                controls: [ new
            OpenLayers.Control.Navigation(),<br>
                                                    new
            OpenLayers.Control.PanZoom(),<br>
                                                    new
            OpenLayers.Control.LayerSwitcher()],<br>
                                maxExtent: bounds,<br>
                                maxResolution: <a href="tel:9.61328125" value="+351961328125" target="_blank">9.61328125</a>,<br>
                                projection: &quot;EPSG:27492&quot;,<br>
                                units: &#39;m&#39;<br>
            <br>
            };<br>
            <br>
                            map = new OpenLayers.Map(&#39;map&#39;, options);<br>
                            var wms_ruas = new OpenLayers.Layer.WMS(<br>
                       &quot;ruas&quot;,<br>
                       <a href="http://localhost:8080/geoserver/wms" target="_blank">&quot;http://localhost:8080/geoserver/wms&quot;</a>,<br>
                       {&#39;layers&#39;: &#39;Vizela:ruas&#39;, &#39;format&#39;:&#39;image/png&#39;,<br>
            &#39;transparent&#39;:&#39;true&#39;,strategies:[new
            OpenLayers.Strategy.Fixed()]},<br>
                       {&#39;opacity&#39;: 1.0, &#39;isBaseLayer&#39;: false,
            &#39;visibility&#39;: true}<br>
                  );<br>
            <br>
            <br>
                            <br>
                var wms_base = new OpenLayers.Layer.WMS(<br>
                       &quot;base&quot;,<br>
                       <a href="http://localhost:8080/geoserver/wms" target="_blank">&quot;http://localhost:8080/geoserver/wms&quot;</a>,<br>
                       {&#39;layers&#39;: &#39;Vizela:base&#39;, &#39;format&#39;:&#39;image/png&#39;,<br>
            &#39;transparent&#39;:&#39;true&#39;,strategies:[new
            OpenLayers.Strategy.Fixed()]},<br>
                       {&#39;opacity&#39;: 1.0, &#39;isBaseLayer&#39;: true,
            &#39;visibility&#39;: true}<br>
                  );<br>
            <br>
            var osm_layer = new OpenLayers.Layer.OSM(<br>
                            &#39;OpenStreetMap Layer&#39;<br>
                            );<br>
            <br>
                           <br>
                           
            map.addLayers([wms_base,osm_layer,wms_ruas]);<br>
                            if(!map.getCenter()) {<br>
                                map.zoomToMaxExtent();<br>
                            }<br>
                        }<br>
                    &lt;/script&gt;<br>
                &lt;/head&gt;<br>
                &lt;body onload=&#39;init();&#39;&gt;<br>
                    &lt;h1&gt;Mapa mundo&lt;/h1&gt;<br>
                    &lt;div id=&#39;map&#39; style=&#39;width: 500px; height:
            500px;&#39;&gt;<br>
                    &lt;/div&gt;<br>
                &lt;/body&gt;<br>
            &lt;/html&gt;<br>
            <br>
            <br>
            <br>
            <br>
            <br>
            E funciona no entanto quando seleciono a camada OSM deixo de
            conseguir ver as ruas...Existe alguma propriedade para mudar
            isto?Tenho de colocar o layer osm transparente?<br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            On 02-12-2011 14:33, Jorge de Jesus wrote:
            <blockquote type="cite">
              
              Vou responder a este email e ao outro que mandaste<br>
              <br>
              Nunca trabalhei com OSM, acho que e&#39; uma classe que e&#39;
              herdada de OpenLayers.Layer.XYZ portanto tera as mesmos
              options.<br>
              <a href="http://wiki.openstreetmap.org/wiki/OpenLayers_Simple_Example" target="_blank">http://wiki.openstreetmap.org/wiki/OpenLayers_Simple_Example</a><br>
              <br>
              Podes meter a layer onde quiseres sem grandes problemas,
              ate podes chegar a este ponto:<br>
              <br>
              map.addLayer(new OpenLayers.Layer.OSM());<br>
              <br>
              Eu nao sei o que estas a tentar fazer mas penso que queras
              que OSM seja a baseLayer ? Talvez isto funcione ?<br>
              <br>
              map.addLayer(new
              OpenLayers.Layer.OSM(options={&#39;isBaseLayer&#39;:true}));<br>
              <br>
              Quanto ao erro:<br>
              <br>
              <br>
              <div><span></span><span>layer.div
                  is undefined</span></div>
              <span></span>
              <div><a title="layer.div.className=&quot;olLayerDiv&quot;;layer.div.style.overflow=&quot;&quot;;this.setLayerZIndex(layer,this.layers.length);if(layer.isFixed){this.viewPortDiv.appendChild(layer.div);}else{this.layerContainerDiv.appendChild(layer.div);}">layer.div.className=&quot;olLayerDiv&quot;;layer...ContainerDiv.appendChild(layer.div);}<br>

                  <br>
                  o problema esta aqui:<br>
                  <br>
                  map.<b>addLayer</b>([wms_ruas, wms_base]);<br>
                  <br>
                  addLayer --&gt; Adiciona 1 layer e a funcao aceita um
                  Layer Object <br>
                  <br>
                  No teu caso estas a mandar uma lista de layers <br>
                  <br>
                  Tens de usar o metodo addLayers que aceita uma array
                  com layer<br>
                  <br>
                </a><a title="layer.div.className=&quot;olLayerDiv&quot;;layer.div.style.overflow=&quot;&quot;;this.setLayerZIndex(layer,this.layers.length);if(layer.isFixed){this.viewPortDiv.appendChild(layer.div);}else{this.layerContainerDiv.appendChild(layer.div);}">map.<b>addLayers</b>([wms_ruas,




                  wms_base]);</a><a title="layer.div.className=&quot;olLayerDiv&quot;;layer.div.style.overflow=&quot;&quot;;this.setLayerZIndex(layer,this.layers.length);if(layer.isFixed){this.viewPortDiv.appendChild(layer.div);}else{this.layerContainerDiv.appendChild(layer.div);}"><br>

                </a></div>
              <br>
              Agora tudo ao molho (e fe&#39; em Deus) !!!<br>
              <br>
              <a title="layer.div.className=&quot;olLayerDiv&quot;;layer.div.style.overflow=&quot;&quot;;this.setLayerZIndex(layer,this.layers.length);if(layer.isFixed){this.viewPortDiv.appendChild(layer.div);}else{this.layerContainerDiv.appendChild(layer.div);}">map.<b>addLayers</b>([wms_ruas,



                wms_base,new OpenLayers.Layer.OSM() ]);</a><br>
              <br>
              <br>
              E tudo por agora mais duvida ?! ^_^ <br>
              <br>
              Eu normalmente estou no free.node.irc no canal #pywps<br>
              <br>
              Jorge<br>
              <br>
              <br>
              On 02/12/11 12:51, Pedro Costa wrote:
              <blockquote type="cite">
                
                Jorge ajuda-me também no seguinte sff, estou a tentar
                agora adicionar um layer osm no código em baixo:<br>
                <br>
                <br>
                &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>
                &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD XHTML 1.0
                Strict//EN&quot; &quot;DTD/xhtml1-strict.dtd&quot;&gt;<br>
                &lt;html xmlns=<a href="http://www.w3.org/1999/xhtml" target="_blank">&quot;http://www.w3.org/1999/xhtml&quot;</a>&gt;<br>
                    &lt;head&gt;<br>
                        &lt;title&gt;O meu primeiro mapa&lt;/title&gt;<br>
                        &lt;meta http-equiv=&quot;Content-Type&quot;
                content=&quot;text/html; charset=UTF-8&quot; /&gt;<br>
                        &lt;script src=<a href="http://openlayers.org/api/OpenLayers.js" target="_blank">&quot;http://openlayers.org/api/OpenLayers.js&quot;</a>&gt;&lt;/script&gt;<br>
                        &lt;script type=&quot;text/javascript&quot;&gt;<br>
                            var map;<br>
                            function init() {<br>
                <br>
                                var bounds = new OpenLayers.Bounds(<br>
                                -15699, 188532, -13689, 190828);<br>
                <br>
                                var options = {<br>
                                    controls: [ new
                OpenLayers.Control.Navigation(),<br>
                                                        new
                OpenLayers.Control.PanZoom(),<br>
                                                        new
                OpenLayers.Control.LayerSwitcher()],<br>
                                    maxExtent: bounds,<br>
                                    maxResolution: <a href="tel:9.61328125" value="+351961328125" target="_blank">9.61328125</a>,<br>
                                    projection: &quot;EPSG:27492&quot;,<br>
                                    units: &#39;m&#39;<br>
                <br>
                };<br>
                <br>
                                map = new OpenLayers.Map(&#39;map&#39;,
                options);<br>
                                var wms_ruas = new OpenLayers.Layer.WMS(<br>
                           &quot;ruas&quot;,<br>
                           <a href="http://localhost:8080/geoserver/wms" target="_blank">&quot;http://localhost:8080/geoserver/wms&quot;</a>,<br>
                           {&#39;layers&#39;: &#39;Vizela:ruas&#39;,
                &#39;format&#39;:&#39;image/png&#39;,<br>
                &#39;transparent&#39;:&#39;true&#39;,strategies:[new
                OpenLayers.Strategy.Fixed()]},<br>
                           {&#39;opacity&#39;: 1.0, &#39;isBaseLayer&#39;: true,
                &#39;visibility&#39;: true}<br>
                      );<br>
                <br>
                                map.addLayer(wms_ruas);<br>
                                if(!map.getCenter()) {<br>
                                    map.zoomToMaxExtent();<br>
                                }<br>
                            }<br>
                        &lt;/script&gt;<br>
                    &lt;/head&gt;<br>
                    &lt;body onload=&#39;init();&#39;&gt;<br>
                        &lt;h1&gt;Mapa mundo&lt;/h1&gt;<br>
                        &lt;div id=&#39;map&#39; style=&#39;width: 500px; height:
                500px;&#39;&gt;<br>
                        &lt;/div&gt;<br>
                    &lt;/body&gt;<br>
                &lt;/html&gt;<br>
                <br>
                <br>
                <br>
                <br>
                <br>
                Mas sinceramente não sei bem onde o inserir, já tentei
                em vários locais e não funciona.POdes ajudar?<br>
                Estava a tentar adicionando o seguinte:<br>
                <br>
                <pre>var osm_layer = new OpenLayers.Layer.OSM(
                                &#39;OpenStreetMap Layer&#39;
                                );


Abraço
</pre>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                On 02-12-2011 12:37, Jorge de Jesus wrote:
                <blockquote type="cite">
                  
                  Ok parece que o assunto esta resolvido<br>
                  <br>
                  On 02/12/11 11:42, Pedro Costa wrote:
                  <blockquote type="cite">
                    
                    Consegui resolver...Tinha de mudar postgis para o
                    nome da store que tinha e já funciona:-)<br>
                    <br>
                    Obrigado pessoal<br>
                    Vou continuar o estudo <br>
                    <br>
                    ABraço<br>
                    <br>
                    <br>
                    <br>
                    -------- Original Message --------
                    <table border="0" cellpadding="0" cellspacing="0">
                      <tbody>
                        <tr>
                          <th align="RIGHT" nowrap valign="BASELINE">Subject: </th>
                          <td>Re: [Portugal] duvidas sobre openlayers</td>
                        </tr>
                        <tr>
                          <th align="RIGHT" nowrap valign="BASELINE">Date: </th>
                          <td>Fri, 02 Dec 2011 11:26:55 +0000</td>
                        </tr>
                        <tr>
                          <th align="RIGHT" nowrap valign="BASELINE">From: </th>
                          <td>Pedro Costa <a href="mailto:pedrocostaarma@sapo.pt" target="_blank">&lt;pedrocostaarma@sapo.pt&gt;</a></td>
                        </tr>
                        <tr>
                          <th align="RIGHT" nowrap valign="BASELINE">To: </th>
                          <td>Jorge de Jesus <a href="mailto:jmdj@pml.ac.uk" target="_blank">&lt;jmdj@pml.ac.uk&gt;</a></td>
                        </tr>
                      </tbody>
                    </table>
                    <br>
                    <br>
                    
                    <br>
                    Obrigado Jorge. Já eliminei os erros no entanto o
                    openlayers não está a carregar o layer ruas, a
                    página abre mas sem eu conseguir ver o layer.<br>
                    <br>
                    Tentei wms_ruas.getExtent() no firebug e obtenho o
                    seguinte erro: <span><span>ReferenceError:

                        wms_ruas is not defined.<br>
                        Penso que não está a conseguir ir buscar o layer
                        ao geoserver, alguma segestão do que poderá ser?<br>
                        <br>
                        <br>
                        Obrigado pelas repostas de todos<br>
                      </span></span><br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    On 02-12-2011 09:32, Jorge de Jesus wrote:
                    <blockquote type="cite">
                      
                      On 02/12/11 00:37, Pedro Costa wrote:
                      <blockquote type="cite">
                        
                        Pessoal podem ajudar-me também nas seguintes
                        dúvidas:<br>
                        <br>
                        <br>
                        Eu tenho o html que segue em baixo, quando o
                        abro, o firebug indica um erro assim:<br>
                        <br>
                        <div><span>OpenLayers


                            is not defined</span></div>
                        <span></span>
                        <div><a title="var bounds =
                            new OpenLayers.Bounds("> var bounds = new
                            OpenLayers.Bounds(<br>
                            <br>
                            <br>
                          </a></div>
                      </blockquote>
                      &quot;OpenLayers is not defined&quot; acho que este e&#39; o
                      error que tens, parece que a pagina nao carregou o
                      OpenLayers.js. Ve  no tab &quot;Net&quot;&gt;js  do firefox
                      se ele carregou o OpenLayers, experimenta usar a
                      versao online: <br>
                      <br>
                      <br>
                      &lt;script type=&quot;text/javascript&quot; src=<a href="http://openlayers.org/dev/OpenLayers.js" target="_blank">&quot;http://openlayers.org/dev/OpenLayers.js&quot;</a>&gt;&lt;/script&gt;<br>
                      <br>
                      <br>
                      Eu experimentei: var bounds = new
                      OpenLayers.Bounds(-23941, 208039,-21480, 210148);<br>
                      <br>
                      E esta tudo OK<br>
                      <br>
                      Quanto aos bounds, experimenta meter os bounds
                      iguais aos descritos no WMS (faz um pedido
                      getCapabilites), depois de teres adicionado o a
                      layer wms_ruas, podes usar wms_ruas.getExtent():<br>
                      <br>
                      map.zoomToExtent(wms_ruas.getExtent());<br>
                      <br>
                      So uma chamada de atencao o object wms_ruas so
                      esta totalmante operacional depois de adicionado
                      ao mapa e depois de feito o pedido ao servico pelo
                      openlayers, ate teres o objecto totalmente criado
                      certas variaveis e metodos dao error.<br>
                      <br>
                      Jorge<br>
                      <br>
                      <blockquote type="cite">
                        <div><a title="var bounds =
                            new OpenLayers.Bounds("> Penso que seja porque os bounds
                            estão mal definidos. A minha dúvida é o
                            seguinte, como posso saber os bounds
                            correctos? E em que src tenho de os
                            escrever?Igual ao src do layer que quero ir
                            buscar?Será que funciona se eu executar no
                            firebug map.zoomToMaxExtent e map.getExtent
                            no layer preview do geoserver?<br>
                            <br>
                            Tentei isso e dá-me os valores: topp right
                            left e bottom, mas porque ordem os escrevo?<br>
                            <br>
                            <br>
                            Podem tirar-me estas dúvidas?<br>
                            <br>
                            Obrigado<br>
                          </a></div>
                        <br>
                        <br>
                        <br>
                        &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>
                        &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD XHTML 1.0
                        Strict//EN&quot; &quot;DTD/xhtml1-strict.dtd&quot;&gt;<br>
                        &lt;html xmlns=<a href="http://www.w3.org/1999/xhtml" target="_blank">&quot;http://www.w3.org/1999/xhtml&quot;</a>&gt;<br>
                            &lt;head&gt;<br>
                                &lt;title&gt;O meu primeiro
                        mapa&lt;/title&gt;<br>
                                &lt;meta http-equiv=&quot;Content-Type&quot;
                        content=&quot;text/html; charset=UTF-8&quot; /&gt;<br>
                                &lt;script
                        src=&quot;/openlayers/lib/OpenLayers.js&quot;
                        type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br>
                                &lt;script type=&quot;text/javascript&quot;&gt;<br>
                                    var map;<br>
                                    function init() {<br>
                        <br>
                                        var bounds = new
                        OpenLayers.Bounds(<br>
                                        -23941, 208039,<br>
                                        -21480, 210148<br>
                                        );<br>
                        <br>
                                        var options = {<br>
                                            controls: [ new
                        OpenLayers.Control.Navigation(),<br>
                                                                new
                        OpenLayers.Control.PanZoom(),<br>
                                                                new
                        OpenLayers.Control.LayerSwitcher()],<br>
                                            maxExtent: bounds,<br>
                                            maxResolution: <a href="tel:9.61328125" value="+351961328125" target="_blank">9.61328125</a>,<br>
                                            projection: &quot;EPSG:27492&quot;,<br>
                                            units: &#39;m&#39;<br>
                        <br>
                        };<br>
                        <br>
                                        map = new OpenLayers.Map(&#39;map&#39;,
                        options);<br>
                                        var wms = new
                        OpenLayers.Layer.WMS(<br>
                                        &#39;OpenLayers WMS&#39;,<br>
                                        &#39;<a href="http://localhost:8080/geoserver/wms" target="_blank">http://localhost:8080/geoserver/wms</a>&#39;,










                        {<br>
                                            layers: &#39;topp:ruas&#39;<br>
                                        }, {} );<br>
                                        map.addLayer(wms);<br>
                                        if(!map.getCenter()) {<br>
                                            map.zoomToMaxExtent();<br>
                                        }<br>
                                    }<br>
                                &lt;/script&gt;<br>
                            &lt;/head&gt;<br>
                            &lt;body onload=&#39;init();&#39;&gt;<br>
                                &lt;h1&gt;Mapa mundo&lt;/h1&gt;<br>
                                &lt;div id=&#39;map&#39; style=&#39;width: 500px;
                        height: 500px;&#39;&gt;<br>
                                &lt;/div&gt;<br>
                            &lt;/body&gt;<br>
                        &lt;/html&gt;<br>
                        <br>
                        <br>
                        <br>
                        <br>
                        <br>
                        <br>
                        <br>
                        <br>
                        <br>
                        <br>
                        <br>
                        <br>
                        <br>
                        <br>
                        <br>
                        <br>
                        <br>
                        On 01-12-2011 13:22, Jorge de Jesus wrote:
                        <blockquote type="cite">
                          
                          
                          Algumas respostas peco desculpas pelo email
                          meio algarviado<br>
                          <br>
                          <br>
                          On 01/12/11 12:41, Pedro Costa wrote:
                          <blockquote type="cite">
                            
                            Pessoal será que podiam ajudar-me com as
                            seguintes dúvidas do openlayeres, as dúvidas
                            são relativas ao exemplo disponivel aqui:<br>
                            <br>
                            <a href="http://geobox.geospot.pt/pt/index.php/Edi%C3%A7%C3%A3o_com_OpenLayers" target="_blank">http://geobox.geospot.pt/pt/index.php/Edi%C3%A7%C3%A3o_com_OpenLayers</a><br>
                            <br>
                            <br>
                            <b>1)  O que sgnificam estas diferentes
                              partes do código:</b><br>
                            <pre><span>&lt;<span>link</span> <span>rel</span><span>=</span><span>&quot;stylesheet&quot;</span> <span>href</span><span>=</span><span>&quot;/openlayers/theme/default/style.css&quot;</span> <span>type</span><span>=</span><span>&quot;text/css&quot;</span> <span>/</span>&gt;</span></pre>

                            <pre><span>
</span></pre>
                          </blockquote>
                          Isto e&#39; un link pro CSS (cascade style sheet)
                          que define como  varios elementos vao ser
                          rendizados (rendered), ou seja cores, tipos de
                          letras icons, e onde os menus (exemplo:
                          LayerSwitcher) vao aparecer etc. Da uma vista
                          de olhos ao ficheiro e experimenta a fazer
                          alteracoes :) .Se nao sabes trabalhar com CSS
                          da uma vista de olhos a: <a href="http://www.w3schools.com/css/" target="_blank">http://www.w3schools.com/css/</a><br>
                          <blockquote type="cite">
                            <pre><span></span><span><pre>OpenLayers.ProxyHost = &quot;/cgi-bin/proxy.cgi?url=&quot;;

</pre></span></pre>
                          </blockquote>
                          Aiiiiiii a santa bendita proxy !!! Da uma
                          vista de olhos aqui: <a href="http://trac.osgeo.org/openlayers/wiki/FrequentlyAskedQuestions#ProxyHost" target="_blank">http://trac.osgeo.org/openlayers/wiki/FrequentlyAskedQuestions#ProxyHost</a>
                          <br>
                          <br>
                          Basicamente em Javascript tu nao podes chamar
                          um URL que nao esteja no mesmo dominio, por
                          exemplo se o teu site esta em <a href="http://localhost" target="_blank">http://localhost</a>
                          mas o WFS esta em <a href="http://WFSsite.pt" target="_blank">http://WFSsite.pt</a>
                          o codigo de javascipript nao pode aceder a <a href="http://WFSsite.pt" target="_blank">http://WFSsite.pt</a>,
                          esta situacao eh conhecida por &quot;cross domain&quot;
                          da uma vista de olhos na internet<br>
                           <br>
                          Actualmente os browsers mais recentes podem
                          contactar outros dominios se o servidor no
                          outro dominio suportar a norma CORS: <a href="http://www.leggetter.co.uk/2010/03/12/making-cross-domain-javascript-requests-using-xmlhttprequest-or-xdomainrequest.html" target="_blank">http://www.leggetter.co.uk/2010/03/12/making-cross-domain-javascript-requests-using-xmlhttprequest-or-xdomainrequest.html</a><br>

                          <br>
                          Basicamente, a melhor estrategia eh de
                          instalar a proxy no teu servidor e deixar que
                          o openlayers trate do assunto.<br>
                          <br>
                          Normalmente, o firebug manda-te um erro quando
                          tens cross-domain (normalmente o browser nao
                          diz nada e nao faz nada quando tens
                          cross-domain)<br>
                          <blockquote type="cite">
                            <pre><span><pre><b>2) Porquê é que aqui a classe map é nula?</b>

</pre></span></pre>
                          </blockquote>
                          <br>
                          var map=null; Bem uns gostam cozido outros
                          gosta de assado :0  eh so um estilo de
                          programacao, se usares var map; vai dar ao
                          mesmo. Uma chamada de atencao, o var map=null;
                          esta fora da funcao init(), quer dizer que eh
                          uma variable global, que pode ser acedida por
                          qualquer funcao. Normalmente um erro comum e&#39;
                          meter &quot;var map&quot; dentro do init()<br>
                          <br>
                          Pessoalmente meto o map e as layers sempre
                          fora da funcao de inicializacao, ja que
                          variaveis globais parecem logo no firebug.<br>
                          <br>
                          <br>
                          <blockquote type="cite">
                            <pre><span><pre><span><pre><pre>var map = null;

<b>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?

</b></pre></pre></span></pre></span></pre>
                          </blockquote>
                          <br>
                          Eu raramente trabalho com WFS e estive a ver
                          no codigo do openlayers (Protocol/WFS/v1.js)
                          temos a seguinte definicao da propriedade
                          schema:<br>
                          <br>
                          /**<br>
                               * Property: schema<br>
                               * {String} Optional schema location that
                          will be included in the<br>
                               *     schemaLocation attribute value. 
                          Note that the feature type schema<br>
                               *     is required for a strict XML
                          validator (on transactions with an<br>
                               *     insert for example), but is *not*
                          required by the WFS specification<br>
                               *     (since the server is supposed to
                          know about feature type schemas).<br>
                               */<br>
                              schema: null,<br>
                          <br>
                          <br>
                          Basicamente e&#39; um URL que define o schema dos
                          dados em XML e que pode ser usado para validar
                          os conteudos, no exemplo passas um
                          DescribeFeatureType que gera un esquema que
                          define a estrutura do XML dos teus dados.  Em
                          varios exemplos nunca vi o uso do schema:<br>
                          <br>
                          <a href="http://workshops.opengeo.org/stack-intro/openlayers.html" target="_blank">http://workshops.opengeo.org/stack-intro/openlayers.html</a><br>
                          <br>
                          Eu uso mais mapserver, ja que nao me dou muito
                          bem com o JAVA (serei demasiado calhau?) <br>
                          <br>
                          <blockquote type="cite">
                            <pre><span><pre><span><pre><pre><b>
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
</b>
</pre></pre></span></pre></span></pre>
                          </blockquote>
                          uma livraria no localhost e&#39; mais rapida para
                          fazer o upload e nao estas dependente de
                          &quot;terceiros&quot; <br>
                          <br>
                          E para concluir: O firebug e&#39; o melhor amigo
                          do Homem (depois do cao e&#39; claro)<br>
                          <br>
                          <br>
                          Bom feriado, eu vou marfar <br>
                          <br>
                          Jorge<br>
                          <br>
                          <pre cols="72">-- 
PGP public key: 0x595FF9D3</pre>
                          <br>
                          <hr>
                          <p><font face="Arial" size="1"> Plymouth
                              Marine Laboratory<br>
                              Registered Office: <br>
                              Prospect Place<br>
                              The Hoe<br>
                              Plymouth PL1 3DH </font></p>
                          <p><font face="Arial" size="1">Website: <a href="http://www.pml.ac.uk" target="_blank">www.pml.ac.uk</a>
                              <br>
                              <a href="http://www.pml.ac.uk/pdf/PMLAR2010.pdf" target="_blank">Click






                                here for PML Annual Review</a> <br>
                              Registered Charity No. 1091222<br>
                              PML is a company limited by guarantee<br>
                              registered in England &amp; Wales<br>
                              company number 4178503</font></p>
                          <p><font color="green" face="Arial" size="1">Please



                              think before you print.</font></p>
                          <hr>
                          <p><font face="Arial" size="1">This e-mail,
                              its content and any file attachments are
                              confidential.</font></p>
                          <p><font face="Arial" size="1">If you have
                              received this e-mail in error please do
                              not copy, disclose it to any third party
                              or use the contents or attachments in any
                              way. Please notify the sender by replying
                              to this e-mail or e-mail <a href="mailto:forinfo@pml.ac.uk" target="_blank">forinfo@pml.ac.uk</a>
                              and then delete the email without making
                              any copies or using it in any other way.</font></p>
                          <p><font face="Arial" size="1">The content of
                              this message may contain personal views
                              which are not the views of Plymouth Marine
                              Laboratory unless specifically stated.</font></p>
                          <p><font face="Arial" size="1">You are
                              reminded that e-mail communications are
                              not secure and may contain viruses.
                              Plymouth Marine Laboratory accepts no
                              liability for any loss or damage which may
                              be caused by viruses.</font></p>
                          <hr> <br>
                          <br>
                        </blockquote>
                        <br>
                      </blockquote>
                      <br>
                      <br>
                      <pre cols="72">-- 
PGP public key: 0x595FF9D3</pre>
                      <br>
                      <hr>
                      <p><font face="Arial" size="1"> Plymouth Marine
                          Laboratory<br>
                          Registered Office: <br>
                          Prospect Place<br>
                          The Hoe<br>
                          Plymouth PL1 3DH </font></p>
                      <p><font face="Arial" size="1">Website: <a href="http://www.pml.ac.uk" target="_blank">www.pml.ac.uk</a>
                          <br>
                          <a href="http://www.pml.ac.uk/pdf/PMLAR2010.pdf" target="_blank">Click




                            here for PML Annual Review</a> <br>
                          Registered Charity No. 1091222<br>
                          PML is a company limited by guarantee<br>
                          registered in England &amp; Wales<br>
                          company number 4178503</font></p>
                      <p><font color="green" face="Arial" size="1">Please

                          think before you print.</font></p>
                      <hr>
                      <p><font face="Arial" size="1">This e-mail, its
                          content and any file attachments are
                          confidential.</font></p>
                      <p><font face="Arial" size="1">If you have
                          received this e-mail in error please do not
                          copy, disclose it to any third party or use
                          the contents or attachments in any way. Please
                          notify the sender by replying to this e-mail
                          or e-mail <a href="mailto:forinfo@pml.ac.uk" target="_blank">forinfo@pml.ac.uk</a>
                          and then delete the email without making any
                          copies or using it in any other way.</font></p>
                      <p><font face="Arial" size="1">The content of this
                          message may contain personal views which are
                          not the views of Plymouth Marine Laboratory
                          unless specifically stated.</font></p>
                      <p><font face="Arial" size="1">You are reminded
                          that e-mail communications are not secure and
                          may contain viruses. Plymouth Marine
                          Laboratory accepts no liability for any loss
                          or damage which may be caused by viruses.</font></p>
                      <hr> <br>
                      <br>
                    </blockquote>
                    <br>
                    <br>
                    <pre><fieldset></fieldset>
_______________________________________________
Portugal mailing list
<a href="mailto:Portugal@lists.osgeo.org" target="_blank">Portugal@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/portugal" target="_blank">http://lists.osgeo.org/mailman/listinfo/portugal</a>
</pre>
                  </blockquote>
                  <br>
                  <br>
                  <pre cols="72">-- 
PGP public key: 0x595FF9D3</pre>
                  <br>
                  <hr>
                  <p><font face="Arial" size="1"> Plymouth Marine
                      Laboratory<br>
                      Registered Office: <br>
                      Prospect Place<br>
                      The Hoe<br>
                      Plymouth PL1 3DH </font></p>
                  <p><font face="Arial" size="1">Website: <a href="http://www.pml.ac.uk" target="_blank">www.pml.ac.uk</a> <br>
                      <a href="http://www.pml.ac.uk/pdf/PMLAR2010.pdf" target="_blank">Click


                        here for PML Annual Review</a> <br>
                      Registered Charity No. 1091222<br>
                      PML is a company limited by guarantee<br>
                      registered in England &amp; Wales<br>
                      company number 4178503</font></p>
                  <p><font color="green" face="Arial" size="1">Please
                      think before you print.</font></p>
                  <hr>
                  <p><font face="Arial" size="1">This e-mail, its
                      content and any file attachments are confidential.</font></p>
                  <p><font face="Arial" size="1">If you have received
                      this e-mail in error please do not copy, disclose
                      it to any third party or use the contents or
                      attachments in any way. Please notify the sender
                      by replying to this e-mail or e-mail <a href="mailto:forinfo@pml.ac.uk" target="_blank">forinfo@pml.ac.uk</a>
                      and then delete the email without making any
                      copies or using it in any other way.</font></p>
                  <p><font face="Arial" size="1">The content of this
                      message may contain personal views which are not
                      the views of Plymouth Marine Laboratory unless
                      specifically stated.</font></p>
                  <p><font face="Arial" size="1">You are reminded that
                      e-mail communications are not secure and may
                      contain viruses. Plymouth Marine Laboratory
                      accepts no liability for any loss or damage which
                      may be caused by viruses.</font></p>
                  <hr> <br>
                  <br>
                </blockquote>
                <br>
              </blockquote>
              <br>
              <br>
              <pre cols="72">-- 
PGP public key: 0x595FF9D3</pre>
              <br>
              <hr>
              <p><font face="Arial" size="1"> Plymouth Marine Laboratory<br>
                  Registered Office: <br>
                  Prospect Place<br>
                  The Hoe<br>
                  Plymouth PL1 3DH </font></p>
              <p><font face="Arial" size="1">Website: <a href="http://www.pml.ac.uk" target="_blank">www.pml.ac.uk</a>
                  <br>
                  <a href="http://www.pml.ac.uk/pdf/PMLAR2010.pdf" target="_blank">Click
                    here for PML Annual Review</a> <br>
                  Registered Charity No. 1091222<br>
                  PML is a company limited by guarantee<br>
                  registered in England &amp; Wales<br>
                  company number 4178503</font></p>
              <p><font color="green" face="Arial" size="1">Please think
                  before you print.</font></p>
              <hr>
              <p><font face="Arial" size="1">This e-mail, its content
                  and any file attachments are confidential.</font></p>
              <p><font face="Arial" size="1">If you have received this
                  e-mail in error please do not copy, disclose it to any
                  third party or use the contents or attachments in any
                  way. Please notify the sender by replying to this
                  e-mail or e-mail <a href="mailto:forinfo@pml.ac.uk" target="_blank">forinfo@pml.ac.uk</a>
                  and then delete the email without making any copies or
                  using it in any other way.</font></p>
              <p><font face="Arial" size="1">The content of this message
                  may contain personal views which are not the views of
                  Plymouth Marine Laboratory unless specifically stated.</font></p>
              <p><font face="Arial" size="1">You are reminded that
                  e-mail communications are not secure and may contain
                  viruses. Plymouth Marine Laboratory accepts no
                  liability for any loss or damage which may be caused
                  by viruses.</font></p>
              <hr> <br>
              <br>
            </blockquote>
            <br>
          </blockquote>
          <br>
          <br>
          <pre cols="72">-- 
PGP public key: 0x595FF9D3</pre>
          <br>
          <hr>
          <p><font face="Arial" size="1"> Plymouth Marine Laboratory<br>
              Registered Office: <br>
              Prospect Place<br>
              The Hoe<br>
              Plymouth PL1 3DH </font></p>
          <p><font face="Arial" size="1">Website: <a href="http://www.pml.ac.uk" target="_blank">www.pml.ac.uk</a>
              <br>
              <a href="http://www.pml.ac.uk/pdf/PMLAR2010.pdf" target="_blank">Click here
                for PML Annual Review</a> <br>
              Registered Charity No. 1091222<br>
              PML is a company limited by guarantee<br>
              registered in England &amp; Wales<br>
              company number 4178503</font></p>
          <p><font color="green" face="Arial" size="1">Please think
              before you print.</font></p>
          <hr>
          <p><font face="Arial" size="1">This e-mail, its content and
              any file attachments are confidential.</font></p>
          <p><font face="Arial" size="1">If you have received this
              e-mail in error please do not copy, disclose it to any
              third party or use the contents or attachments in any way.
              Please notify the sender by replying to this e-mail or
              e-mail <a href="mailto:forinfo@pml.ac.uk" target="_blank">forinfo@pml.ac.uk</a>
              and then delete the email without making any copies or
              using it in any other way.</font></p>
          <p><font face="Arial" size="1">The content of this message may
              contain personal views which are not the views of Plymouth
              Marine Laboratory unless specifically stated.</font></p>
          <p><font face="Arial" size="1">You are reminded that e-mail
              communications are not secure and may contain viruses.
              Plymouth Marine Laboratory accepts no liability for any
              loss or damage which may be caused by viruses.</font></p>
          <hr> <br>
          <br>
        </blockquote>
        <br>
      </blockquote>
      <br>
      <br>
      <pre cols="72">-- 
PGP public key: 0x595FF9D3</pre>
      <br>
      <hr>
      <p><font face="Arial" size="1">
          Plymouth Marine Laboratory<br>
          Registered Office: <br>
          Prospect Place<br>
          The Hoe<br>
          Plymouth PL1 3DH
        </font></p>
      <p><font face="Arial" size="1">Website: <a href="http://www.pml.ac.uk" target="_blank">www.pml.ac.uk</a>
          <br>
          <a href="http://www.pml.ac.uk/pdf/PMLAR2010.pdf" target="_blank">Click here for
            PML Annual Review</a>
          <br>
          Registered Charity No. 1091222<br>
          PML is a company limited by guarantee<br>
          registered in England &amp; Wales<br>
          company number 4178503</font></p>
      <p><font color="green" face="Arial" size="1">Please think before
          you print.</font></p>
      <hr>
      <p><font face="Arial" size="1">This e-mail, its content and any
          file attachments are confidential.</font></p>
      <p><font face="Arial" size="1">If you have received this e-mail in
          error please do not copy, disclose it to any third party or
          use the contents or attachments in any way. Please notify the
          sender by replying to this e-mail or e-mail <a href="mailto:forinfo@pml.ac.uk" target="_blank">forinfo@pml.ac.uk</a>
          and then delete the email without making any copies or using
          it in any other way.</font></p>
      <p><font face="Arial" size="1">The content of this message may
          contain personal views which are not the views of Plymouth
          Marine Laboratory unless specifically stated.</font></p>
      <p><font face="Arial" size="1">You are reminded that e-mail
          communications are not secure and may contain viruses.
          Plymouth Marine Laboratory accepts no liability for any loss
          or damage which may be caused by viruses.</font></p>
      <hr>
      <br>
      <br>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
Portugal mailing list<br>
<a href="mailto:Portugal@lists.osgeo.org">Portugal@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/portugal" target="_blank">http://lists.osgeo.org/mailman/listinfo/portugal</a><br>
<br></blockquote></div><br>