[mapserver-users] Open Layers Problem
Alberto Najera
anajera at bicimapas.com.mx
Fri Apr 27 16:25:30 PDT 2012
Thanks,
I used this
http://173.236.45.118/cgi-bin/mapserv?map=/home/bicimapas/mapdata/BiciMapasM
S.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities
and now get the capabilities report, which seems to be correct, but still
the map does not show with OpenLayers.
Any ideas?
Alberto Najera
www.bicimapas.com.mx
www.bicimapas.com.mx/Empresa.htm
Avenida Lomas Verdes No. 58, Local 17
Colonia Santa Cruz Acatlán
Naucalpan, Estado de México
México CP 53150
Tel: (55) 53 60 30 65
anajera at bicimapas.com.mx
Búscanos como Bicimapas
-----Mensaje original-----
De: Havard Tveite [mailto:havard.tveite at umb.no]
Enviado el: viernes, 27 de abril de 2012 06:17 p.m.
Para: Alberto Najera
Asunto: Re: [mapserver-users] Open Layers Problem
Try using the complete (absolute) path to the mapfile.
Håvard
On 28/04/12 00:48, Alberto Najera wrote:
> I tested the WMS capabilities with this string
>
> http://173.236.45.118/cgi-bin/mapserv?map=BiciMapasMS.map&SERVICE=WMS&
> VERSIO
> N=1.1.1&REQUEST=GetCapabilities
>
> and get this message
>
> msLoadMap(): Unable to access file. (BiciMapasMS.map)
>
> Why would the map file not be accessible to openlayers while Mapserver
> can access it? Is it a permissions or a path definition problem?
>
> Any hel os appreciated. Thanks
>
>
> Alberto Najera
>
>
> -----Mensaje original-----
> De: mapserver-users-bounces at lists.osgeo.org
> [mailto:mapserver-users-bounces at lists.osgeo.org] En nombre de Alberto
> Najera Enviado el: viernes, 27 de abril de 2012 01:19 p.m.
> Para: mapserver-users at lists.osgeo.org
> Asunto: [mapserver-users] Open Layers Problem
>
> Hello
>
> We have a map that is rendered well using the Mapserver template and
> are trying to use it with OpenLayers but are experiencing some
> problems as the map does not show and I cannot find why.
>
> We are using a Linux Centos 5 remote server and the map file is
> located in home/bicimapas/mapdata/BiciMapasMS.map and the Mapserver
> CGI is located in /home/bicimapas/cgi-bin/mapserv. The IP address is
> 173.236.45.118
>
> On the map file we added this Metadata lines under the WEB section
>
> METADATA
> "wms_title" "BiciMapasMS"
> "wms_onlineresource"
> "http://173.236.45.118/cgi-bin/mapserv?map=http://173.236.45.118/home/
> bicima
> pas/mapdata/BiciMapasMS.map&"
> "wms_srs" "EPSG:4326"
> "wms_enable_request" "*"
> END
>
>
> And the metadata for the test layer was added like this
>
> LAYER
> NAME "areaurbana"
> DATA "AreasMS"
> STATUS on
> TYPE polygon
> LABELCACHE on
> LABELITEM "NAME"
> CLASSITEM "CATEGORY"
> METADATA
> "wms_title" "areaurbana"
> "wms_srs" "EPSG:4326"
> "wms_include_items" "all"
> END
> (more code here...........)
>
> Finally, the code being used to make the Openlayers call is:
>
> <!DOCTYPE html>
> <html lang='en'>
> <head>
> <meta charset='utf-8' />
> <title>Open Layers Test</title>
> <script type='text/javascript' src="OpenLayers.js"></script>
> <script type='text/javascript'>
>
> var map;
>
> function init() {
> // Setup our map object
> map = new OpenLayers.Map('map_element', {});
>
> // Setup our layer objects
>
> var layer1 = new OpenLayers.Layer.WMS( 'Area
> Urbana','http://173.236.45.118/cgi-bin/mapserv', {layers:
'areaurbana',map:
> '//173.236.45.118//home/bicimapas/mapdata/BiciMapasMS.map',} );
>
>
>
> //Add layers to the map
> map.addLayer([layer1]);
>
>
>
> // Zoom the map to the max extent
> if(!map.getCenter()){
> map.zoomToMaxExtent();
> }
> }
>
> </script>
> </head>
>
> <body onload='init();'>
> <div id='map_element' style='width: 500px; height: 500px;'>
> </div>
> </body>
> </html>
>
> Thanks in advance for your help
>
> Alberto Najera
More information about the MapServer-users
mailing list