[OpenLayers-Users] Local Geoserve WMS not working

Ivan Grcic igrcic at gmail.com
Mon Feb 16 08:07:55 EST 2009


hi,

what does FireBug say?

On Mon, Feb 16, 2009 at 1:58 PM, Hugo <hfpmartins at gmail.com> wrote:
> Hello all,
>
> I've beenmaking some experiences with openlayers and mapfish. I have postgis
> database and geoserver up and running. My problem is with wms created in my
> geoserver. I can load this wms in any thick client (qgis, gvsig) and if i
> choose the mappreview of the geoserver admin page it is also running ok (in
> the openlayers).
>
> If i now try to make my own script it doesn´t shows anything. Any hint on
> what may be happening??
> This is my very simple code. It is calling openlayers from mapfish (which i
> tried first with google layers and works fine):
>
> <!DOCTYPE html>
> <html xmlns="http://www.w3.org/1999/xhtml">
>   <head>
>     <title>OpenLayers</title>
>     <script type="text/javascript"
> src="../client/mfbase/openlayers/lib/Firebug/firebug.js"></script>
>     <script
> src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAqjXqK2AnPc3L2h71jEi4pxS89dNBXjbs3KhxedIObIPgZlGU8RSY0Afhq8cq5fuNgI-GZP2m_MM0Pw"
> type="text/javascript"></script>
>     <script type="text/javascript"
> src="../../client/mfbase/openlayers/lib/OpenLayers.js"></script>
>     <style>
>         #panel {
>             right: 0px;
>             height: 30px;
>             width: 200px;
>         }
>         #panel div {
>             float: left;
>             margin: 5px;
>         }
>     </style>
>     <script type="text/javascript">
>
>     function init(){
>
>         var bounds = new OpenLayers.Bounds (-133259.566796875,
> -329230.621875, 176201.293359375, 304911.746875);
>
>         var options = {
>             maxExtent: bounds,
>             maxResolution: 2477.1186279296876,
>             projection: "EPSG:27492",
>             units: 'm'
>         }
>
>         map = new OpenLayers.Map('center');
>
>         var caop =  new OpenLayers.Layer.WMS (
>             "CAOP",
>             "http://localhost:8080/geoserver/wms?",
>             {
>                 layers: 'pg:caop',
>                 srs: 'EPSG:27492',
>                 styles: '',
>                 format: 'image/png'
>             },
>             {isBaseLayer: true}
>         );
>
>         map.addLayers([caop]);
>         map.addControl(new OpenLayers.Control.LayerSwitcher());
>         map.zoomToMaxExtent();
>     };
>
>     </script>
>     </head>
>   <body onload="init()">
>     <div id="center" style="width: 700px; height: 550px"></div>
>   </body>
> </html>
>
>
> Thanks in advance,
>
> Hugo
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>



-- 
Ivan Grcic



More information about the Users mailing list