[mapserver-users] MapServier and OpenLayers - with PHP?

Richard Marsden richard at winwaed.com
Fri Apr 18 15:45:12 EDT 2008


Hello,  This is my first post here and I'll have to admit to being a bit 
of a Mapserver beginner!

At the moment I'm working with MapServer on a shared FreeBSD (Pair.com) 
system. Although I haven't managed to get CGI working (probably because 
I can't restart Apache), I do have PHP MapScript working.  Eg. the "Map 
3" example in Bill Kropla's "Beginning MapServer" book, and I'm well on 
the way to making my own maps using a different set of shapefiles that I 
have.

I would like to use OpenLayers to make the maps appear more "snappy" and 
user friendly.
I think I have some conceptual problems - is it possible to use 
OpenLayers with PHP MapScript?  How do I go about it?

I have one of the OpenLayers samples for MapScript:

        function init(){
            map = new OpenLayers.Map( 'map' );
            layer = new OpenLayers.Layer.MapServer( "OpenLayers WMS",
                    "http://labs.metacarta.com/wms/vmap0", {layers: 
'basic'},
                    {gutter: 15});
            map.addLayer(layer);

            map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
            map.addControl( new OpenLayers.Control.LayerSwitcher() );
        }

This looks simple enough, except for the MapScript URL! Where does it 
get the map file from?
How would I get this to work with PHP, considering I can't get  CGI to work?



Thanks,

Richard

-- 
Richard Marsden
Winwaed Software Technology LLC
http://www.winwaed.com
Tools and Add-ins for MapPoint - http://www.mapping-tools.com



More information about the mapserver-users mailing list