\n" . "\n" . $this->GetSwitches() . "
\n" . sprintf( "GetMapURI( $center )) . sprintf( " width=%u height=%u", $width, $height ) . sprintf( " alt=\"「%s」周辺の道の駅\"" . " title=\"「%s」周辺の道の駅\"", $obj->name, $obj->name ) . " usemap=\"#neighborhood\">\n" . "
\n" . "\n" . $this->GetMapShape( $center, $spottab, $region, $width, $height ) . "アイコンの上にカーソルを置くと駅名が表示され、" . "クリックすると呼び出したウィンドウに" . "詳細案内が表示される。" . "
\n" . $this->GetFooter() ; echo $str ; } private function GetMapAreaTag( $region, $spot, $from, $height ) { $dbSpot = new CDbSpot( $this->db ) ; $obj = $dbSpot->GetObjByNo( $spot ) ; $href = "" ; if( $obj->infouri ) { if( $spot ) { $obj_lst = new NeighborhoodList( $this->db ) ; $mapuri = $obj_lst->getWindowURI( $spot ) ; } $href = sprintf( " javascript:jumpto('%s/%s','%s')\"", $GLOBALS['michiekitop'], $obj->infouri, $mapuri ) ; } $str = $this->mapNeighborhood->GetMapAreaTag( $region, $obj->no, $from, $height, $href ) ; return( $str ) ; } private function GetMapShape( $center, $spottab, $region, $width, $height ) { $cachefile = $this->mapNeighborhood->HaveCache( "ext", $center ) ; if( !is_null( $cachefile )) { $hTmp = fopen( $cachefile, "r" ) ; if( $hTmp != FALSE ) { $str_map = fread( $hTmp, filesize( $cachefile )) ; fclose( $hTmp ) ; return( $str_map ) ; } } $str_map = "\n" . $this->GetMapAreaTag( $region, $center, $center, $height ) ; for( $i=0 ; $iGetMapAreaTag( $region, $spottab[$i], $center, $height ) ; } $pt = $this->mapNeighborhood->GetOtherPointList( $center, $spottab ) ; for( $i=0 ; $iGetMapAreaTag( $region, $pt[$i]->spot, $center, $height ) ; } $str_map .= "\n" ; $this->mapNeighborhood->SaveCacheStr( "ext", $center, $str_map ) ; return( $str_map ) ; } private function GetMapURI( $center ) { $mapuri = sprintf( "neighborhoodmap.php?c=%u", $center ) ; return( $mapuri ) ; } private function GetSwitches() { $str= "
\n" . "\n" ; return( $str ) ; } private function GetHeader( $obj ) { $str = "\n" . "\n" . "\n" . sprintf( "「%s」周辺の道の駅\n", $obj->name ) . "\n" . "\n" . "\n" . "\n" . "\n" ; return( $str ) ; } private function GetFooter() { $str = "
閉じる
\n" . "\n" . "\n" ; return( $str ) ; } #動作確認: # MSIE 6.0 # Opera/6.01 # Netscape/7.01 # Mozilla/4.78 private function GetInnerSize( $width, $height ) { # $width = (int)( $width + 40 ) ; # $height = (int)( $height + 90 ) ; $str= "\n" . "if( ua.indexOf( 'MSIE', 0 ) >= 0 ) {\n" #動作確認:MSIE 6.0 . sprintf( " window.resizeTo( %u, %u ) ;\n", $width + 50, $height + 190 ) . "} else if( ua.indexOf( 'Mozilla/4', 0 ) >= 0 ) {\n" #動作確認: Netscape/4 (window開く時にresizableが必要) . sprintf( " window.resizeTo( %u, %u ) ;\n", $width + 20, $height + 130 ) # . sprintf( " document.size.wiw.value = %u ;\n", $width + 50 ) # . sprintf( " document.size.wih.value = %u ;\n", $height + 190 ) # . sprintf( "document.writeln( 'Mozilla/4
' ) ;\n" ) . "} else if( ua.indexOf( 'Mozilla', 0 ) >= 0 ) {\n" #動作確認: Netscape/7 . sprintf( " window.innerWidth=%u ;\n", $width + 40 ) . sprintf( " window.innerHeight=%u ;\n", $height + 150 ) # . sprintf( "document.writeln( 'Mozilla/7
' ) ;\n" ) . "} else if( ua.indexOf( 'Opera/', 0 ) >= 0 ) {\n" #Opera/6.01 . sprintf( " window.resizeTo( %u, %u ) ;\n", $width + 50, $height + 160 ) . "}\n" ; return( $str ) ; } private function GetJumpto() { $str= "function jumpto(infourl,mapuri)\n" . "{\n" . " window.opener.location.href=infourl ;\n" # . " document.writeln(" # . " 'mv=' + document.switches.mv.checked ) ;\n" . " if( document.switches.mv.checked ) {\n" . " if( mapuri ) {\n" . " mapuri += '&mv=1' ;\n" . " document.location.href=mapuri ;\n" . " }\n" . " }\n" . "}\n" ; return( $str ) ; } } # # ---------- output by javascript ---------- # function js( $str ) { echo "document.writeln( '$str' ) ;\n" ; } # # ---------- get format version ---------- # function getFormatVersion( $db ) { $dbSpot = new CDbSpot( $db ) ; $objSpot = $dbSpot->GetObjByNo( $GLOBALS['c'] ) ; if( ereg( "^[^/]+/[^/]+/[^/]+/index\.htm$", $objSpot->infouri, $regs )) return( 2 ) ; return( 1 ) ; } # # ---------- main procedure --------- # function main( $db ) { $md = $GLOBALS['md'] ; $center = $GLOBALS['c'] ; if( !$db ) return ; if( $md == 'win' ) { $obj = new NeighborhoodWin( $db ) ; $obj->dspWin( $center ) ; } else { $obj = new NeighborhoodList( $db ) ; $obj->dspList( $center ) ; $obj = new DbRequest( $db ) ; $obj->Add( $center ) ; } }