# -------------------------------------------------------------
# Import the WMS support functions for PHP. These are mostly responsible for
# handling the XML capabilities request, and creating appropriate JavaScript
# objects from that data.8
#
# PHP functions are also used to generate the query result page.
#
include("wms_functions.php");
# -------------------------------------------------------------
# Test that there is a wms service defined before proceding.
#
if ( ! $onlineresource ) {
# No WMS service provided.
wms_fatal("No 'onlineresource' defined.");
}
$wms_service_request = $onlineresource . "REQUEST=GetCapabilities&SERVICE=WMS";
# -------------------------------------------------------------
# Test that the capabilites file has successfully downloaded.
#
if( !($wms_capabilities = file($wms_service_request)) ) {
# Cannot download the capabilities file.
wms_fatal("Unable to retrieve capabilities file '$wms_service_request'.");
}
$wms_capabilities = implode("",$wms_capabilities);
# -------------------------------------------------------------
# Test that the capabilites file has successfully parsed.
#
if( !($dom = xmldoc($wms_capabilities)) ) {
# Cannot parse the capabilities file.
wms_fatal("Unable to parse capabilities file from '$onlineresource'." . xml2html($wms_capabilities));
}
# -------------------------------------------------------------
# Create the JavaScript map object and layer objects.
# Set the layer objects to have a valid reference to the map object.
#
#print xml2html($wms_capabilities); exit;
print "
" . wms_title($dom) . "
";
print "";
$bbox = explode(",",$bbox);
print "";
print "| BBOX: | LL $bbox[0],$bbox[1] UR $bbox[2],$bbox[3] |
";
print "| SRS: | ".wms_srs($dom)." |
";
print "
";
?>