include("wms_functions.php"); if ( $_POST["onlineresource"] ) { $size = array($_POST["width"],$_POST["height"]); $bbox = explode(",",$_POST["bbox"]); if( $_POST["mapimg_x"] && $_POST["mapimg_y"] ) { $click = array($_POST["mapimg_x"],$_POST["mapimg_y"]); if( $_POST["mode"] == "pan" ) { $bbox = wms_pan( $bbox, $size, $click ); } elseif( $_POST["mode"] == "zin" ) { $bbox = wms_pan( $bbox, $size, $click ); $bbox = wms_zoom( $bbox, 0.5 ); } elseif( $_POST["mode"] == "zout" ) { $bbox = wms_pan( $bbox, $size, $click ); $bbox = wms_zoom( $bbox, 2.0 ); } } # # We are in zoom-to-extents mode, to override current # extent with saved original extent. Then switch to # the default mode (pan). # if( $_POST["mode"] == "all" ) { $bbox = explode(",",$_POST["bbox0"]); $_POST["mode"] = "pan"; } # # Resize the spatial extents to match the image # aspect. # $bbox = wms_scale( $bbox, $size ); $_POST["bbox"] = implode(",",$bbox); # # Store the initial extent for future use. # if( ! $_POST["bbox0"] ) { $_POST["bbox0"] = $_POST["bbox"]; } # # Create the GETMAP URL. # $url = $_POST["onlineresource"] . "VERSION=" . urlencode("1.1.0") . "&" . "REQUEST=GetMap&" . "BBOX=" . urlencode($_POST["bbox"]) . "&" . "LAYERS=" . urlencode($_POST["layers"]) . "&" . "SRS=" . urlencode($_POST["srs"]) . "&" . "WIDTH=" . urlencode($_POST["width"]) . "&" . "HEIGHT=" . urlencode($_POST["height"]) . "&" . "FORMAT=" . urlencode($_POST["format"]); # # Get the map image. # print "
"; } # # Fill out the wraparound information. This saves the state of the # system for use in the next action. # $wms_vars = array("bbox","format","width","height","layers","mode","srs","onlineresource","bbox0","qlayers"); foreach ( $wms_vars as $var ) { print wms_hidden($var,$_POST[$var]); } ?>