of class "nztopo", see http://www.topomap.co.nz/. */ function NZTopo_Parse($p1, $p2, $p3, $p4, $p5, $p6, $p7) { // Initialise variables $debugon = false; # debug $retval = ''; # return value $opt = ParseArgs($p1 . ' ' . $p2 . ' ' . $p3 . ' ' . $p4 . ' ' . $p5 . ' ' . $p6 . ' ' . $p7); $version = 2; # fixed $width = $opt['width'] ? ' width="' . $opt['width'] . '"' : ""; # iframe parameter $height = $opt['height'] ? ' height="' . $opt['height'] . '"' : ""; # iframe parameter // query string parameters $query = ''; $query .= $opt['ll'] ? '&ll=' . $opt['ll'] : ""; $query .= $opt['llbs'] ? '&llbs=' . $opt['llbs'] : ""; $query .= $opt['topo50'] ? '&topo50=' . $opt['topo50'] : ""; $query .= $opt['nzbs'] ? '&nzbs=' . $opt['nzbs'] : ""; $query .= $opt['nzne'] ? '&nzne=' . $opt['nzne'] : ""; $query .= $opt['kml'] ? '&kml=' . rawurlencode($opt['kml']) : ""; $query .= $opt['gpx'] ? '&gpx=' . rawurlencode($opt['gpx']) : ""; $query .= $opt['pin'] ? '&pin=' . $opt['pin'] : ""; $query .= $opt['label'] ? '&lbl=' . rawurlencode(htmlentities($opt['label'])) : ""; # double url encode unicode chars for them to work with the topo map $query .= $opt['zoom'] ? '&z=' . $opt['zoom'] : '&z=14'; $src = 'http://www.topomap.co.nz/NZTopoMapEmbedded?v=' . $version . $query; $retval .= '
' . "\n"; $retval .= ''; $retval .= '
' . "\n"; /* example HTML for nztopomap */ if( $debugon ) { $retval .= '
p1=' . $p1 . ' p2=' . $p2 . ' p3=' . $p3 . ' p4=' . $p4 . ' p5=' . $p5 . ' p6=' . $p6 . ' p7=' . $p7 . '
' . "\n"; $retval .= 'src=' . $src . '
' . "\n"; } return $retval; } # NZTopo_Parse