[mapserver-users] Open Layers Problem

Alberto Najera anajera at bicimapas.com.mx
Fri Apr 27 18:48:00 EDT 2012


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
 


_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list