Database Reference
In-Depth Information
END # End of mapfile
2. Save the file we just created in a location that is accessible to the Apache
user.Forexample,inDebian,itis /var/www/data ,whileinWindows,itcan
be C:\ms4w\Apache\htdocs . Be sure that both the file and the directory
containing it are accessible to the Apache user.
3. Create a file named template.html in the same location as the map file
andenterthefollowingcodeinit(thisfileisusedbytheGetFeatureInfoWMS
request to output an HTML response to the client):
<!-- MapServer Template -->
<ul>
<li><strong>Name: </strong>[item
name=name]</li>
<li><strong>ISO2: </strong>[item
name=iso2]</li>
<li><strong>ISO3: </strong>[item
name=iso3]</li>
<li><strong>Population 2005:
</strong>[item
name=pop2005]</li>
</ul>
4. Withthemapfileyoujustcreated,youexposedthe countries PostGISlay-
er, both as a WMS and WFS service. Both of these services expose to the
useraseriesofrequests,andyouwillnowtestthemusingabrowser.First,
withoutinvokinganyservices,testwhetherornotthemapfileisworkingcor-
rectly by typing either of the following URLs in the browser:
http://localhost/cgi-bin/mapserv?map=/var/www/
data/countries.map&layer=countries&mode=map
(for
Linux)
http://localhost/cgi-bin/
mapserv.exe?map=C:\ms4w\Apache\htdocs\countries.map&layer=countries&mode=map
(for Windows)
Search WWH ::




Custom Search