var maps_start_date , maps_import_flag , maps_import_count , maps_focus_category , maps_import_current_file , maps_apiversion; var maps_category = new Array(); var maps_item = new Array(); var maps_narrowCondition = new Array(); var maps_marker = new Array(); var maps_current_marker = new Array(); var maps_template = new Array(); var maps__version = 1.03; var maps__ua = new Object(); var maps_poweredBymaps_time = 10; var import_file = ""; var import_path = ""; var maps_import_cache = 1; var maps_import_maxItems = Infinity; var maps_import_maxCategorys = Infinity; var maps_image_path = "./image/"; var maps_debug_mode = 0; var maps_default_lng = 0; var maps_default_lat = 0; var maps_default_zoom = 2; var maps_default_type = "map"; var start_category = ""; var maps_default_item = ""; var maps_default_sort = ""; var maps_zmarking = 1; var maps_zmarking_separate = "
"; var maps_control_zoom = 1; var maps_control_type = 1; var maps_control_scale = 1; var item_name = "アイテム"; var maps_itemNavi_page_items = 0; var maps_itemNavi_countColumn = 1; var maps_itemNavi_rowStrips = 0; var maps_itemNavi_thirdRow = ""; var category_name = "カテゴリ"; var maps_category_autoCentering = 0; var maps_category_all = 1; var maps_category_all_label = "すべて表示  "; var maps_category_map = 0; var maps_category_map_label = "マップ内の%item_name%を表示"; var maps_infoWindow_tab = ""; var maps_infoWindow_tab_defaultVisible = 1; var maps_infoWindow_func_moveCenter = 0; var maps_infoWindow_func_zoomDetail = 0; var categoryBox = ""; var maps_html_itemNavi = ""; var maps_html_itemNavi_autoZoom = ""; var maps_html_googleLocal = ""; var maps_html_search_itemName_textField = ""; var maps_html_search_message = ""; var maps_html_mapInfo_url = ""; var maps_html_mapInfo_point = ""; var maps_html_googleMap = "map"; var maps_html_debug = ""; var maps_link_type = 1; var maps_marker_key = ""; var maps_marker_center_adjust_x = 0; var maps_marker_center_adjust_y = 0; var maps_mapInfo_point_format = "%lat% / %lng%"; var maps_mapInfo_point_base = 60; var maps_mapInfo_point_base10_decimalDigit = 5; var maps_mapInfo_point_base60_decimalDigit = 2; var maps_mapInfo_point_base60_language = "jp"; var maps_mapInfo_point_enableType = "category,item,location"; var maps_search_dic_synonym = ""; var maps_search_narrow_message = 1; var maps_design_mapLiquidWidth = 0; var maps_design_mapLiquidHeight = 0; var maps_limit_dragging = 0; var maps_limit_zoomByMouseWheel = 0; var maps_limit_operateByKeyboard = 0; var maps_limit_zoom_max = 17; var maps_limit_zoom_min = 0; var maps_limit_lng_max = 180; var maps_limit_lng_min = -180; var maps_limit_lat_max = 90; var maps_limit_lat_min = -90; var maps_limit_urlArgument = 0; var maps_limit_userMessage = 0; var _zMarker = ""; mapsDefine(); function mapsDefine(){ var ua = navigator.userAgent; if( ua.match( /Opera[\/\s]([0-9]\.[0-9]+)/ ) ){ maps__ua.Opera = parseFloat( RegExp.$1 ); } else { maps__ua.Opera = 0; } if( ua.match( /MSIE ([0-9]\.[0-9]+)/ ) && !maps__ua.Opera ){ maps__ua.MSIE = parseFloat( RegExp.$1 ); } else { maps__ua.MSIE = 0; } if( ua.match( /Firefox[\/\s]([0-9]\.[0-9]+)/ ) ){ maps__ua.Firefox = parseFloat( RegExp.$1 ); } else { maps__ua.Firefox = 0; } if( ua.match( /Netscape[0-9]?[\/\s]([0-9]\.[0-9]+)/ ) ){ maps__ua.Netscape = parseFloat( RegExp.$1 ); } else { maps__ua.Netscape = 0; } if( ua.match( /Safari/ ) ){ maps__ua.Safari = 1; } else { maps__ua.Safari = 0; } maps__ua.Gecko = ( ua.match( /Netscape|Firefox/ ) ? true : false ); window.onload = mapsInit; } function mapsInit(){ if( maps_debug_mode ){ maps_start_date = new Date(); } maps_apiversion = ( typeof( G_NORMAL_MAP ) == "object" ? 2 : 1 ); if( !maps_import_flag && !mapsInit_html() ){ return; } if( location.search ){ mapsInit_procUrlArgument(); } if( ( import_file || maps_import_current_file ) && !maps_import_flag ){ if( !maps_import_current_file ){ maps_import_current_file = import_file; } mapsCommon.XML.include( import_path + maps_import_current_file , mapsInit_import ); return; } mapsDataCategory( "_all" , "-" ); mapsDataCategory( "_map" , "-" ); mapsEX.callback( this , arguments ); if( start_category && maps_category[ start_category ] ){ maps_focus_category = start_category; } else if( maps_default_item && maps_item[ maps_default_item ] ){ maps_focus_category = maps_item[ maps_default_item ].category; } else { maps_focus_category = mapsCommon.Array.keys( maps_category )[ 2 ]; } var mapsMapInitResult = mapsMap.init(); mapsCategoryNavi.init(); mapsItemNavi.init(); mapsSearch.init(); mapsSort.init(); if( !maps_marker[ "_default" ] ){ mapsDataMarker( "_default" , "http://www.google.com/mapfiles/marker%count%.png" , "http://www.google.com/mapfiles/shadow50.png" , ",A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z" , 20 , 34 , 37 , 34 , 9 , 34 , 9 , 2 ); } if( maps_marker[ "_center" ] ){ maps_marker[ "_center" ].marking(); } if( maps_poweredBymaps_time ){ mapsCommon.HTML.setDisplay( "maps--map-poweredBymaps" , 1 ); setTimeout( "mapsCommon.HTML.setDisplay( \"maps--map-poweredBymaps\" , 0 );" , ( maps_poweredBymaps_time * 1000 ) - 500 ); } if( maps_html_mapInfo_point ){ mapsInfo.dispPoint( mapsMapInitResult.defaultPoint.x , mapsMapInitResult.defaultPoint.y ); } if( maps_category_all ){ maps_category[ "_all" ].name = maps_category_all_label; } if( maps_category_map ){ maps_category[ "_map" ].name = maps_category_map_label.replace( "%item_name%" , item_name ); } if( !maps_focus_category ){ maps_focus_category = mapsInit_getDefaultCategory(); } if( maps_focus_category ){ maps_category[ maps_focus_category ].change( "MOVE:off INIT" ); } mapsCategoryNavi.create(); var temp_message = mapsCommon.Variable.getTempValue( "urlArgumentUserMessage" ); if( temp_message ){ var layoutSize = mapsCommon.HTML.getLayoutSize( temp_message ); mapsMap.gmap.openInfoWindowHtml( mapsMapInitResult.defaultPoint , "
" + temp_message + "
" ); } mapsInit_finish(); } function mapsInit_finish(){ mapsEX.callback( this , arguments ); if( maps_default_item ){ maps_item[ maps_default_item ].openInfoWindowByItemNavi(); } if( maps_debug_mode ){ mapsInit_debug_timer(); } } function mapsInit_procUrlArgument(){ if( maps_limit_urlArgument ){ return ; } var urlArgumentFlag = 0; if( location.search.match( /(?=.*[&\?]lng=([0-9\.-]+))(?=.*[&\?]lat=([0-9\.-]+))/ ) ){ maps_default_lng = parseFloat( RegExp.$1 ); maps_default_lat = parseFloat( RegExp.$2 ); start_category = ""; maps_default_item = ""; urlArgumentFlag = 1; } if( location.search.match( /[&\?]category=([a-zA-Z0-9_-]+)/ ) ){ start_category = RegExp.$1; maps_default_item = ""; urlArgumentFlag = 1; } if( location.search.match( /[&\?]item=([a-zA-Z0-9_-]+)/ ) ){ maps_default_item = RegExp.$1; start_category = ( maps_item[ maps_default_item ] ? maps_item[ maps_default_item ].category : "" ); urlArgumentFlag = 1; } if( location.search.match( /[&\?]zoom=([0-9]{1,2})/ ) ){ maps_default_zoom = parseInt( RegExp.$1 ); urlArgumentFlag = 1; } if( location.search.match( /[&\?]type=(map|satellite|hybrid)/ ) ){ maps_default_type = RegExp.$1; urlArgumentFlag = 1; } if( location.search.match( /[&\?]import=([0-9a-zA-Z!$%&()+,;=@\[\]^_=`{}~\.-]+)/ ) ){ maps_import_current_file = RegExp.$1; urlArgumentFlag = 1; } if( location.search.match( /[&\?]message=([^&\?]+)/ ) && !maps_limit_userMessage ){ mapsInfo.userMessageEditor.message = RegExp.$1; var temp_userMessage = decodeURIComponent( RegExp.$1 ); temp_userMessage = mapsCommon.HTML.encode( temp_userMessage ); temp_userMessage = temp_userMessage.replace( "|" , "
" ); mapsCommon.Variable.setTempValue( temp_userMessage , "urlArgumentUserMessage" ); } if( maps_default_lng < maps_limit_lng_min || maps_default_lng > maps_limit_lng_max || maps_default_lat < maps_limit_lat_min || maps_default_lat > maps_limit_lat_max ){ maps_default_lng = ( ( new Array( maps_default_lng , maps_limit_lng_min , maps_limit_lng_max ) ).sort() )[ 1 ]; maps_default_lat = ( ( new Array( maps_default_lat , maps_limit_lat_min , maps_limit_lat_max ) ).sort() )[ 1 ]; } if( maps_default_zoom < maps_limit_zoom_min ){ maps_default_zoom = maps_limit_zoom_min; } if( maps_default_zoom > maps_limit_zoom_max ){ maps_default_zoom = maps_limit_zoom_max; } if( urlArgumentFlag ){ mapsInfo.setURL( "location" ); } } function mapsInit_import( xmlDoc ){ mapsDataImportXML( xmlDoc ); maps_import_flag = 1; mapsInit(); } function mapsInit_html(){ var temp_gmap = document.getElementById( maps_html_googleMap ); var insertTag = ""; var style_displayNone = ( !maps__ua.Opera ? "display: none;" : "visibility: hidden;" ); if( maps_design_mapLiquidWidth || maps_design_mapLiquidHeight ){ var windowSize = mapsCommon.HTML.getWindowSize(); if( maps_design_mapLiquidWidth ){ temp_gmap.style.width = String( windowSize.width + maps_design_mapLiquidWidth ) + "px"; } if( maps_design_mapLiquidHeight ){ temp_gmap.style.height = String( windowSize.height + maps_design_mapLiquidHeight ) + "px"; } } if( maps_marker[ "_center" ] && temp_gmap.offsetWidth % 2 == 1 ){ temp_gmap.style.width = String( temp_gmap.offsetWidth - 1 ) + "px"; } if( maps_marker[ "_center" ] && temp_gmap.offsetHeight % 2 == 1 ){ temp_gmap.style.height = String( temp_gmap.offsetHeight - 1 ) + "px"; } if( typeof( GBrowserIsCompatible ) == "undefined" ){ var mapMessage = "マップをご利用になるには、インターネットに接続されている必要があります。"; var r_value = false; } else if( !GBrowserIsCompatible() ){ var mapMessage = "ご利用のブラウザ、環境ではマップをご利用になることはできません。"; var r_value = false; } else { var mapMessage = "読み込み中..."; var r_value = true; } mapsCommon.HTML.write( "maps--map-message" , mapMessage ); if( maps_marker[ "_center" ] ){ var centerMarkert_style_icon = "position: absolute; z-index: 101; width: " + maps_marker[ "_center" ].width + "px; height: " + maps_marker[ "_center" ].height + "px; " + style_displayNone + " "; var centerMarkert_style_shadow = "position: absolute; z-index: 100; width: " + maps_marker[ "_center" ].swidth + "px; height: " + maps_marker[ "_center" ].sheight + "px; " + style_displayNone + " "; if( maps__ua.MSIE && maps__ua.MSIE < 7.0 ){ centerMarkert_style_icon += " filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + maps_marker[ "_center" ].iconfile + "',sizingmethod=image);" centerMarkert_style_shadow += " filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + maps_marker[ "_center" ].gicon.shadow + "',sizingmethod=image);" insertTag = "
\n"; if( maps_marker[ "_center" ].gicon.shadow ){ insertTag += "
\n"; } } else { insertTag = "\"\"\n"; if( maps_marker[ "_center" ].gicon.shadow ){ insertTag += "\"\"\n"; } } } var temp_css = "left: " + ( temp_gmap.offsetLeft + 10 ) + "px; top: " + ( temp_gmap.offsetHeight - 70 ) + "px; " + style_displayNone; insertTag += mapsMap.infoBar.html.replace( "%css%" , temp_css ); if( maps_poweredBymaps_time ){ insertTag += "
and maps
\n"; } insertTag += "
\n"; if( maps_debug_mode ){ mapsCommon.HTML.write( maps_html_debug , "
 
 
" ); mapsCommon.HTML.setDisplay( maps_html_debug , 1 ); } if( maps__ua.MSIE ){ temp_gmap.parentElement.innerHTML = temp_gmap.parentElement.innerHTML + insertTag; } else { temp_gmap.parentNode.innerHTML = temp_gmap.parentNode.innerHTML + insertTag; } var insertTag = ""; insertTag += "
\n"; document.getElementsByTagName( "body" )[ 0 ].innerHTML = document.getElementsByTagName( "body" )[ 0 ].innerHTML + insertTag; return r_value; } function mapsInit_checkHybridEnable(){ var mapTypes = mapsMap.gmap.getMapTypes(); var result = 0; for( var i = 0 ; i < mapTypes.length ; i++ ){ if( mapTypes[ i ] == _HYBRID_TYPE ){ result = 1 ; break; } } if( result ){ return true; } else { maps_default_type = "satellite"; return false; } } function mapsInit_getDefaultCategory(){ var result_array = mapsCommon.Map.getNearData( maps_category , "all" , 1 ); if( result_array ){ var result = result_array[ 0 ]; } return result; } function mapsInit_debug_timer(){ if( maps__ua.Firefox ){ for ( i = 0; i < document.images.length; i++ ){ if( !document.images[ i ].complete ){ setTimeout( "mapsInit_debug_timer()" , 100 ); return ; } } } var maps_end_date = new Date(); mapsCommon.HTML.write( "maps--debug-timer" , ( ( maps_end_date.getTime() - maps_start_date.getTime() ) / 1000 ) + " 秒" ); } var mapsMap = new function(){ this.id = ""; this.gmap = new Object(); this.inited = 0; this.event = new Object; this.event.moveCompletionID = ""; this.event.moveStart = mapsMap_event_moveStart; this.event.moveEnd = mapsMap_event_moveEnd; this.event.moveCompletion = mapsMap_event_moveCompletion; this.event.resize = mapsMap_event_resize; this.event.zoom = mapsMap_event_zoom; this.event.infoWindowOpen = mapsMap_event_infoWindowOpen; this.event.infoWindowClose = mapsMap_event_infoWindowClose; this.event.mouseWheel = mapsMap_event_mouseWheel; this.event.keyDown = mapsMap_event_keyDown; this.infoBar = new Object(); this.infoBar.clear = mapsMap_infoBar_clear; this.infoBar.display = mapsMap_infoBar_display; this.infoBar.opacity = 0.7; this.infoBar.html = "
\n"; this.infoBar.message = new Object; this.infoBar.message.limitPoint = "表示範囲を超えました。これ以上、移動することはできません。"; this.infoBar.message.limitZoomMin = "表示範囲を超えました。これ以上、詳細にズームすることはできません。"; this.infoBar.message.limitZoomMax = "表示範囲を超えました。これ以上、広域にズームすることはできません。"; this.infoBar.message.waitMarking = "しばらくお待ち下さい。"; this.infoBar.message.waitLoading = "しばらくお待ち下さい。"; this.infoWindow = new Object(); this.infoWindow.tabPage = 1; this.infoWindow.tabLabel = new Array(); this.infoWindow.currentItemID = ""; this.infoWindow.currentMarker = ""; this.infoWindow.enabled = true; this.infoWindow.iconMoveCenterFile = "maps_infowindow_movecenter.png"; this.infoWindow.iconZoomDetailFile = "maps_infowindow_zoomdetail.png"; this.infoWindow.open = mapsMap_infoWindow_open; this.infoWindow.close = mapsMap_infoWindow_close; this.infoWindow.moveCenter = mapsMap_infoWindow_moveCenter; this.infoWindow.zoomDetail = mapsMap_infoWindow_zoomDetail; this.userControl = new Object(); this.userControl.marker = new mapsMap_userControl_marker; this.userControl.marker.type = "marker"; this.userControl.centerMarker = new mapsMap_userControl_marker; this.userControl.centerMarker.type = "centerMarker"; this.userControl.mouseWheel = new Object(); this.userControl.mouseWheel.status = 1; this.userControl.mouseWheel.reverse = 0; this.zMarking = new Object(); this.zMarking.dformerDigit = new Array( 4 , 4 , 3 , 3 , 2 , 2 , 2 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , -1 , -1 , -2 , -2 ); this.init = mapsMap_init; } function mapsMap_init(){ var gmapInitResult = mapsMap_init_gmap(); mapsMap_init_event(); mapsMap.inited = 1; if( !maps_zmarking ){ this.zMarking.dformerDigit = new Array( 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 ); } return gmapInitResult; } function mapsMap_init_gmap(){ mapsMap.gmap = new GMap( document.getElementById( maps_html_googleMap ) ); if( maps_control_zoom == 1 ){ mapsMap.gmap.addControl( new GLargeMapControl() ); } if( maps_control_zoom == 2 ){ mapsMap.gmap.addControl( new GSmallMapControl() ); } if( maps_control_zoom == 3 ){ mapsMap.gmap.addControl( new GSmallZoomControl() ); } if( maps_control_type ){ mapsMap.gmap.addControl( new GMapTypeControl() ); } if( maps_control_scale ){ setTimeout( "mapsMap.gmap.addControl( new GScaleControl() );" , ( maps_poweredBymaps_time * 1000 ) ); } if( maps_default_item ){ var defaultPoint = new GPoint( maps_item[ maps_default_item ].lng , maps_item[ maps_default_item ].lat ); } else if( maps_default_lng && maps_default_lat ){ var defaultPoint = new GPoint( maps_default_lng , maps_default_lat ); } else if( maps_focus_category ){ var defaultPoint = new GPoint( maps_category[ maps_focus_category ].lng , maps_category[ maps_focus_category ].lat ); } else { var defaultPoint = new GPoint( 139.77448 , 35.68402 ); } mapsMap.gmap.centerAndZoom( defaultPoint , maps_default_zoom ); if( maps_default_type == "hybrid" && mapsInit_checkHybridEnable() ){ mapsMap.gmap.setMapType( G_HYBRID_TYPE ); } if( maps_default_type == "satellite" ){ mapsMap.gmap.setMapType( G_SATELLITE_TYPE ); } if( maps_limit_dragging ){ mapsMap.gmap.disableDragging(); } if( maps_infoWindow_tab ){ mapsMap.infoWindow.tabLabel = maps_infoWindow_tab.split( "," ); var update_tabs = function( attr , tabPage ){ if( attr != "page" ){ return; } tabPage = parseInt( tabPage ); mapsMap.infoWindow.tabPage = tabPage; mapsMap.infoWindow.open( "tab" , mapsMap.infoWindow.currentItemID , mapsMap.infoWindow.currentMarker ); } var infoWindow = mapsMap.gmap.getInfoWindow(); infoWindow.addContext( "iwstate" , update_tabs ); infoWindow.addContext( "iwnavigate" , update_tabs ); } var gmapInitResult = new Object; gmapInitResult.defaultPoint = defaultPoint; return gmapInitResult; } function mapsMap_init_event(){ var obj_gmap = document.getElementById( maps_html_googleMap ); GEvent.addListener( mapsMap.gmap , "movestart" , mapsMap.event.moveStart ); GEvent.addListener( mapsMap.gmap , "moveend" , mapsMap.event.moveEnd ); GEvent.addListener( mapsMap.gmap , "zoom" , mapsMap.event.zoom ); GEvent.addListener( mapsMap.gmap , "infowindowopen" , mapsMap.event.infoWindowOpen ); GEvent.addListener( mapsMap.gmap , "infowindowclose" , mapsMap.event.infoWindowClose ); if( maps__ua.MSIE ){ window.attachEvent( "onresize" , mapsMap.event.resize ); } else if( maps__ua.Safari ){ window.onresize = mapsMap.event.resize; } else { window.addEventListener( "resize" , mapsMap.event.resize , false ); } if( maps__ua.MSIE ){ obj_gmap.attachEvent( "onclick" , function(){ obj_gmap.focus(); } ); } if( maps__ua.MSIE ){ obj_gmap.attachEvent( "onmousewheel" , mapsMap.event.mouseWheel ); } else if( maps__ua.Safari ){ obj_gmap.onmousewheel = mapsMap.event.mouseWheel; } else { obj_gmap.addEventListener( "DOMMouseScroll" , mapsMap.event.mouseWheel , false ); } if( maps__ua.MSIE ){ obj_gmap.attachEvent( "onkeydown" , mapsMap.event.keyDown ); } } function mapsMap_event_moveStart(){ var center = mapsMap.gmap.getCenterLatLng(); mapsEX.callback( this , arguments , center.x , center.y ); if( maps_marker[ "_center" ] ){ maps_marker[ "_center" ].movestart(); } if( mapsMap.event.moveCompletionID ){ clearTimeout( mapsMap.event.moveCompletionID ); mapsMap.event.moveCompletionID = ""; } } function mapsMap_event_moveEnd(){ var center = mapsMap.gmap.getCenterLatLng(); mapsEX.callback( this , arguments , center.x , center.y ); if( center.x < maps_limit_lng_min || center.x > maps_limit_lng_max || center.y < maps_limit_lat_min || center.y > maps_limit_lat_max ){ var lng = ( ( new Array( center.x , maps_limit_lng_min , maps_limit_lng_max ) ).sort() )[ 1 ]; var lat = ( ( new Array( center.y , maps_limit_lat_min , maps_limit_lat_max ) ).sort() )[ 1 ]; mapsMap.gmap.recenterOrPanToLatLng( new GPoint( lng , lat ) ); mapsMap.infoBar.display( mapsMap.infoBar.message.limitPoint , 5000 ); return ; } if( maps_marker[ "_center" ] ){ maps_marker[ "_center" ].marking(); } if( mapsMap.event.moveCompletionID ){ clearTimeout( mapsMap.event.moveCompletionID ); } mapsMap.event.moveCompletionID = setTimeout( "mapsMap.event.moveCompletion( " + center.x + " , " + center.y + " )" , 750 ); } function mapsMap_event_moveCompletion( lng , lat ){ mapsEX.callback( this , arguments , lng , lat ); var temp = String( lng ).split( "." ); var str_lng = temp[ 0 ] + "." + temp[ 1 ].substring( 0 , 5 ); var temp = String( lat ).split( "." ); var str_lat = temp[ 0 ] + "." + temp[ 1 ].substring( 0 , 5 ); mapsInfo.setURL( "point" , str_lng , str_lat ); if( maps_html_mapInfo_point ){ mapsInfo.dispPoint( lng , lat ); } if( ( mapsSort.distance && mapsInfo.urlPriorityType != "item" ) || maps_focus_category == "_map" ){ maps_category[ maps_focus_category ].marking(); } if( maps_html_itemNavi_autoZoom ){ mapsItemNavi.checkAutoZoom(); } if( maps_debug_mode ){ mapsCommon.HTML.write( "maps--debug-point" , ( str_lng + " , " + str_lat + "      lng=\"" + str_lng + "\" lat=\"" + str_lat + "\"" + "      z=" + mapsMap.gmap.getZoomLevel() ) ); } if( maps_html_googleLocal ){ document.getElementById( maps_html_googleLocal ).value = String( lat ) + "," + String( lng ); } mapsMap.event.moveCompletionID = ""; } function mapsMap_event_resize(){ var windowSize = mapsCommon.HTML.getWindowSize(); mapsEX.callback( this , arguments , windowSize.width , windowSize.height ); var map_width = parseInt( document.getElementById( maps_html_googleMap ).offsetWidth ); var map_height = parseInt( document.getElementById( maps_html_googleMap ).offsetHeight ); if( maps_design_mapLiquidWidth ){ map_width = windowSize.width + maps_design_mapLiquidWidth; } if( maps_design_mapLiquidHeight ){ map_height = windowSize.height + maps_design_mapLiquidHeight; } if( maps_marker[ "_center" ] && map_width % 2 == 1 ){ map_width--; } if( maps_marker[ "_center" ] && map_height % 2 == 1 ){ map_height--; } if( maps_design_mapLiquidWidth ){ document.getElementById( maps_html_googleMap ).style.width = String( map_width ) + "px"; } if( maps_design_mapLiquidHeight ){ document.getElementById( maps_html_googleMap ).style.height = String( map_height ) + "px"; } if( maps_apiversion < 2 ){ mapsMap.gmap.onResize(); } } function mapsMap_event_zoom( oldZoomLevel, newZoomLevel ){ mapsEX.callback( this , arguments , oldZoomLevel, newZoomLevel ); if( newZoomLevel < maps_limit_zoom_min ){ mapsMap.gmap.zoomTo( maps_limit_zoom_min ); mapsMap.infoBar.display( mapsMap.infoBar.message.limitZoomMin , 5000 ); return ; } if( newZoomLevel > maps_limit_zoom_max ){ mapsMap.gmap.zoomTo( maps_limit_zoom_max ); mapsMap.infoBar.display( mapsMap.infoBar.message.limitZoomMax , 5000 ); return ; } if( mapsMap.zMarking.dformerDigit[ oldZoomLevel ] != mapsMap.zMarking.dformerDigit[ newZoomLevel ] ){ maps_category[ maps_focus_category ].marking( "" , "TYPE:zoom" ); } } function mapsMap_event_infoWindowOpen(){ var temp_id = mapsMap.infoWindow.currentItemID; if( !temp_id ){ mapsMap.infoWindow.currentItemID = "_unknown"; } mapsEX.callback( this , arguments , temp_id ); mapsInfo.setURL( "item" , temp_id ); if( maps_marker[ "_center" ] ){ maps_marker[ "_center" ].remove(); } } function mapsMap_event_infoWindowClose(){ var temp_id = mapsMap.infoWindow.currentItemID; mapsEX.callback( this , arguments , temp_id ); mapsMap.infoWindow.currentItemID = ""; mapsInfo.urlPriorityType = ""; if( maps_marker[ "_center" ] ){ maps_marker[ "_center" ].marking(); } } function mapsMap_event_mouseWheel( event ){ if( maps_limit_zoomByMouseWheel ){ return ; } mapsEX.callback( this , arguments ); if( mapsInfo.urlPriorityType == "item" ){ return ; } if( !mapsMap.userControl.mouseWheel.status ){ return ; } if( maps__ua.MSIE ){ var delta = event.wheelDelta; event.returnValue = false; } else if( maps__ua.Safari ){ var delta = event.wheelDelta; event.returnValue = false; } else { var delta = event.detail * -1; event.preventDefault(); } if( mapsMap.userControl.mouseWheel.reverse ){ delta *= -1; } mapsMap.gmap.zoomTo( mapsMap.gmap.getZoomLevel() + ( delta < 0 ? 1 : -1 ) ); } function mapsMap_event_keyDown( event ){ if( maps_limit_operateByKeyboard ){ return ; } if( maps__ua.MSIE ){ var keyCode = event.keyCode; } else { var keyCode = event.witch; } mapsEX.callback( this , arguments , event , keyCode ); if( mapsCommon.Variable.getTempValue( "temp_operatebykeyboard" , false ) == 1 ){ return mapsCommon.Event.cancel( event ); } if( mapsMap.infoWindow.currentItemID ){ if( keyCode == 9 ){ mapsMap.gmap.closeInfoWindow(); } return true; } var lng = 0; var lat = 0; var wait = 0; var bounds = mapsMap.gmap.getBoundsLatLng(); var center = mapsMap.gmap.getCenterLatLng(); switch( keyCode ){ case 107 : mapsMap.gmap.zoomTo( mapsMap.gmap.getZoomLevel() - 1 ); break; case 109 : mapsMap.gmap.zoomTo( mapsMap.gmap.getZoomLevel() + 1 ); break; case 33 : lat = bounds.maxY + ( ( bounds.maxY - bounds.minY ) / 3 ); wait = 1000; break; case 35 : lng = bounds.maxX + ( ( bounds.maxX - bounds.minX ) / 3 ); wait = 1000; break; case 34 : lat = bounds.minY - ( ( bounds.maxY - bounds.minY ) / 3 ); wait = 1000; break; case 36 : lng = bounds.minX - ( ( bounds.maxX - bounds.minX ) / 3 ); wait = 1000; break; case 38 : lat = center.y + ( ( bounds.maxY - bounds.minY ) / 10 ); wait = 500; break; case 39 : lng = center.x + ( ( bounds.maxX - bounds.minX ) / 10 ); wait = 500; break; case 40 : lat = center.y - ( ( bounds.maxY - bounds.minY ) / 10 ); wait = 500; break; case 37 : lng = center.x - ( ( bounds.maxX - bounds.minX ) / 10 ); wait = 500; break; case 9 : if( mapsItemNavi.firstID ){ document.getElementById( mapsItemNavi.firstID ).focus(); } break; case 27 : mapsMap.gmap.closeInfoWindow(); break; } if( lng || lat ){ mapsMap.gmap.recenterOrPanToLatLng( new GPoint( ( lng ? lng : center.x ) , ( lat ? lat : center.y ) ) ); mapsCommon.Variable.setTempValue( 1 , "temp_operatebykeyboard" ); setTimeout( "mapsCommon.Variable.clearTempValue( \"temp_operatebykeyboard\" );" , wait ); } mapsCommon.Event.cancel( event ); } function mapsMap_infoBar_clear(){ mapsEX.callback( this , arguments ); if( !maps__ua.Opera ){ var obj = document.getElementById( "maps--map-infobar" ); mapsMap.infoBar.opacity = ( mapsMap.infoBar.opacity >= 0.1 ? mapsMap.infoBar.opacity - 0.1 : 0.7 ); if( maps__ua.MSIE ){ obj.style.filter = "Alpha(opacity=" + String( mapsMap.infoBar.opacity * 100 ) + ")"; } if( maps__ua.Gecko ){ obj.style.MozOpacity = mapsMap.infoBar.opacity; } if( maps__ua.Safari ){ obj.style.opacity = mapsMap.infoBar.opacity; } if( mapsMap.infoBar.opacity != 0.7 ){ setTimeout( "mapsMap.infoBar.clear();" , 75 ); return; } } mapsCommon.HTML.setDisplay( "maps--map-infobar" , 0 ); } function mapsMap_infoBar_display( value , msec ){ mapsEX.callback( this , arguments ); var obj_infoBar = document.getElementById( 'maps--map-infobar' ); obj_infoBar.style.width = String( document.getElementById( maps_html_googleMap ).offsetWidth - 40 ) + "px"; mapsCommon.HTML.setDisplay( "maps--map-infobar" , 1 ); obj_infoBar.innerHTML = value; if( msec ){ setTimeout( "mapsMap.infoBar.clear();" , msec ); } } function mapsMap_infoWindow_open( type , item_id , marker ){ if( !mapsMap.infoWindow.enabled ){ return; } if( mapsMap.infoWindow.currentItemID ){ mapsMap.gmap.closeInfoWindow(); } var tabPage = mapsMap.infoWindow.tabPage; if( tabPage == undefined ){ tabPage = 1; } mapsMap.infoWindow.currentItemID = item_id; mapsMap.infoWindow.currentMarker = marker; var callback_result = mapsEX.callback( this , arguments, type , item_id , marker ); if( callback_result.cancelParentProcess ){ return ; } var temp_html = maps_item[ item_id ].getInfoWindowHTML(); var func_html = ""; var func_css_left = 0; if( maps_infoWindow_func_moveCenter ){ func_html += mapsCommon.HTML.makePngTag( maps_image_path + mapsMap.infoWindow.iconMoveCenterFile , 40 , 13 , { onclick : "mapsMap.infoWindow.moveCenter( event );" , style : "position: absolute; left: " + func_css_left + "px; cursor: hand;" } , "image" ); func_css_left += 42; } if( maps_infoWindow_func_zoomDetail ){ func_html += mapsCommon.HTML.makePngTag( maps_image_path + mapsMap.infoWindow.iconZoomDetailFile , 40 , 13 , { onclick : "mapsMap.infoWindow.zoomDetail( event );" , style : "position: absolute; left: " + func_css_left + "px; cursor: hand;" } , "image" ); func_css_left += 42; } if( func_html ){ temp_html = "
" + func_html + "
" + temp_html; } marker.openInfoWindowHtml( temp_html ); } function mapsMap_infoWindow_close(){ } function mapsMap_infoWindow_moveCenter( event ){ var temp = maps_item[ mapsMap.infoWindow.currentItemID ]; var lng = ( temp.zCurrentPoint.lng ? temp.zCurrentPoint.lng : temp.lng ) + ( Math.random() / 100000 ); var lat = ( temp.zCurrentPoint.lat ? temp.zCurrentPoint.lat : temp.lat ) + ( Math.random() / 100000 ); mapsMap.gmap.closeInfoWindow(); mapsMap.gmap.recenterOrPanToLatLng( new GPoint( lng , lat ) ); } function mapsMap_infoWindow_zoomDetail( event ){ var temp = maps_item[ mapsMap.infoWindow.currentItemID ].zBrother; var map_point = new mapsPoint(); for( var i = 0 ; i < temp.length ; i++ ){ map_point.addPoint( maps_item[ temp[ i ] ].lng , maps_item[ temp[ i ] ].lat ); } mapsMap.gmap.closeInfoWindow(); map_point.moveCenterAndZoom(); } function mapsMap_userControl_marker(){ this.type = ""; this.visibility = 1; this.changeVisibility = mapsMap_userControl_marker_changeVisibility; } function mapsMap_userControl_marker_changeVisibility( status ){ this.visibility = status; mapsEX.callback( this , arguments , status ); switch( this.type ){ case "marker" : maps_category[ maps_focus_category ].marking(); break; case "centerMarker" : maps_marker[ "_center" ].marking(); break; } } function mapsCategory( category_id , name , lng , lat , group ){ this.id = category_id; this.name = name; this.lng = parseFloat( lng ); this.lat = parseFloat( lat ); this.group = ( group != undefined ? group : "" ); this.defaultItems = new Array(); this.searchResultItems = new Array(); this.sortCacheItems = new Array(); this.markerCount = 0; this.bounds = { minLng : 180 , maxLng : -180 , minLat : 90 , maxLat : -90 }; if( category_id == "_map" ){ this.cacheItems = ""; } } mapsCategory.prototype = new function(){ this.setItem = mapsCategory_setItem; this.addSearchResultItems = mapsCategory_addSearchResultItems; this.change = mapsCategory_change; this.clearSearchResultItems = mapsCategory_clearSearchResultItems; this.clearSortCacheItems = mapsCategory_clearSortCacheItems; this.getTargetItems = mapsCategory_getTargetItems; this.getZMarker = mapsCategory_getZMarker; this.marking = mapsCategory_marking; this.sort = mapsCategory_sort; } var mapsCategory_callback = new mapsCategory( "" , "" , 0 , 0 , "" ); function mapsCategory_setItem( item_id , lng , lat ){ this.defaultItems[ this.defaultItems.length ] = item_id; if( this.bounds.minLng > lng ){ this.bounds.minLng = lng; } if( this.bounds.maxLng < lng ){ this.bounds.maxLng = lng; } if( this.bounds.minLat > lat ){ this.bounds.minLat = lat; } if( this.bounds.maxLat < lat ){ this.bounds.maxLat = lat; } } function mapsCategory_addSearchResultItems( item_id ){ this.searchResultItems[ this.searchResultItems.length ] = item_id; } function mapsCategory_change( option , tid ){ if( option == undefined ){ option = ""; } if( this.id == "-" ){ return ; } mapsItemNavi.page.num = 1; if( !tid ){ mapsEX.callback( this , arguments ); } mapsMap.gmap.closeInfoWindow(); if( !tid ){ var map_point = new mapsPoint(); } else { var temp = mapsCommon.Variable.getTempValue( tid , false ); var map_point = temp.map_point; option = temp.option; } if( mapsSort.distance ){ var center = mapsMap.gmap.getCenterLatLng(); if( this.lng != center.x || this.lat != center.y ){ option += " MARKING:off ITEMNAVI:off"; } } var result = this.marking( map_point , option , tid ); maps_focus_category = this.id; if( !result ){ return; } if( !option.match( /MOVE:off/ ) ){ var temp_autoCentering = maps_category_autoCentering; if( option.match( /AUTOCENTERING:([0-9])/ ) ){ temp_autoCentering = parseInt( RegExp.$1 ); } if( map_point && temp_autoCentering ){ switch( temp_autoCentering ){ case 1: map_point.moveCenter(); break; case 2: map_point.moveCenterAndZoom(); break; } } else if( this.lng && this.lat ){ mapsMap.gmap.recenterOrPanToLatLng( new GPoint( this.lng , this.lat ) ); } map_point = new Object(); } mapsInfo.setURL( "category" , this.id ); if( maps__ua.MSIE ){ document.getElementById( maps_html_googleMap ).focus(); } } function mapsCategory_clearSearchResultItems(){ this.searchResultItems = new Array(); } function mapsCategory_clearSortCacheItems(){ this.sortCacheItems = new Array(); } function mapsCategory_getTargetItems(){ var targetItems = new Array(); var callback_result = mapsEX.callback( this , arguments ); if( callback_result.cancelParentProcess ){ return callback_result.returnValue.targetItems; } if( this.id == "_all" ){ for( var category_id in maps_category ){ if( category_id == "clear" || category_id.match( /^_/ ) ){ continue; } targetItems = targetItems.concat( ( !mapsSearch.status ? maps_category[ category_id ].defaultItems : maps_category[ category_id ].searchResultItems ) ); } } else if( this.id == "_map" ){ var bounds = mapsMap.gmap.getBoundsLatLng(); var bound_w = ( bounds.maxX - bounds.minX ) / 2; var bound_h = ( bounds.maxY - bounds.minY ) / 2; for( var category_id in maps_category ){ if( category_id == "clear" || category_id.match( /^_/ ) ){ continue; } var c_bounds = maps_category[ category_id ].bounds; if( ( c_bounds.maxLng < bounds.minX - bound_w ) || ( bounds.maxX + bound_w < c_bounds.minLng ) || ( c_bounds.maxLat < bounds.minY - bound_h ) || ( bounds.maxY + bound_h < c_bounds.minLat ) ){ continue; } var temp_targetItems = ( !mapsSearch.status ? maps_category[ category_id ].defaultItems : maps_category[ category_id ].searchResultItems ); for( var i = 0 ; i < temp_targetItems.length ; i++ ){ if( ( maps_item[ temp_targetItems[ i ] ].lng < bounds.minX - bound_w ) || ( bounds.maxX + bound_w < maps_item[ temp_targetItems[ i ] ].lng ) || ( maps_item[ temp_targetItems[ i ] ].lat < bounds.minY - bound_h ) || ( bounds.maxY + bound_h < maps_item[ temp_targetItems[ i ] ].lat ) ){ continue; } targetItems[ targetItems.length ] = temp_targetItems[ i ]; } } } else { targetItems = ( !mapsSearch.status ? this.defaultItems : this.searchResultItems ); } if( mapsSort.status || mapsSort.distance ){ targetItems = this.sort( targetItems ); } if( mapsItemNavi.page.items ){ var page_num = mapsItemNavi.page.num; var page_items = mapsItemNavi.page.items; mapsItemNavi.page.qty = Math.ceil( targetItems.length / page_items ); targetItems = targetItems.slice( ( page_num - 1 ) * page_items , page_num * page_items ); } return targetItems; } function mapsCategory_marking( map_point , option , tid ){ if( option == undefined ){ option = ""; } if( !tid ){ var targetItems = this.getTargetItems(); var zMarker = this.getZMarker( targetItems , map_point ); if( mapsCommon.Array.count( zMarker.zpoint ) >= 20 && mapsMap.userControl.marker.visibility && !option.match( /MARKING:off/ ) ){ var temp = new Object; temp.targetItems = targetItems; temp.zMarker = zMarker; temp.map_point = map_point; temp.option = option; var tid = mapsCommon.Variable.setTempValue( temp ); mapsMap.infoBar.display( mapsMap.infoBar.message.waitMarking , 0 ); mapsItemNavi.clear(); if( map_point ){ setTimeout( "maps_category[ '" + this.id + "' ].change( '' , '" + tid + "' );" , 100 ); } else { setTimeout( "maps_category[ '" + this.id + "' ].marking( 0 , '" + option + "' , '" + tid + "' );" , 100 ); } return false; } } else { var temp = mapsCommon.Variable.getTempValue( tid ); var targetItems = temp.targetItems; var zMarker = temp.zMarker; mapsMap.infoBar.clear(); } if( this.id == "_map" && zMarker.cacheItems == this.cacheItems ){ return ; } else if( this.id == "_map" ){ this.cacheItems = zMarker.cacheItems; } if( !tid && this.id != "_map" && option.match( /TYPE:zoom/ ) && this.markerCount == mapsCommon.Array.count( zMarker.zpoint ) && maps_category_autoCentering != 2 ){ return ; } for( var i = 0 ; i < maps_current_marker.length ; i++ ){ mapsMap.gmap.removeOverlay( maps_current_marker[ i ] ); } maps_current_marker = new Array(); if( map_point && ( maps_category_autoCentering == 2 || option.match( /AUTOCENTERING:2/ ) ) && !option.match( /INIT/ ) ){ map_point.setCenterAndZoom(); if( mapsMap.zMarking.dformerDigit[ map_point.newZoom ] != mapsMap.zMarking.dformerDigit[ mapsMap.gmap.getZoomLevel() ] ){ return true; } } if( !option.match( /MARKING:off/ ) ){ for( var zpoint in zMarker.zpoint ){ if( zpoint == "clear" ){ continue; } maps_item[ zMarker.zpoint[ zpoint ].item_id ].addMarker( zMarker.zpoint[ zpoint ].count , ( zMarker.zpoint[ zpoint ].sumLng / zMarker.zpoint[ zpoint ].qty ) , ( zMarker.zpoint[ zpoint ].sumLat / zMarker.zpoint[ zpoint ].qty ) , zMarker.zpoint[ zpoint ].marker , zMarker.zpoint[ zpoint ].items.length ); } this.markerCount = mapsCommon.Array.count( zMarker.zpoint ); } if( !option.match( /ITEMNAVI:off/ ) ){ for( var i = 0 ; i < targetItems.length ; i++ ){ var item_id = targetItems[ i ]; var zpoint = zMarker.item2point[ item_id ]; if( this.id == "_map" && !zMarker.zpoint[ zpoint ].flagInMap ){ continue; } mapsItemNavi.add( item_id , zMarker.zpoint[ zpoint ].count , zMarker.zpoint[ zpoint ].marker ); maps_item[ item_id ].zBrother = zMarker.zpoint[ zpoint ].items; maps_item[ item_id ].zCurrentPoint = { lng : ( zMarker.zpoint[ zpoint ].sumLng / zMarker.zpoint[ zpoint ].qty ) , lat : ( zMarker.zpoint[ zpoint ].sumLat / zMarker.zpoint[ zpoint ].qty ) }; } mapsItemNavi.make(); } return true; } function mapsCategory_getZMarker( targetItems , map_point ){ var bounds = mapsMap.gmap.getBoundsLatLng(); var count = 1; var zMarker = new Object(); zMarker.zpoint = new Array(); zMarker.item2point = new Array(); zMarker.cacheItems = ""; // for( var i = 0 ; i < targetItems.length ; i++ ){ var item_id = targetItems[ i ]; var zpoint = maps_item[ item_id ].getZPoint(); var marker = ( maps_marker_key ? maps_item[ item_id ].data[ maps_marker_key ] : "" ); if( zMarker.zpoint[ zpoint ] == null ){ zMarker.zpoint[ zpoint ] = new Object(); zMarker.zpoint[ zpoint ].item_id = item_id; zMarker.zpoint[ zpoint ].marker = ""; zMarker.zpoint[ zpoint ].qty = 0; zMarker.zpoint[ zpoint ].sumLng = 0; zMarker.zpoint[ zpoint ].sumLat = 0; zMarker.zpoint[ zpoint ].items = new Array(); zMarker.zpoint[ zpoint ].flagInMap = ( ( maps_item[ item_id ].lng < bounds.minX ) || ( bounds.maxX < maps_item[ item_id ].lng ) || ( maps_item[ item_id ].lat < bounds.minY ) || ( bounds.maxY < maps_item[ item_id ].lat ) ? 0 : 1 ); if( this.id != "_map" || zMarker.zpoint[ zpoint ].flagInMap ){ zMarker.zpoint[ zpoint ].count = count; count++; } else { zMarker.zpoint[ zpoint ].count = 0; } } zMarker.zpoint[ zpoint ].qty++; zMarker.zpoint[ zpoint ].sumLng += maps_item[ item_id ].lng; zMarker.zpoint[ zpoint ].sumLat += maps_item[ item_id ].lat zMarker.zpoint[ zpoint ].items[ zMarker.zpoint[ zpoint ].items.length ] = item_id; if( maps_marker[ marker ] ){ if( !zMarker.zpoint[ zpoint ].marker ){ zMarker.zpoint[ zpoint ].marker = marker; } else if( maps_marker[ marker ].priority == maps_marker[ zMarker.zpoint[ zpoint ].marker ].priority ){ } else if( maps_marker[ "_composite" ] ){ zMarker.zpoint[ zpoint ].marker = "_composite"; } else if( maps_marker[ marker ].priority < maps_marker[ zMarker.zpoint[ zpoint ].marker ].priority ){ zMarker.zpoint[ zpoint ].marker = marker; } } zMarker.cacheItems += item_id + "-" + zMarker.zpoint[ zpoint ].count + " "; zMarker.item2point[ item_id ] = zpoint; if( map_point ){ map_point.addPoint( maps_item[ item_id ].lng , maps_item[ item_id ].lat ); } } return zMarker; } function mapsCategory_sort( targetItems ){ if( !mapsSort.distance && this.id != "_map" && maps_category[ this.id ].sortCacheItems.length ){ return maps_category[ this.id ].sortCacheItems; } if( mapsSort.distance ){ var center = mapsMap.gmap.getCenterLatLng(); var lng = center.x; var lat = center.y; } var search_array = new Array(); for( var i = 0 ; i < targetItems.length ; i++ ){ if( mapsSort.distance ){ search_array[ targetItems[ i ] ] = maps_item[ targetItems[ i ] ].getDistance( lng , lat ); } else { var temp = maps_item[ targetItems[ i ] ].data[ mapsSort.key ]; search_array[ targetItems[ i ] ] = ( mapsSort.type == "number" ? parseFloat( temp ) : temp ); } } search_array = mapsCommon.Array.sort( search_array , "" , ( !mapsSort.distance && mapsSort.desc ? "desc" : "" ) ); var result_array = mapsCommon.Array.keys( search_array ); this.sortCacheItems = result_array; return result_array; } function mapsItem( item_id , category_id , name , lng , lat , argJS , argXML ){ this.id = item_id; this.category = category_id; this.lng = parseFloat( lng ); this.lat = parseFloat( lat ); this.name = name; this.distance = 0; this.zBrother = new Array(); this.zCurrentPoint = new Object(); var gData = new Array(); if( argJS ){ for( var i= 0 ; i < maps_item_argName.length ; i++ ){ gData[ maps_item_argName[ i ] ] = ( argJS[ i ] ? argJS[ i ] : "" ); } } if( argXML ){ gData = argXML; } this.data = gData; this.distance = 0; maps_category[ category_id ].setItem( item_id , this.lng , this.lat ); } mapsItem.prototype = new function(){ this.addMarker = mapsItem_addMarker; this.getDistance = mapsItem_getDistance; this.getInfoWindowHTML = mapsItem_getInfoWindowHTML; this.getZPoint = mapsItem_getZPoint; this.makeHTML = mapsItem_makeHTML; this.moveCenter = mapsItem_moveCenter; this.openInfoWindowByItemNavi = mapsItem_openInfoWindowByItemNavi; } function mapsItem_addMarker( count , zLng , zLat , marker_id , zBrothers ){ if( !mapsMap.userControl.marker.visibility ){ return ; } var lng = ( zLng ? zLng : this.lng ); var lat = ( zLat ? zLat : this.lat ); if( !marker_id || !maps_marker[ marker_id ] ){ marker_id = "_default"; } maps_marker[ marker_id ].gicon.image = maps_marker[ marker_id ].iconfile.replace( "%count%" , ( maps_marker[ marker_id ].filesuffix[ count ] ? maps_marker[ marker_id ].filesuffix[ count ] : maps_marker[ marker_id ].filesuffix[ 0 ] ) ); var m = maps_current_marker.length; maps_current_marker[ m ] = new GMarker( new GPoint( lng , lat ) , maps_marker[ marker_id ].gicon ); mapsMap.gmap.addOverlay( maps_current_marker[ m ] ); if( maps_apiversion < 2 ){ maps_current_marker[ m ].iconImage.setAttribute( "title" , this.name + ( zBrothers >= 2 ? " 他" : "" ) ); } var temp_id = this.id; GEvent.addListener( maps_current_marker[ m ] , "click" , function() { mapsMap.infoWindow.open( "marker" , temp_id , maps_current_marker[ m ] ); } ); } function mapsItem_getDistance( lng , lat ){ var distance = mapsCommon.Map.convPointsToDistance( this.lng , this.lat , lng , lat ); this.distance = distance; return distance; } function mapsItem_getInfoWindowHTML(){ var html = ""; var tab = new Array( "-" , true , false ); var tabPage = mapsMap.infoWindow.tabPage; var myZPoint = this.getZPoint(); var temp_html = this.makeHTML(); html = ( typeof( temp_html ) == "object" ? temp_html.html : temp_html ); tab = mapsItem_getInfoWindowHTML_tab( tab , ( typeof( temp_html ) == "object" ? temp_html.tab : new Array() ) ); var targetItems = this.zBrother; for( var i = 0 ; i < targetItems.length ; i++ ){ var item_id = targetItems[ i ]; if( item_id == this.id ){ continue; } temp_html = maps_item[ item_id ].makeHTML(); html += maps_zmarking_separate + ( typeof( temp_html ) == "object" ? temp_html.html : temp_html ); tab = mapsItem_getInfoWindowHTML_tab( tab , ( typeof( temp_html ) == "object" ? temp_html.tab : new Array() ) ); } var flag_tab = ( ( tabPage == 1 && tab[ 2 ] ) || tabPage == 2 ? true : false ); var temp_gmap = document.getElementById( maps_html_googleMap ); var layoutSize = mapsCommon.HTML.getLayoutSize( html ); var tab_attr = ( flag_tab ? "page=\"" + tabPage + "\" label=\"" + mapsMap.infoWindow.tabLabel[ tabPage - 1 ] + "\"" : "" ); if( layoutSize.width >= ( temp_gmap.offsetWidth / 1.25 ) || layoutSize.height >= ( temp_gmap.offsetHeight / 2 ) ){ if( layoutSize.height >= ( temp_gmap.offsetHeight / 2 ) ){ layoutSize.width += 20; } var css_w = ( layoutSize.width >= ( temp_gmap.offsetWidth / 1.25 ) ? 1 : 0 ); var css_h = ( layoutSize.height >= ( temp_gmap.offsetHeight / 2 ) ? 1 : 0 ); html = "
" + html + "
"; } else { html = "
" + html + "
"; } if( flag_tab ){ if( tabPage == 1 ){ html += "
"; } else { html = "
" + html; } } return html; } function mapsItem_getInfoWindowHTML_tab( tab , ref_tab ){ if( ref_tab == undefined ){ ref_tab = new Array(); } for( var i = 1 ; i <= 2 ; i++ ){ if( ref_tab[ i ] ){ tab[ i ] = true; } if( ref_tab[ i ] == undefined && maps_infoWindow_tab_defaultVisible ){ tab[ i ] = true; } } return tab; } function mapsItem_getZPoint(){ var z = mapsMap.gmap.getZoomLevel(); var lng = Math.round( this.lng * Math.pow( 10 , mapsMap.zMarking.dformerDigit[ z ] ) ) / Math.pow( 10 , mapsMap.zMarking.dformerDigit[ z ] ); var lat = Math.round( this.lat * Math.pow( 10 , mapsMap.zMarking.dformerDigit[ z ] ) ) / Math.pow( 10 , mapsMap.zMarking.dformerDigit[ z ] ); var zpoint = String( lng ) + "," + String( lat ); return zpoint; } function mapsItem_makeHTML(){ var gData = this.data; var iData = new Array(); for( var i in gData ){ iData[ i ] = gData[ i ]; } if( typeof( user_mapsItem_makeHTML ) == "function" ){ var html = user_mapsItem_makeHTML( iData ); } else if( maps_template[ "undefined" ] ){ var html = mapsCommon.Data.convTemplate( iData ); } else { if( typeof( iData[ "value" ] ) == "undefined" ){ iData[ "value" ] = ""; } if( typeof( iData[ "_html" ] ) == "undefined" ){ iData[ "_html" ] = ""; } var html = "
" + iData[ "name" ] + "
" + iData[ "value" ] + iData[ "_html" ] + "
"; } return html; } function mapsItem_moveCenter(){ mapsMap.gmap.closeInfoWindow(); mapsMap.gmap.recenterOrPanToLatLng( new GPoint( this.lng , this.lat ) ); } function mapsItem_openInfoWindowByItemNavi( count , option ){ if( option == undefined ){ option = ""; } var lng = ( this.zCurrentPoint.lng ? this.zCurrentPoint.lng : this.lng ); var lat = ( this.zCurrentPoint.lat ? this.zCurrentPoint.lat : this.lat ); var marker = ( maps_marker_key ? maps_item[ this.id ].data[ maps_marker_key ] : "" ); if( !marker || !maps_marker[ marker ] ){ marker = "_default"; } maps_marker[ marker ].gicon.image = maps_marker[ marker ].iconfile.replace( "%count%" , ( maps_marker[ marker ].filesuffix[ count ] ? maps_marker[ marker ].filesuffix[ count ] : maps_marker[ marker ].filesuffix[ 0 ] ) ); var marker = new GMarker( new GPoint( lng , lat ) , maps_marker[ marker ].gicon ); mapsMap.gmap.addOverlay( marker ); var temp_id = this.id; mapsMap.infoWindow.open( "itemNavi" , temp_id , marker ); GEvent.addListener( marker , 'infowindowclose' , function(){ if( !mapsMap.userControl.marker.visibility || option.match( /ADDMARKER/ ) ){ mapsMap.gmap.removeOverlay( marker ); } } ); if( mapsMap.userControl.marker.visibility && !option.match( /ADDMARKER/ ) ){ mapsMap.gmap.removeOverlay( marker ); } } function mapsPoint(){ this.count = 0; this.minLng = 0; this.maxLng = 0; this.minLat = 0; this.maxLat = 0; this.newPoint = 0; this.newLng = 0; this.newLat = 0; this.newZoom = 0; this.addPoint = mapsPoint_addPoint; this.moveCenter = mapsPoint_moveCenter; this.moveCenterAndZoom = mapsPoint_moveCenterAndZoom; this.setCenterAndZoom = mapsPoint_setCenterAndZoom; } function mapsPoint_addPoint( lng , lat ){ if( !lng || !lat ){ return ; } this.count++ if( !this.minLng || this.minLng > lng ){ this.minLng = lng; } if( !this.maxLng || this.maxLng < lng ){ this.maxLng = lng; } if( !this.minLat || this.minLat > lat ){ this.minLat = lat; } if( !this.maxLat || this.maxLat < lat ){ this.maxLat = lat; } } function mapsPoint_moveCenter(){ mapsMap.gmap.recenterOrPanToLatLng( new GPoint( ( this.minLng + this.maxLng ) / 2 , ( this.minLat + this.maxLat ) / 2 ) ); } function mapsPoint_moveCenterAndZoom(){ if( !this.newPoint ){ this.setCenterAndZoom(); } mapsMap.gmap.centerAndZoom( new GPoint( this.newLng , this.newLat ) , this.newZoom ); } function mapsPoint_setCenterAndZoom(){ if( !this.count ){ return ; } var bounds = mapsMap.gmap.getBoundsLatLng(); var bound_w = bounds.maxX - bounds.minX; var bound_h = bounds.maxY - bounds.minY; var new_lng = ( this.minLng + this.maxLng ) / 2; var new_lat = ( this.minLat + this.maxLat ) / 2; if( this.count <= 1 ){ var n = 0; } else if( new_lng - ( bound_w / 2 ) > this.minLng || new_lng + ( bound_w / 2 ) < this.maxLng || new_lat - ( bound_h / 2 ) > this.minLat || new_lat + ( bound_h / 2 ) < this.maxLat ){ var n_x = Math.ceil( Math.log( Math.max( this.maxLng - new_lng , new_lng - this.minLng ) / ( bound_w / 2 ) ) / Math.log( 2 ) ) var n_y = Math.ceil( Math.log( Math.max( this.maxLat - new_lat , new_lat - this.minLat ) / ( bound_h / 2 ) ) / Math.log( 2 ) ) var n = mapsMap.gmap.getZoomLevel() + Math.max( n_x , n_y ); if( n > 17 ){ n = 17; } } else { var n_x = Math.floor( Math.log( ( bound_w / 2 ) / Math.max( this.maxLng - new_lng , new_lng - this.minLng ) ) / Math.log( 2 ) ) var n_y = Math.floor( Math.log( ( bound_h / 2 ) / Math.max( this.maxLat - new_lat , new_lat - this.minLat ) ) / Math.log( 2 ) ) var n = mapsMap.gmap.getZoomLevel() - Math.min( n_x , n_y ); if( n < 0 ){ n = 0; } } this.newPoint = 1; this.newLng = new_lng; this.newLat = new_lat; this.newZoom = n; } function mapsMarker( type ){ this.gicon = ""; this.iconfile = ""; this.filesuffix = new Array(); this.naviprefix = new Array(); if( type == "_center" ){ this.marker = ""; this.width = 0; this.height = 0; this.marking = mapsMarker_marking; this.remove = mapsMarker_remove; this.movestart = mapsMarker_movestart; } } function mapsMarker_marking(){ if( mapsInfo.urlPriorityType == "item" ){ return ; } mapsCommon.HTML.setDisplay( "maps--icon-center-outer-icon" , 0 ); mapsCommon.HTML.setDisplay( "maps--icon-center-outer-shadow" , 0 ); if( this.marker ){ mapsMap.gmap.removeOverlay( this.marker ); } if( !mapsMap.userControl.centerMarker.visibility ){ return; } this.marker = new GMarker( mapsMap.gmap.getCenterLatLng() , this.gicon ); mapsMap.gmap.addOverlay( this.marker ); if( maps_apiversion < 2 ){ this.marker.iconImage.style.cursor = "default"; } } function mapsMarker_remove(){ mapsMap.gmap.removeOverlay( this.marker ); mapsCommon.HTML.setDisplay( "maps--icon-center-outer-icon" , 0 ); mapsCommon.HTML.setDisplay( "maps--icon-center-outer-shadow" , 0 ); this.marker = ""; } function mapsMarker_movestart(){ if( !mapsMap.userControl.centerMarker.visibility ){ return; } if( mapsInfo.urlPriorityType == "item" ){ return ; } this.remove(); var maps_obj = document.getElementById( maps_html_googleMap ); var x = String( maps_obj.offsetLeft + ( ( maps_obj.offsetWidth - this.width + 1 ) / 2 ) + maps_marker_center_adjust_x ) + "px"; var y = String( maps_obj.offsetTop + ( ( maps_obj.offsetHeight - this.height + 1 ) / 2 ) + maps_marker_center_adjust_y ) + "px"; document.getElementById( "maps--icon-center-outer-icon" ).style.left = x; document.getElementById( "maps--icon-center-outer-icon" ).style.top = y; if( maps_marker[ "_center" ].gicon.shadow ){ document.getElementById( "maps--icon-center-outer-shadow" ).style.left = x; document.getElementById( "maps--icon-center-outer-shadow" ).style.top = y; } mapsCommon.HTML.setDisplay( "maps--icon-center-outer-icon" , 1 ); mapsCommon.HTML.setDisplay( "maps--icon-center-outer-shadow" , 1 ); } var mapsSearch = new function(){ this.status = 0; this.count = 0; this.dictionarySynonym = new Array(); this.init = mapsSearch_init; this.clear = mapsSearch_clear; this.dispMessage = mapsSearch_dispMessage; this.search = mapsSearch_search; this.itemName = new Object; this.itemName.name = new Array(); this.itemName.clear = mapsSearch_itemName_clear; this.itemName.set = mapsSearch_itemName_set; this.narrow = new Object; this.narrow.keys = new Array(); this.narrow.change = mapsSearch_narrow_change; } function mapsSearch_init(){ var dic = maps_search_dic_synonym; if( dic ){ dic = dic.replace( /\t/g , " " ); dic = dic.replace( /\s{2,}/g , " " ); var temp_dic = dic.split( " " ); for( var i = 0 ; i < temp_dic.length; i++ ){ this.dictionarySynonym[ this.dictionarySynonym.length ] = "(?:" + temp_dic[ i ].replace( /,/ , "|" ) + ")"; } } } function mapsSearch_itemName_clear(){ this.name = new Array(); } function mapsSearch_itemName_set( value ){ for( var i = 0 ; i < mapsSearch.dictionarySynonym.length ; i++ ){ var reg = new RegExp( mapsSearch.dictionarySynonym[ i ] , "i" ); value = value.replace( reg , mapsSearch.dictionarySynonym[ i ] ); } this.name = value.split( " " ); } function mapsSearch_narrow_change( key , num ){ num = parseInt( num ); var tempNarrowSearchKeys = new Array(); var flag_match = 0; for( var i = 0 ; i < this.keys.length ; i++ ){ var reg = new RegExp( "^" + key + ":" ); if( this.keys[ i ].match( reg ) && num ){ this.keys[ i ] = key + ":" + num; flag_match = 1; } if( this.keys[ i ].match( reg ) && !num ){ flag_match = 1; continue; } tempNarrowSearchKeys[ tempNarrowSearchKeys.length ] = this.keys[ i ]; } if( !flag_match && num ){ tempNarrowSearchKeys[ tempNarrowSearchKeys.length ] = key + ":" + num; } this.keys = tempNarrowSearchKeys; } function mapsSearch_clear(){ this.status = 0; if( maps_focus_category ){ maps_category[ maps_focus_category ].marking(); } mapsCategoryNavi.create(); mapsCommon.HTML.write( maps_html_search_message , "" ); } function mapsSearch_dispMessage(){ if( this.count ){ var resultMessage = "
" + this.count + "件の" + item_name + "が見つかりました。
"; } else { var resultMessage = "
1件も見つかりませんでした。
"; } mapsCommon.HTML.write( maps_html_search_message , resultMessage ); } function mapsSearch_search(){ mapsEX.callback( this , arguments ); this.count = 0; for( var category_id in maps_category ){ if( category_id == "clear" ){ continue; } maps_category[ category_id ].clearSearchResultItems(); maps_category[ category_id ].clearSortCacheItems(); } var reg_searchName = new Array(); if( this.itemName.name.length ){ for( i = 0 ; i < this.itemName.name.length ; i++ ){ if( !this.itemName.name[ i ] ){ continue; } reg_searchName[ reg_searchName.length ] = new RegExp( this.itemName.name[ i ] , "i" ); } } if( !this.itemName.name.length && !this.narrow.keys.length ){ this.clear(); return; } LABEL_for01: for( var item_id in maps_item ){ if( item_id == "clear" ){ continue; } for( var i = 0 ; i < reg_searchName.length ; i++ ){ if( !maps_item[ item_id ].name.match( reg_searchName[ i ] ) ){ continue LABEL_for01; } } for( var i = 0 ; i < this.narrow.keys.length ; i++ ){ if( !maps_narrowCondition[ this.narrow.keys[ i ] ] || maps_narrowCondition[ this.narrow.keys[ i ] ].match( /;/ ) ){ continue; } if( !eval( maps_narrowCondition[ this.narrow.keys[ i ] ].replace( /%([a-zA-Z][a-zA-Z0-9_]+)%/g , "maps_item[ \"" + item_id + "\" ].data[ \"$1\" ]" ) ) ){ continue LABEL_for01; } } maps_category[ maps_item[ item_id ].category ].addSearchResultItems( item_id ); this.count++; } if( this.count ){ this.status = 1; } mapsItemNavi.page.num = 1; if( maps_focus_category ){ maps_category[ maps_focus_category ].marking(); } mapsCategoryNavi.create(); if( !maps_search_narrow_message && !this.itemName.name.length ){ return ; } this.dispMessage(); } var mapsSort = new function(){ this.status = 0; this.key = ""; this.desc = 0; this.type = "string"; this.distance = 0; this.init = mapsSort_init; this.clear = mapsSort_clear; this.setSortVar = mapsSort_setSortVar; } function mapsSort_init(){ if( maps_default_sort ){ this.setSortVar( maps_default_sort ); } } function mapsSort_clear(){ this.status = 0; this.key = ""; this.desc = 0; this.itemNaviFormat = ""; mapsItemNavi.page.num = 1; for( var category_id in maps_category ){ if( category_id == "clear" ){ continue; } maps_category[ category_id ].clearSortCacheItems(); } } function mapsSort_setSortVar( sortKey ){ this.status = 1; mapsItemNavi.page.num = 1; sortKey.match( /^([a-zA-Z0-9_-]+)(\s.+)?$/i ); var option = RegExp.$2; if( RegExp.$1 == "_distance" ){ this.distance = 1; } else { this.distance = 0; this.key = RegExp.$1; this.desc = ( option.match( /desc/ ) ? 1 : 0 ); this.type = ( option.match( /num/ ) ? "number" : "string" ); } this.itemNaviFormat = ( option.match( /navi:(.+)/ ) ? RegExp.$1 : "" ); } var mapsCategoryNavi = new function(){ this.id = ""; this.html = ""; this.group = new Array(); this.template = new Object; this.template.outer = ""; this.template.group = " %html%"; this.template.inner = ""; this.innerUndefined = ""; this.innerSearchUnmatch = ""; this.init = mapsCategoryNavi_init; this.add = mapsCategoryNavi_add; this.change = mapsCategoryNavi_change; this.make = mapsCategoryNavi_make; this.clear = mapsCategoryNavi_clear; this.create = mapsCategoryNavi_create; this.click = mapsCategoryNavi_click; } function mapsCategoryNavi_init(){ this.id = categoryBox; var replace_list = new Array(); replace_list[ "category_name" ] = category_name; this.innerUndefined = mapsCommon.String.convTemplate( this.innerUndefined , replace_list ); this.innerSearchUnmatch = mapsCommon.String.convTemplate( this.innerSearchUnmatch , replace_list ); } function mapsCategoryNavi_add( category_id ){ if( !this.id || category_id == "clear" ){ return ; } if( category_id == "_all" && maps_category_all == 0 && maps_focus_category != "_all" ){ return ;} if( category_id == "_map" && maps_category_map == 0 && maps_focus_category != "_map" ){ return ;} var replace_list = new Array(); replace_list[ "category_id" ] = category_id; replace_list[ "name" ] = maps_category[ category_id ].name; replace_list[ "selected" ] = ( category_id == maps_focus_category ? " selected=\"selected\"" : "" ); replace_list[ "html_id" ] = category_id.replace( /^_/ , "-" ); var html = mapsCommon.String.convTemplate( this.template.inner , replace_list ); if( maps_category[ category_id ].group ){ if( !this.group[ maps_category[ category_id ].group ] ){ this.group[ maps_category[ category_id ].group ] = ""; } this.group[ maps_category[ category_id ].group ] += html; } else { this.html += html; } } function mapsCategoryNavi_change( category_id ){ document.getElementById( "ksgmsp--categoryNavi-select" ).value = category_id; } function mapsCategoryNavi_clear(){ if( this.id ){ document.getElementById( !this.id ).innerHTML = ""; } } function mapsCategoryNavi_create(){ if( !maps_focus_category ){ this.html = this.innerUndefined + this.html; } for( var category_id in maps_category ){ if( category_id == "clear" ){ continue; } if( mapsSearch.status && category_id != "_all" && !maps_category[ category_id ].searchResultItems.length ){ if( maps_focus_category == category_id ){ var replace_list = new Array(); replace_list[ "category_id" ] = category_id; replace_list[ "name" ] = maps_category[ category_id ].name; this.html = mapsCommon.String.convTemplate( this.innerSearchUnmatch , replace_list ) + this.html; } continue; } this.add( category_id ); } this.make(); } function mapsCategoryNavi_make(){ if( !this.id ){ return; } var html = this.html; for( var group_name in this.group ){ var replace_list = new Array(); replace_list[ "group_name" ] = group_name; replace_list[ "html" ] = this.group[ group_name ]; html += mapsCommon.String.convTemplate( this.template.group , replace_list ); } var replace_list = new Array(); replace_list[ "html" ] = html; document.getElementById( this.id ).innerHTML = mapsCommon.String.convTemplate( this.template.outer , replace_list ); this.html = ""; this.group = new Array(); } function mapsCategoryNavi_click( form ){ if( maps_focus_category == form.value ){ return ; } maps_category[ form.value ].change(); } var mapsItemNavi = new function(){ this.id = ""; this.html = ""; this.firstID = ""; this.tempCount = 0; this.page = new Object; this.page.num = 1; this.page.items = 0; this.page.qty = 1; this.template = new Object; this.template.outer = "%html%
"; this.template.inner = new Object; this.template.inner.row = "%col1%%col2%%col3%"; this.template.inner.col1 = "%countInnerHTML%"; this.template.inner.col2 = "%name%"; this.template.inner.col3 = "%thirdRow%"; this.template.pageNavi = "
前のページ  ( %pageInfo% )  次のページ
"; this.innerEmpty = "
%category_name%には%item_name%は存在しません。
"; this.innerSearchUnmatch = "
%category_name%には検索結果にマッチする%item_name%は存在しません。

マップ上にすべて表示する場合はクリック
"; this.init = mapsItemNavi_init; this.add = mapsItemNavi_add; this.makeThirdRow = mapsItemNavi_makeThirdRow; this.changeFocus = mapsItemNavi_changeFocus; this.clear = mapsItemNavi_clear; this.make = mapsItemNavi_make; this.openInfoWindow = mapsItemNavi_openInfoWindow; this.changePage = mapsItemNavi_changePage; this.checkAutoZoom = mapsItemNavi_checkAutoZoom; } function mapsItemNavi_init(){ this.id = maps_html_itemNavi; this.page.items = maps_itemNavi_page_items; if( this.id ){ var obj = document.getElementById( this.id ); if( maps__ua.MSIE ){ obj.style.overflowY = "auto"; obj.style.overflowX = "hidden"; } else if( maps__ua.Gecko ){ obj.style.overflow = "-moz-scrollbars-vertical"; } else { obj.style.overflow = "auto"; } } if( maps_html_itemNavi_autoZoom ){ mapsItemNavi.checkAutoZoom(); } } function mapsItemNavi_add( item_id , count , marker_id ){ if( !this.id ){ return; } if( !this.html ){ this.firstID = "maps--itemNavi-countLabel-" + item_id; } this.tempCount++; var replace_list = new Array(); replace_list[ "item_id" ] = item_id; replace_list[ "count" ] = count; replace_list[ "name" ] = maps_item[ item_id ].name; if( !marker_id || !maps_marker[ marker_id ] ){ marker_id = "_default"; } replace_list[ "countLabel" ] = ( maps_marker[ marker_id ].naviprefix[ count ] ? maps_marker[ marker_id ].naviprefix[ count ] : maps_marker[ marker_id ].naviprefix[ 0 ] ); replace_list[ "countInnerHTML" ] = replace_list[ "countLabel" ]; if( maps_marker[ "itemnavi:" + marker_id ] != undefined ){ var countMarkerFilename = maps_marker[ "itemnavi:" + marker_id ].iconfile.replace( "%count%" , ( maps_marker[ "itemnavi:" + marker_id ].filesuffix[ count ] ? maps_marker[ "itemnavi:" + marker_id ].filesuffix[ count ] : maps_marker[ "itemnavi:" + marker_id ].filesuffix[ 0 ] ) ); if( maps_focus_category == "_map" && maps__ua.MSIE <= 6 && navigator.userAgent.match( /SV1/ ) ){ replace_list[ "countInnerHTML" ] = "\"""; } else { replace_list[ "countInnerHTML" ] = mapsCommon.HTML.makePngTag( countMarkerFilename , maps_marker[ "itemnavi:" + marker_id ].width , maps_marker[ "itemnavi:" + marker_id ].height , { style : "border: 0;" , title : replace_list[ "countLabel" ] , alt : replace_list[ "countLabel" ] } ); } } replace_list[ "thirdRow" ] = this.makeThirdRow( item_id ); replace_list[ "main_colspan" ] = ( replace_list[ "thirdRow" ] ? 1 : 2 ); replace_list[ "function_openInfoWindow" ] = "mapsItemNavi.openInfoWindow( event , this , '" + item_id + "' , " + count + " );"; replace_list[ "row_class" ] = ( maps_itemNavi_rowStrips && this.tempCount % 2 != 1 ? "maps--itemNavi-row-strips" : "" ); replace_list[ "col1" ] = ( maps_itemNavi_countColumn ? mapsCommon.String.convTemplate( this.template.inner.col1 , replace_list ) : "" ); replace_list[ "col2" ] = mapsCommon.String.convTemplate( this.template.inner.col2 , replace_list ); replace_list[ "col3" ] = ( replace_list[ "thirdRow" ] ? mapsCommon.String.convTemplate( this.template.inner.col3 , replace_list ) : "" ); this.html += mapsCommon.String.convTemplate( this.template.inner.row , replace_list ); } function mapsItemNavi_makeThirdRow( item_id ){ var value = ""; var format = ""; if( mapsSort.itemNaviFormat && mapsSort.distance ){ format = mapsSort.itemNaviFormat; value = maps_item[ item_id ].distance; } else if( mapsSort.itemNaviFormat && mapsSort.status && mapsSort.itemNaviFormat ){ format = mapsSort.itemNaviFormat; value = maps_item[ item_id ].data[ mapsSort.key ]; } else if( maps_itemNavi_thirdRow ){ var temp = maps_itemNavi_thirdRow.split( " " ); format = ( temp[ 1 ] ? temp[ 1 ] : "" ); value = maps_item[ item_id ].data[ temp[ 0 ] ]; } var callback = mapsEX.callback( this , arguments , item_id , value , format ); if( callback.cancelParentProcess ){ return callback.returnValue.result; } if( callback.returnValue && callback.returnValue.format ){ format = callback.returnValue.format; } if( callback.returnValue && callback.returnValue.value ){ value = callback.returnValue.value; } if( value && format ){ value = mapsCommon.String.sprintf( format , value ); } return value; } function mapsItemNavi_changeFocus( event ){ if( !maps__ua.MSIE ){ return ; } if( event.shiftKey || event.keyCode == 9 ){ return ; } mapsMap.gmap.closeInfoWindow(); document.getElementById( maps_html_googleMap ).focus(); } function mapsItemNavi_clear(){ if( !this.id ){ return; } document.getElementById( maps_html_itemNavi ).innerHTML = ""; } function mapsItemNavi_make(){ if( !this.id ){ return; } if( this.html ){ var replace_list = new Array(); replace_list[ "html" ] = this.html; this.html = mapsCommon.String.convTemplate( this.template.outer , replace_list ); if( mapsItemNavi.page.items && this.page.qty >= 2 ){ var replace_list = new Array(); replace_list[ "prev_attr" ] = " onclick=\"mapsItemNavi.changePage( event , " + ( this.page.num - 1 ) + " )\"" + ( this.page.num == 1 ? " disabled=\"disabled\"" : "" ); replace_list[ "next_attr" ] = " onclick=\"mapsItemNavi.changePage( event , " + ( this.page.num + 1 ) + " )\"" + ( this.page.num == this.page.qty ? " disabled=\"disabled\"" : "" ); replace_list[ "pageInfo" ] = this.page.num + " / " + this.page.qty; var pageNavi = mapsCommon.String.convTemplate( this.template.pageNavi , replace_list ); this.html = pageNavi + this.html + pageNavi; } } else { var replace_list = new Array(); replace_list[ "category_name" ] = ( maps_focus_category != "_map" ? "この" + category_name : "マップ内" ); replace_list[ "item_name" ] = item_name; if( mapsSearch.status ){ this.html = mapsCommon.String.convTemplate( this.innerSearchUnmatch , replace_list ); } else if( !mapsSearch.status ){ this.html = mapsCommon.String.convTemplate( this.innerEmpty , replace_list ); } } document.getElementById( maps_html_itemNavi ).innerHTML = this.html; this.html = ""; this.tempCount = 0; } function mapsItemNavi_openInfoWindow( event , obj , item_id , count ){ if( event.shiftKey && obj.tagName != "A" ){ maps_item[ item_id ].moveCenter(); } else { maps_item[ item_id ].openInfoWindowByItemNavi( count ); } return mapsCommon.Event.cancel( event ); } function mapsItemNavi_changePage( event , pageNo ){ if( 1 <= pageNo && pageNo <= this.page.qty ){ this.page.num = pageNo; maps_category[ maps_focus_category ].marking(); } return mapsCommon.Event.cancel( event ); } function mapsItemNavi_checkAutoZoom(){ var map_boudns = bounds = mapsMap.gmap.getBoundsLatLng(); var category_bounds = maps_category[ maps_focus_category ].bounds; var obj = document.getElementById( maps_html_itemNavi_autoZoom ); if( map_boudns.minX < category_bounds.minLng && category_bounds.maxLng < map_boudns.maxX && map_boudns.minY < category_bounds.minLat && category_bounds.maxLat < map_boudns.maxY ){ obj.disabled = true; obj.style.cursor = "default"; } else { obj.disabled = false; obj.style.cursor = "auto"; } } var mapsInfo = new function(){ this.urlPriorityType = ""; this.active = ( ( maps_html_mapInfo_url || maps_html_mapInfo_point ) ? 1 : 0 ); this.url = ""; this.xmlInfo = new Object(); this.dispURL_extraArg = ""; this.dispURL = mapsInfo_dispURL; this.dispPoint = mapsInfo_dispPoint; this.getType = mapsInfo_getType; this.getURL = mapsInfo_getURL; this.setURL = mapsInfo_setURL; this.userMessageEditor = new Object; this.userMessageEditor.message = ""; this.userMessageEditor.html = "
"; this.userMessageEditor.open = mapsInfo_userMessageEditor_open; this.userMessageEditor.submit = mapsInfo_userMessageEditor_submit; this.userMessageEditor.onblur = mapsInfo_userMessageEditor_onblur; } function mapsInfo_dispURL(){ var tempObj = document.getElementById( maps_html_mapInfo_url ); if( tempObj.tagName != "INPUT" ){ tempObj.innerHTML = this.url; } else { tempObj.value = this.url; } } function mapsInfo_dispPoint( lng , lat ){ var result = ""; if( maps_mapInfo_point_base == 60 ){ switch( maps_mapInfo_point_base60_language ){ case "jp" : var lang = new Array( "東経" , "西経" , "北緯" , "南緯" , "度" , "分" , "秒" ); break; case "sign" : var lang = new Array( "E" , "W" , "N" , "S" , "°" , "′" , "″" ); break; } var decimalDigit = maps_mapInfo_point_base60_decimalDigit; var base60_lng = mapsCommon.Map.convBase10ToBase60( lng ); base60_lng.match( /^(.)([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?$/ ); var result_lng = ( RegExp.$1 == "+" ? lang[ 0 ] : lang[ 1 ] ) + RegExp.$2 + lang[ 4 ] + RegExp.$3 + lang[ 5 ] + RegExp.$4 + lang[ 6 ] + ( decimalDigit ? RegExp.$5.substring( 1 , ( decimalDigit + 1 ) ) : "" ); var base60_lat = mapsCommon.Map.convBase10ToBase60( lat ); base60_lat.match( /^(.)([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?$/ ); var result_lat = ( RegExp.$1 == "+" ? lang[ 2 ] : lang[ 3 ] ) + RegExp.$2 + lang[ 4 ] + RegExp.$3 + lang[ 5 ] + RegExp.$4 + lang[ 6 ] + ( decimalDigit ? RegExp.$5.substring( 1 , ( decimalDigit + 1 ) ) : "" ); } else { var decimalDigit = maps_mapInfo_point_base10_decimalDigit; var temp = String( lng ).split( "." ); var result_lng = temp[ 0 ] + "." + temp[ 1 ].substring( 0 , decimalDigit ); var temp = String( lat ).split( "." ); var result_lat = temp[ 0 ] + "." + temp[ 1 ].substring( 0 , decimalDigit ); } var result = maps_mapInfo_point_format; result = result.replace( "%lng%" , result_lng ); result = result.replace( "%lat%" , result_lat ); document.getElementById( maps_html_mapInfo_point ).innerHTML = result; } function mapsInfo_getType(){ var temp_type = mapsMap.gmap.getCurrentMapType(); if( temp_type == G_SATELLITE_TYPE ){ var type = "satellite"; } else if( typeof( G_HYBRID_TYPE ) != "undefined" && temp_type == G_HYBRID_TYPE ){ var type = "hybrid"; } else { var type = "map"; } return type; } function mapsInfo_getURL(){ return this.url; } function mapsInfo_setURL( type ){ var arg = arguments; if( this.urlPriorityType ){ if( this.urlPriorityType == "location" ){ this.urlPriorityType = ""; return ; } else { return ; } } if( type != "point" && ( !maps_mapInfo_point_enableType || !type.match( new RegExp( maps_mapInfo_point_enableType.replace( /,|\t|\s/g , "|" ) , "i" ) ) ) ){ if( type == "location" ){ return; } else { type = "point"; } } if( type == "item" || type == "location" ){ this.urlPriorityType = type; } if( type == "item" && !arg[ 1 ] ){ return ; } if( type == "point" && ( !arg[ 1 ] || !arg[ 2 ] ) ){ var center = mapsMap.gmap.getCenterLatLng(); var temp = String( center.x ).split( "." ); arg[ 1 ] = temp[ 0 ] + "." + temp[ 1 ].substring( 0 , 5 ); var temp = String( center.y ).split( "." ); arg[ 2 ] = temp[ 0 ] + "." + temp[ 1 ].substring( 0 , 5 ); } var urlArg = "http://" + location.host + location.pathname + "?" + this.dispURL_extraArg; switch( type ){ case "category" : urlArg += "category=" + arg[ 1 ]; break; case "item" : urlArg += "item=" + arg[ 1 ]; break; case "point" : urlArg += "lng=" + arg[ 1 ] + "&lat=" + arg[ 2 ] + ( maps_focus_category != undefined ? "&category=" + maps_focus_category : "" ); break; case "location" : urlArg += location.search.replace( /^\?/ , "" ); break; } if( type != "location" ){ var temp_type = this.getType(); var temp_zoom = mapsMap.gmap.getZoomLevel(); urlArg += ( temp_zoom != maps_default_zoom ? "&zoom=" + temp_zoom : "" ); urlArg += ( temp_type != maps_default_type ? "&type=" + temp_type : "" ); urlArg += ( maps_import_current_file && maps_import_current_file != import_file ? "&import=" + maps_import_current_file : "" ); } if( this.userMessageEditor.message && type != "item" ){ urlArg += "&message=" + this.userMessageEditor.message; } this.url = urlArg; if( maps_html_mapInfo_url ){ this.dispURL(); } } function mapsInfo_userMessageEditor_open(){ var html = this.html; var message = decodeURIComponent( this.message ); message = mapsCommon.HTML.encode( message ); message = message.replace( "|" , "\n" ); html = mapsCommon.String.convTemplate( html , { message : message } ); var center = mapsMap.gmap.getCenterLatLng(); var layoutSize = mapsCommon.HTML.getLayoutSize( html ); mapsMap.gmap.openInfoWindowHtml( new GPoint( center.x , center.y ) , "
" + html + "
" ); } function mapsInfo_userMessageEditor_submit(){ var message = document.getElementById( "ksgmsp--mapInfo-userMessageEditor-textarea" ).value; message = message.replace( "\n" , "|" ); message = encodeURIComponent( message ); this.message = message; mapsMap.gmap.closeInfoWindow(); mapsInfo.setURL( "point" ); } function mapsInfo_userMessageEditor_onblur( obj ){ if( mapsMap.infoWindow.currentItemID ){ obj.focus(); } } var mapsEX = new function(){ this.callbackList = new Array(); this.addCallback = mapsEX_addCallback; this.callback = mapsEX_callback; this.plugInList = new Array(); this.addPlugIn = mapsEX_addPlugIn; this.isPlugInExist = mapsEX_isPlugInExist; } function mapsEX_addCallback( callFunc , procFunc ){ if( this.callbackList[ callFunc ] == undefined ){ this.callbackList[ callFunc ] = new Array(); } this.callbackList[ callFunc ][ this.callbackList[ callFunc ].length ] = procFunc; } function mapsEX_callback( ref , arg ){ var callFunc = arg.callee; if( this.callbackList[ callFunc ] == undefined ){ return false; } ref.arg = arg; var result = { cancelParentProcess : false , returnValue : null } var arg = new Array(); for( var i = 2 ; i < arguments.length ; i++ ){ arg[ i - 2 ] = arguments[ i ]; } for( var i = 0 ; i < this.callbackList[ callFunc ].length ; i++ ){ var func = this.callbackList[ callFunc ][ i ]; if( !func ){ continue; } var temp_ret = func.apply( ref , arg ); if( temp_ret ){ if( temp_ret.cancelParentProcess ){ result.cancelParentProcess = temp_ret.cancelParentProcess; } if( temp_ret.returnValue ){ result.returnValue = temp_ret.returnValue; } } } return result; } function mapsEX_addPlugIn( plugInName , version , compatibilityVersion ){ if( compatibilityVersion != undefined && maps__version < compatibilityVersion ){ mapsCommon.Error.trigger( "設定エラー:プラグイン( " + plugInName + " )は、この maps本体のバージョンでは動作しません。" , "i003" ); return; } this.plugInList[ this.plugInList.length ] = plugInName; } function mapsEX_isPlugInExist( plugInName ){ for( var i = 0 ; i < this.plugInList.length ; i++ ){ if( this.plugInList[ i ] == plugInName ){ return true; } } return false; } function mapsDataCategory( category_id , name , lng , lat , group ){ maps_category[ category_id ] = new mapsCategory( category_id , name , lng , lat , group ); } function mapsDataItem( item_id , category_id , name , lng , lat ){ if( !maps_category[ category_id ] ){ mapsCommon.Error.trigger( "データインポートエラー:" + name + "(" + item_id + " )のカテゴリ( " + category_id + " )が定義されていません。" , "i002" , 0 ); } maps_item[ item_id ] = new mapsItem( item_id , category_id , name , lng , lat , arguments , "" ); } function mapsDataImportXML( xmlDoc ){ mapsEX.callback( this , arguments , xmlDoc ); maps__title = mapsCommon.XML.getValueByUniqueTag( xmlDoc , "title" ); mapsInfo.xmlInfo = new Object(); var mapsinfo = new Array( "title" , "link" , "author" , "generator" , "createdate" , "lastupdate" ); for( var i = 0 ; i < mapsinfo.length ; i++ ){ mapsInfo.xmlInfo[ mapsinfo[ i ] ] = mapsCommon.XML.getValueByUniqueTag( xmlDoc , mapsinfo[ i ] ); } mapsDataImportXML_xml2data( xmlDoc , "category" ); mapsDataImportXML_xml2data( xmlDoc , "item" ); mapsDataImportXML_xml2data( xmlDoc , "template" ); } function mapsDataImportXML_xml2data( xmlDoc , type ){ var count_max = Infinity; switch( type ){ case "category" : count_max = maps_import_maxCategorys; break; case "item" : count_max = maps_import_maxItems; break; } var temp_xmlData = xmlDoc.documentElement.getElementsByTagName( type ); for( var i = 0 ; i < temp_xmlData.length ; i++ ){ var iData = mapsCommon.XML.convAttributesToArray( temp_xmlData[ i ] ); iData[ "flagXML" ] = 1; iData[ "_html" ] = GXml.value( temp_xmlData[ i ] ); switch( type ){ case "category" : maps_category[ iData[ "id" ] ] = new mapsCategory( iData[ "id" ] , iData[ "name" ] , iData[ "lng" ] , iData[ "lat" ] , iData[ "group" ] ); break; case "item" : if( !maps_category[ iData[ "category" ] ] ){ mapsCommon.Error.trigger( "データインポートエラー:" + iData[ "name" ] + "( " + iData[ "id" ] + " )のカテゴリ( " + iData[ "category" ] + " )が定義されていません。" , "i002" , 0 ); break; } maps_item[ iData[ "id" ] ] = new mapsItem( iData[ "id" ] , iData[ "category" ] , iData[ "name" ] , iData[ "lng" ] , iData[ "lat" ] , "" , iData ); break; case "template" : if( iData[ "id" ] == undefined ){ iData[ "id" ] = "undefined"; } maps_template[ iData[ "id" ] ] = { html : iData[ "_html" ] , attribute : iData }; break; } if( i >= ( count_max - 1 ) ){ break; } } } function mapsDataMarker( key_value , image , shadow , image_suffix , iconSize_w , iconSize_h , shadowSize_w , shadowSize_h , iconAnchor_x , iconAnchor_y , infoWindowAnchor_x , infoWindowAnchor_y ){ if( image_suffix.match( /(\[([A-Z])-([A-Z])\])/ ) && RegExp.$2.charCodeAt( 0 ) <= RegExp.$3.charCodeAt( 0 ) ){ var temp = new Array(); for( var i = RegExp.$2.charCodeAt( 0 ) ; i <= RegExp.$3.charCodeAt( 0 ) ; i++ ){ temp[ temp.length ] = String.fromCharCode( i ); } image_suffix = image_suffix.replace( RegExp.$1 , temp.join( "," ) ); } maps_marker[ key_value ] = new mapsMarker( key_value ); maps_marker[ key_value ].iconfile = image; maps_marker[ key_value ].filesuffix = image_suffix.split( "," ); maps_marker[ key_value ].naviprefix = maps_marker[ key_value ].filesuffix; maps_marker[ key_value ].filesuffix = image_suffix.split( "," ); maps_marker[ key_value ].priority = mapsCommon.Array.count( maps_marker ); maps_marker[ key_value ].width = iconSize_w; maps_marker[ key_value ].height = iconSize_h; maps_marker[ key_value ].swidth = shadowSize_w; maps_marker[ key_value ].sheight = shadowSize_h; if( key_value.match( /^itemnavi/ ) ){ return ; } if( iconAnchor_x == undefined ){ iconAnchor_x = Math.floor( iconSize_w / 2 ); } if( iconAnchor_y == undefined ){ iconAnchor_y = iconSize_h; } if( infoWindowAnchor_x == undefined ){ infoWindowAnchor_x = Math.floor( iconSize_w / 2 ); } if( infoWindowAnchor_y == undefined ){ infoWindowAnchor_y = 2; } maps_marker[ key_value ].gicon = new GIcon(); maps_marker[ key_value ].gicon.image = image; maps_marker[ key_value ].gicon.iconSize = new GSize( iconSize_w , iconSize_h ); if( shadow ){ maps_marker[ key_value ].gicon.shadow = shadow; } if( shadowSize_w && shadowSize_h ){ maps_marker[ key_value ].gicon.shadowSize = new GSize( shadowSize_w , shadowSize_h ); } maps_marker[ key_value ].gicon.iconAnchor = new GPoint( iconAnchor_x , iconAnchor_y ); maps_marker[ key_value ].gicon.infoWindowAnchor = new GPoint( infoWindowAnchor_x , infoWindowAnchor_y ); } function mapsDataNarrowCondition( key , condition ){ if( !key.match( /:\d+$/ ) ){ key += ":1"; } maps_narrowCondition[ key ] = condition; } /* 【諸事情で、ここから先は改造/単独利用はご遠慮下さい。maps での利用では問題ありません】 */ var mapsCommon = new function(){ this.Array = new Object(); this.Array.count = mapsCommon_Array_count; this.Array.keys = mapsCommon_Array_keys; this.Array.merge = mapsCommon_Array_merge; this.Array.sort = mapsCommon_Array_sort; this.Data = new Object(); this.Data.conv3digitcomma = mapsCommon_Data_conv3digitcomma; this.Data.convTemplate = mapsCommon_Data_convTemplate; this.Data.makeAnchorTag = mapsCommon_Data_makeAnchorTag; this.Data.makeImageTag = mapsCommon_Data_makeImageTag; this.Data.sprintf = mapsCommon_String_sprintf; this.Error = new Object(); this.Error.trigger = mapsCommon_Error_trigger; this.Event = new Object(); this.Event.cancel = mapsCommon_Event_cancel; this.HTML = new Object(); this.HTML.encode = mapsCommon_HTML_encode; this.HTML.makePngTag = mapsCommon_HTML_makePngTag; this.HTML.getLayoutSize = mapsCommon_HTML_getLayoutSize; this.HTML.getWindowSize = mapsCommon_HTML_getWindowSize; this.HTML.openPopup = mapsCommon_HTML_openPopup; this.HTML.closePopup = mapsCommon_HTML_closePopup; this.HTML.setDisplay = mapsCommon_HTML_setDisplay; this.HTML.write = mapsCommon_HTML_write; this.Map = new Object(); this.Map.convBase10ToBase60 = mapsCommon_Map_convBase10ToBase60; this.Map.convCoordinateGTokyoToWGS84 = mapsCommon_Map_convCoordinateGTokyoToWGS84; this.Map.convCoordinateWGS84ToGTokyo = mapsCommon_Map_convCoordinateWGS84ToGTokyo; this.Map.convPointsToDistance = mapsCommon_Map_convPointsToDistance; this.Map.getNearData = mapsCommon_Map_getNearData; this.String = new Object; this.String.convTemplate = mapsCommon_String_convTemplate; this.String.repeat = mapsCommon_String_repeat; this.String.sprintf = mapsCommon_String_sprintf; this.Variable = new Object(); this.Variable.tempValue = new Array(); this.Variable.convInputValue = mapsCommon_Variable_convInputValue; this.Variable.clearTempValue = mapsCommon_Variable_clearTempValue; this.Variable.getTempValue = mapsCommon_Variable_getTempValue; this.Variable.setTempValue = mapsCommon_Variable_setTempValue; this.XML = new Object(); this.XML.convAttributesToArray = mapsCommon_XML_convAttributesToArray; this.XML.include = mapsCommon_XML_include; this.XML.getValueByUniqueTag = mapsCommon_XML_getValueByUniqueTag; } function mapsCommon_Array_count( array ){ if( !array ){ return 0; } var result = 0; if( array.length ){ result = array.length; } else { for( var i in array ){ if( i != "clear" ){ result++; } } } return result; } function mapsCommon_Array_keys( array ){ var result_array = new Array(); for( var key in array ){ if( key != "clear" ){ result_array[ result_array.length ] = key; } } return result_array; } function mapsCommon_Array_merge(){ var result = new Array(); for( var i = 0 ; i < arguments.length ; i++ ){ for( var temp in arguments[ i ] ){ if( temp == "clear" ){ continue; } result[ temp ] = arguments[ i ][ temp ]; } } return result; } /* function mapsCommon_Array_sort( base_array , sort_key , option ){ var sort_str = 0; var sort_desc = ( option == "desc" ? 1 : 0 ); var sort_array = new Array(); for( var key in base_array ){ if( key == "clear" ){ continue; } var l = sort_array.length; sort_array[ l ] = new Array(); sort_array[ l ][ "key" ] = key; sort_array[ l ][ "value" ] = base_array[ key ]; if( isNaN( ( sort_key ? base_array[ key ][ sort_key ] : base_array[ key ] ) ) ){ sort_str = 1; } } for( var j = sort_array.length ; j >= 0 ; j-- ){ for( var i = 0 ; i < ( j - 1 ) ; i++ ){ var comp_1 = ( sort_key ? sort_array[ i ][ "value" ][ sort_key ] : sort_array[ i ][ "value" ] ); var comp_2 = ( sort_key ? sort_array[ i + 1 ][ "value" ][ sort_key ] : sort_array[ i + 1 ][ "value" ] ); var result = ( ( !sort_str ? Number( comp_1 ) : String( comp_1 ) ) > ( !sort_str ? Number( comp_2 ) : String( comp_2 ) ) ? 1 : 0 ); if( sort_desc ){ result = Math.abs( result - 1 ); } if( result ){ var temp = sort_array[ i + 1 ]; sort_array[ i + 1 ] = sort_array[ i ]; sort_array[ i ] = temp; } } } var result_array = new Array(); for( var i = 0 ; i < sort_array.length ; i++ ){ result_array[ sort_array[ i ][ "key" ] ] = sort_array[ i ][ "value" ]; } return result_array; } */ function mapsCommon_Array_sort( base_array , sort_key , option ){ var sort_str = 0; var sort_desc = ( option == "desc" ? 1 : 0 ); var sort_array = []; var n = 0; for( var key in base_array ){ var l = sort_array.length; sort_array[ l ] = new Array(); sort_array[ l ][ "key" ] = key; sort_array[ l ][ "value" ] = base_array[ key ]; if( isNaN( ( sort_key ? base_array[ key ][ sort_key ] : base_array[ key ] ) ) ){ sort_str = 1; } n++; } if( !n ){ return base_array; } var tempChangeType = ( sort_str ? function( v ){ return String( v ); } : function( v ){ return Number( v ); } ); if( sort_key ){ tempSortObjectRoutine( sort_array , 0 , sort_array.length - 1 ); } else { tempSortStandardRoutine( sort_array , 0 , sort_array.length - 1 ); } var result_array = []; if( !sort_desc ){ for( var i = 0 ; i < sort_array.length ; i++ ){ result_array[ sort_array[ i ][ "key" ] ] = sort_array[ i ][ "value" ]; } } else { for( var i = sort_array.length - 1 ; i >= 0 ; i-- ){ result_array[ sort_array[ i ][ "key" ] ] = sort_array[ i ][ "value" ]; } } return result_array; function tempSortStandardRoutine( sort_array , first , last ){ var x = tempChangeType( sort_array[ Math.floor( ( first + last ) / 2 ) ].value ); var i = first; var j = last; while( true ){ while( tempChangeType( sort_array[ i ].value ) < x ){ i++; } while( x < tempChangeType( sort_array[ j ].value ) ){ j--; } if ( i >= j ){ break; } var t = sort_array[ i ]; sort_array[ i ] = sort_array[ j ]; sort_array[ j ] = t; i++; j--; } if( first < i - 1 ){ tempSortStandardRoutine( sort_array , first , i - 1 ); } if( j + 1 < last ){ tempSortStandardRoutine( sort_array , j + 1 , last ); } } function tempSortObjectRoutine( sort_array , first , last ){ var x = tempChangeType( sort_array[ Math.floor( ( first + last ) / 2 ) ].value[ sort_key ] ); var i = first; var j = last; while( true ){ while( tempChangeType( sort_array[ i ].value[ sort_key ] ) < x ){ i++; } while( x < tempChangeType( sort_array[ j ].value[ sort_key ] ) ){ j--; } if ( i >= j ){ break; } var t = sort_array[ i ]; sort_array[ i ] = sort_array[ j ]; sort_array[ j ] = t; i++; j--; } if( first < i - 1 ){ tempSortObjectRoutine( sort_array , first , i - 1 ); } if( j + 1 < last ){ tempSortObjectRoutine( sort_array , j + 1 , last ); } } } function mapsCommon_Data_conv3digitcomma( num , failed ){ if( isFinite( num ) ){ num = String( num ); while( num != ( num = num.replace( /^(-?\d+)(\d{3})(\.?\d*)/ , "$1,$2$3" ) ) ){} var result = num; } else { var result = ( typeof( failed ) != "undefined" ? failed : num ); } return result; } function mapsCommon_Data_convTemplate( replace_list , template_id ){ if( template_id == undefined ){ template_id = "undefined"; } if( !maps_template[ template_id ] ){ return "Template Not Fount!"; } var result = mapsCommon.String.convTemplate( maps_template[ template_id ].html , replace_list ); return result; } function mapsCommon_Data__makeTag( tagName , endtag , attribute , innerHTML ){ var result = "<" + tagName; for( var key in attribute ){ if( key != "clear" && !key.match( /^_/ ) ){ result += " " + key + "=\"" + attribute[ key ] + "\""; } } result += ( endtag ? ">" + innerHTML + "" : " />" ); return result; } function mapsCommon_Data_makeAnchorTag( url , innerHTML , attribute , failed ){ var reg = new RegExp( "^https?:\/\/[\x23-\x2f0-9a-zA-Z_!:;=?\@~]+$|^[\x23-\x2f0-9a-zA-Z_!;=?\@~]+$" ); if( url.match( reg ) ){ if( !attribute ){ attribute = new Object(); } attribute.href = url; if( !attribute.target && maps_link_type == 2 ){ attribute.target = "_blank"; } var result = mapsCommon_Data__makeTag( "a" , true , attribute , innerHTML ); } else { var result = ( typeof( failed ) != "undefined" ? failed : url ); } return result; } function mapsCommon_Data_makeImageTag( src , width , height , attribute, failed ){ var img = new Image() img.src = src; if( maps__ua.MSIE ){ var isImg = ( img.mimeType ? 1 : 0 ); } else { var isImg = ( img.width ? 1 : 0 ); } if( isImg ){ if( !attribute ){ attribute = new Object(); } if( attribute._PreserveAspectRatio || attribute._PAR ){ var resize = mapsCommon_Data_makeImageTag_getSizePreserveAspectRatio( img.width , img.height , width , height ) width = resize.width; height = resize.height; attribute.style = ( attribute.style ? attribute.style + " " : "" ) + "margin: " + resize.marginY + "px " + resize.marginX + "px " + resize.marginY + "px " + resize.marginX + "px;"; } attribute.src = src; attribute.width = ( width ? width : img.width ); attribute.height = ( height ? height : img.height ); attribute.alt = ( attribute.alt ? attribute.alt : "" ); var result = mapsCommon_Data__makeTag( "img" , false , attribute ); } else { var result = ( typeof( failed ) != "undefined" ? failed : src ); } return result; } function mapsCommon_Data_makeImageTag_getSizePreserveAspectRatio( base_width , base_height , resize_width , resize_height ){ var result = new Object(); if( ( resize_width / base_width ) < ( resize_height / base_height ) ){ result.width = resize_width; result.height = Math.round( base_height * ( resize_width / base_width ) ); result.marginX = 0; result.marginY = ( resize_height - result.height ) / 2; } else if( ( resize_width / base_width ) > ( resize_height / base_height ) ){ result.width = Math.round( base_width * ( resize_height / base_height ) ); result.height = resize_height; result.marginX = ( resize_width - result.width ) / 2; result.marginY = 0; } else { result.width = resize_width ; result.height = resize_height; result.marginX = 0; result.marginY = 0; } return result; } function mapsCommon_Error_trigger( message , errNo , errLevel ){ if( errLevel == undefined ){ errLevel = 0; } if( errLevel == 0 && !maps_debug_mode ){ return true; } alert( message ); return false; } function mapsCommon_Event_cancel( event ){ if( maps__ua.MSIE ){ event.returnValue = false; } else { event.preventDefault(); } return false; } function mapsCommon_HTML_encode( value ){ var convList = new Array( "&:&" , "<:<" , ">:>" , "\":"" , "':'" ); for( var i = 0 ; i < convList.length ; i++ ){ var temp = convList[ i ].split( ":" ); value = value.replace( new RegExp( temp[ 0 ] , "g" ) , temp[ 1 ] ); } return value; } function mapsCommon_HTML_makePngTag( filename , width , height , attributes , sizingmethod ){ if( !sizingmethod ){ sizingmethod = "scale"; } var temp_attributes = ""; var style = ""; if( attributes ){ for( var name in attributes ){ if( name != "style" ){ temp_attributes += " " + name + "=\"" + attributes[ name ] + "\""; } } if( attributes.style ){ style = attributes.style; } } if( maps__ua.MSIE && maps__ua.MSIE < 7.0 && filename.match( /\.png$/ ) ){ var result = "
"; } else { var result = "\"\""; } return result; } function mapsCommon_HTML_getLayoutSize( html ){ var temp_obj = document.getElementById( "maps--common-getlayoutsize" ); temp_obj.innerHTML = "
" + html + "
"; var result = { width : temp_obj.firstChild.offsetWidth , height : temp_obj.firstChild.offsetHeight }; return result; } function mapsCommon_HTML_getWindowSize(){ var result = new Object; var mode_standard = ( document.compatMode == "CSS1Compat" ? 1 : 0 ); if( maps__ua.MSIE && mode_standard ){ result.width = document.body.offsetWidth; result.height = document.documentElement.offsetHeight; } else if( ( maps__ua.MSIE && !mode_standard ) ){ result.width = document.body.clientWidth; result.height = document.body.clientHeight; } else if( maps__ua.Gecko || maps__ua.Safari ){ result.width = document.body.offsetWidth; result.height = window.innerHeight; } else if( maps__ua.Opera ){ result.width = document.body.offsetWidth - 20; result.height = window.innerHeight; } return result; } function mapsCommon_HTML_openPopup( id , option ){ if( option == undefined ){ option = ""; } var obj_box = document.getElementById( id ); if( !obj_box ){ mapsCommon.Error.trigger( "設定エラー:指定されたID( " + id + " )のHTMLタグが存在しません。" , "i004" , 0 ); return false; } obj_box.style.display = "block"; var temp = new Array( "width" , "height" , "left" , "top" , "right" , "bottom" ); for( var i = 0 ; i < temp.length ; i++ ){ if( option.match( new RegExp( temp[ i ] + "\\s?[=:]\\s?([0-9]+)(px|%)?" , "i" ) ) ){ obj_box.style[ temp[ i ] ] = RegExp.$1 + ( RegExp.$2 ? RegExp.$2 : "px" ); } } if( option.match( /left\s?[=:]\s?center/i ) ){ obj_box.style.left = String( ( obj_box.parentNode.offsetWidth - obj_box.offsetWidth ) / 2 ) + "px"; } if( option.match( /top\s?[=:]\s?center/i ) ){ obj_box.style.top = String( ( obj_box.parentNode.offsetHeight - obj_box.offsetHeight ) / 2 ) + "px"; } obj_box.style.zIndex = 301; if( !option.match( /shadow\s?[=:]\s?(?:0|off|false)/ ) ){ var obj_shadow = document.getElementById( "maps--common-popupShadow" ); obj_shadow.style.display = "block"; var shadow_width = obj_box.offsetWidth + 28; var shadow_height = obj_box.offsetHeight + 28; obj_shadow.style.left = String( obj_box.offsetLeft ) + "px"; obj_shadow.style.top = String( obj_box.offsetTop ) + "px"; obj_shadow.style.width = String( shadow_width ) + "px"; obj_shadow.style.height = String( shadow_height ) + "px"; obj_shadow.style.zIndex = 300; var insertTag = ""; insertTag += mapsCommon.HTML.makePngTag( maps_image_path + "maps_popup_shadow_bl.png" , 28 , 28 , { style : "position: absolute; left: 0px; top: " + String( obj_box.offsetHeight ) + "px;" } ); insertTag += mapsCommon.HTML.makePngTag( maps_image_path + "maps_popup_shadow_br.png" , 28 , 28 , { style : "position: absolute; left: " + String( obj_box.offsetWidth ) + "px; top: " + String( obj_box.offsetHeight ) + "px;" } ); insertTag += mapsCommon.HTML.makePngTag( maps_image_path + "maps_popup_shadow_tr.png" , 28 , 28 , { style : "position: absolute; left: " + String( obj_box.offsetWidth ) + "px; top: 0px;" } ); insertTag += mapsCommon.HTML.makePngTag( maps_image_path + "maps_popup_shadow_bc.png" , ( shadow_width - 56 ) , 28 , { style : "position: absolute; left: 28px; top: " + String( obj_box.offsetHeight ) + "px;" } ); insertTag += mapsCommon.HTML.makePngTag( maps_image_path + "maps_popup_shadow_cr.png" , 28 , ( shadow_height - 56 ) , { style : "position: absolute; left: " + String( obj_box.offsetWidth ) + "px; top: 28px;" } ); obj_shadow.innerHTML = insertTag; } if( !option.match( /close\s?[=:]\s?(?:0|off|false)/ ) && !document.getElementById( "maps--common-popupClose-" + id ) ){ obj_box.innerHTML = obj_box.innerHTML + "\"閉じる\""; } if( maps__ua.MSIE && !option.match( /select\s?[=:]\s?(?:1|on|true)/ ) ){ var obj_select = document.getElementsByTagName( "select" ); for( var i = 0 ; i < obj_select.length ; i++ ){ obj_select[ i ].style.visibility = "hidden"; } } if( !option.match( /maplimit\s?[=:]\s?(?:0|off|false)/ ) ){ if( !maps_limit_dragging ){ mapsMap.gmap.disableDragging(); } mapsMap.infoWindow.enabled = false; } } function mapsCommon_HTML_closePopup( id ){ var obj_box = document.getElementById( id ); var obj_shadow = document.getElementById( "maps--common-popupShadow" ); var obj_select = document.getElementsByTagName( "select" ); if( !obj_box ){ mapsCommon.Error.trigger( "設定エラー:指定されたID( " + id + " )のHTMLタグが存在しません。" , "i004" , 0 ); return false; } if( document.getElementById( "maps--common-popupClose-" + id ) ){ obj_box.removeChild( document.getElementById( "maps--common-popupClose-" + id ) ); } obj_box.style.display = "none"; obj_shadow.style.display = "none"; if( maps__ua.MSIE ){ for( var i = 0 ; i < obj_select.length ; i++ ){ obj_select[ i ].style.visibility = "visible"; } } if( !maps_limit_dragging ){ mapsMap.gmap.enableDragging(); } mapsMap.infoWindow.enabled = true; } function mapsCommon_HTML_setDisplay( id , type ){ var obj = document.getElementById( id ); if( !obj ){ return false; } if( !maps__ua.Opera ){ obj.style.display = ( type ? "block" : "none" ); } else { obj.style.visibility = ( type ? "visible" : "hidden" ); } return true; } function mapsCommon_HTML_write( id , html ){ if( !id || !document.getElementById( id ) ){ return false; } document.getElementById( id ).innerHTML = html; return true; } function mapsCommon_Map_convBase10ToBase60( base10 ){ base10 = parseFloat( base10 ); var minus = 0; if( base10 < 0 ){ base10 *= -1 ; minus = 1; } var base60_1 = Math.floor( base10 ); base10 = ( base10 - base60_1 ) * 60; var base60_2 = Math.floor( base10 ); base10 = ( base10 - base60_2 ) * 60; var base60_3 = base10; var result = ( !minus ? "+" : "-" ) + String( base60_1 ) + "." + ( base60_2 < 10 ? "0" : "" ) + String( base60_2 ) + "." + ( base60_3 < 10 ? "0" : "" ) + String( base60_3 ); if( arguments[ 1 ] ){ var result_obj = new Object; result_obj.lng = result; result_obj.lat = mapsCommon_Map_convBase10ToBase60( arguments[ 1 ] ); return result_obj; } else { return result; } } function mapsCommon_Map_convCoordinateGTokyoToWGS84(){ var result = new Object; if( typeof( arguments[ 0 ] ) == "object" ){ result.lng = arguments[ 0 ].x; result.lat = arguments[ 0 ].y; } else { result.lng = arguments[ 0 ]; result.lat = arguments[ 1 ]; } if( ( 115 < result.lng && result.lng < 152 ) && ( 30 < result.lat && result.lat < 50 ) ){ result.lng -= 0.0032027777777777775; result.lat += 0.003236111111111111; } return result; } function mapsCommon_Map_convCoordinateWGS84ToGTokyo(){ var result = new Object; if( typeof( arguments[ 0 ] ) == "object" ){ result.lng = arguments[ 0 ].x; result.lat = arguments[ 0 ].y; } else { result.lng = arguments[ 0 ]; result.lat = arguments[ 1 ]; } if( ( 115 < result.lng && result.lng < 152 ) && ( 30 < result.lat && result.lat < 50 ) ){ result.lng += 0.0032027777777777775; result.lat -= 0.003236111111111111; } return result; } function mapsCommon_Map_convPointsToDistance( lng1 , lat1 , lng2 , lat2 ){ var lng1 = ( lng1 * Math.PI ) / 180; var lat1 = ( lat1 * Math.PI ) / 180; var lng2 = ( lng2 * Math.PI ) / 180; var lat2 = ( lat2 * Math.PI ) / 180; var t = Math.sin( lat1 ) * Math.sin( lat2 ) + Math.cos( lat1 ) * Math.cos( lat2 ) * Math.cos( lng1 - lng2 ); var d = 20000 * Math.acos( t ) / Math.PI; return d; } function mapsCommon_Map_getNearData( data , type , limit ){ if( !type ){ type = "all"; } if( !limit ){ limit = Infinity; } var conditionType = 0; var center = mapsMap.gmap.getCenterLatLng(); if( type.match( /^(.+):(.+)$/ ) ){ type = RegExp.$1; var ref = RegExp.$2.split( "," ); } switch( type ){ case "map" : var conditionType = 1; var bounds = mapsMap.gmap.getBoundsLatLng(); var minLng = bounds.minX; var maxLng = bounds.maxX; var minLat = bounds.minY; var maxLat = bounds.maxY; break; case "dist": var conditionType = 1; ref[ 0 ] = parseFloat( ref[ 0 ] ); var minLng = center.x - ref[ 0 ]; var maxLng = center.x + ref[ 0 ]; var minLat = center.y - ref[ 0 ]; var maxLat = center.y + ref[ 0 ]; break; } var sort_array = new Array(); for( var id in data ){ if( key == "clear" || !data[ id ].lng || !data[ id ].lat ){ continue; } if( conditionType == 1 && ( data[ id ].lng < minLng || maxLng < data[ id ].lng || data[ id ].lat < minLat || maxLat < data[ id ].lat ) ){ continue; } sort_array[ id ] = mapsCommon.Map.convPointsToDistance( data[ id ].lng , data[ id ].lat , center.x , center.y ); } var result_array = new Array(); var c = 1; if( sort_array ){ sort_array = mapsCommon.Array.sort( sort_array ); for( var key in sort_array ){ if( key == "clear" ){ continue; } result_array[ result_array.length ] = key; if( c >= limit ){ break; } else { c++; } } } return result_array; } function mapsCommon_String_convTemplate( value , replace_list ){ for( var key in replace_list ){ if( key != "clear" ){ value = value.replace( new RegExp( "%" + key + "%" , "g" ) , replace_list[ key ] ); } } return value; } function mapsCommon_String_repeat( str , count ){ var result = ""; for( var i = 0 ; i < parseInt( count ) ; i++ ){ result += str; } return result; } function mapsCommon_String_sprintf( format ){ var count = 1; while( format.match( /(%([0-9\.+-]*?)([dfs]))/ ) ){ var value = arguments[ count ]; if( value == undefined ){ continue; } var replace = RegExp.$1; var parameter = RegExp.$2; var type = RegExp.$3; format = format.replace( replace , mapsCommon_String_sprintf_replace( replace , parameter , type , value ) ); count++; } return format; } function mapsCommon_String_sprintf_replace( format , parameter , type , value ){ switch( type ){ case "d" : value = parseInt( value ); break; case "f" : value = parseFloat( value ); break; case "s" : value = String( value ); break; } var base_value = value; if( type == "f" && parameter.match( /\.([1-9]+)$/ ) ){ value = String( parseInt( base_value ) ) + "." + String( Math.floor( ( base_value - parseInt( base_value ) ) * Math.pow( 10 , parseInt( RegExp.$1 ) ) ) ); } if( type == "s" && parameter.match( /\.([1-9]+)$/ ) ){ value = value.substring( 0 , parseInt( RegExp.$1 ) ); } if( ( type == "d" || type == "f" ) && parameter.match( /^\+/ ) && base_value > 0 ){ value = "+" + String( value ); } if( parameter.match( /^\+?-([1-9][0-9]*)/ ) ){ value = String( value ) + mapsCommon.String.repeat( " " , parseInt( RegExp.$1 ) - String( value ).length ); } if( parameter.match( /^\+?(0)?([1-9][0-9]*)/ ) ){ var temp1 = RegExp.$1; var temp2 = RegExp.$2; var temp3 = ( String( value ).match( /^(\+|-)/ ) ? RegExp.$1 : 0 ); value = ( temp3 ? temp3 : "" ) + mapsCommon.String.repeat( ( temp1 != "" ? temp1 : " " ) , parseInt( temp2 ) - String( value ).length ) + String( value ).substring( ( temp3 ? 1 : 0 ) ); } return value; } function mapsCommon_Variable_convInputValue( tempArg , option ){ if( typeof( tempArg ) == "object" && option && option.match( /ISCHECKED/i ) ){ var result = tempArg.checked; } else if( typeof( tempArg ) == "object" ){ var result = tempArg.value; } else { var result = tempArg; } return result; } function mapsCommon_Variable_clearTempValue( id ){ mapsCommon.Variable.tempValue[ id ] = ""; } function mapsCommon_Variable_getTempValue( id , isClear ){ var result = mapsCommon.Variable.tempValue[ id ]; if( isClear != false ){ mapsCommon.Variable.tempValue[ id ] = ""; } return result; } function mapsCommon_Variable_setTempValue( value , id ){ if( typeof( id ) == "undefined" ){ id = "TV" + String( new Date().getTime() ) + String( Math.ceil( Math.random() * 10000 ) ); } mapsCommon.Variable.tempValue[ id ] = value; return id; } function mapsCommon_XML_convAttributesToArray( xmlData ){ var result = new Array(); for( var i = 0 ; i < xmlData.attributes.length ; i++ ){ var temp = xmlData.attributes.item( i ).nodeValue; temp = temp.replace( /'/g , "'" ); result[ xmlData.attributes.item( i ).nodeName ] = temp; } return result; } function mapsCommon_XML_include( filename , func , option ){ if( option == undefined ){ option = "" }; if( maps_debug_mode || !maps_import_cache || option.match( /CACHE:(?:0|OFF)/i ) ){ filename += ( !filename.match( /\?/ ) ? "?" : "&" ) + "rand=" + String( Math.random() ).substring( 2 , 8 ); } var maps_request = GXmlHttp.create(); var method = ( option.match( /METHOD:POST/i ) ? "POST" : "GET" ); maps_request.open( method , filename , true ); maps_request.onreadystatechange = function(){ if( maps_request.readyState != 4 ){ return; } var xmlDoc = maps_request.responseXML; if( !xmlDoc.documentElement ){ mapsCommon.Error.trigger( "データインポートエラー:ファイルが存在しないか、XMLファイルではありません。" , "i001" , 3 ); return false; } func.apply( null , new Array( xmlDoc ) ); } maps_request.send( null ); } function mapsCommon_XML_getValueByUniqueTag( xmlDoc , tagName ){ var temp_xmlData = xmlDoc.documentElement.getElementsByTagName( tagName ); var result = GXml.value( temp_xmlData[ 0 ] ); return result; } var mapsFunc = new function(){ this.category = new Object(); this.category.change = mapsFunc_category_change; this.html = new Object(); this.html.popupOpen = mapsFunc_html_popupOpen; this.item = new Object(); this.item.openInfoWindow = mapsFunc_item_openInfoWindow; this.itemNavi = new Object(); this.itemNavi.autoZoom = mapsFunc_itemNavi_autoZoom; this.itemNavi.changeThirdRow = mapsFunc_itemNavi_changeThirdRow; this.link = new Object(); this.link.select = mapsFunc_link_select; this.link.maps = mapsFunc_link_maps; this.map = new Object(); this.map.changeType = mapsFunc_map_changeType; this.map.changeZoom = mapsFunc_map_changeZoom; this.mapInfo = new Object(); this.mapInfo.select = mapsFunc_mapInfo_select; this.mapInfo.urlAddFavorite = mapsFunc_mapInfo_urlAddFavorite; this.mapInfo.urlCopyToClipboard = mapsFunc_mapInfo_urlCopyToClipboard; this.mapInfo.urlLink = mapsFunc_mapInfo_urlLink; this.mapInfo.urlSendMail = mapsFunc_mapInfo_urlSendMail; this.mapInfo.urlOpenUserMessageEditor = mapsFunc_mapInfo_urlOpenUserMessageEditor; this.mapInfo.pointChangeBase = mapsFunc_mapInfo_pointChangeBase; this.move = new Object; this.move.toLatLng = mapsFunc_move_toLatLng; this.move.toLngLat = mapsFunc_move_toLngLat; this.move.select = mapsFunc_move_select; this.move.toNeighbor = mapsFunc_move_toNeighbor; this.search = new Object(); this.search.itemName = new Object(); this.search.itemName.submit = mapsFunc_search_itemName_submit; this.search.itemName.keydown = mapsFunc_search_itemName_keydown; this.search.itemName.clear = mapsFunc_search_itemName_clear; this.search.narrow = new Object(); this.search.narrow.change = mapsFunc_search_narrow_change; this.sort = new Object(); this.sort.change = mapsFunc_sort_change; this.userControl = new Object(); this.userControl.marker = new Object(); this.userControl.marker.changeVisibility = mapsFunc_userControl_marker_changeVisibility; this.userControl.marker.hidden = mapsFunc_userControl_marker_hidden; this.userControl.marker.visible = mapsFunc_userControl_marker_visible; this.userControl.centerMarker = new Object(); this.userControl.centerMarker.changeVisibility = mapsFunc_userControl_centerMarker_changeVisibility; this.userControl.centerMarker.hidden = mapsFunc_userControl_centerMarker_hidden; this.userControl.centerMarker.visible = mapsFunc_userControl_centerMarker_visible; this.userControl.mouseWheel = new Object(); this.userControl.mouseWheel.changeStatus = mapsFunc_userControl_mouseWheel_changeStatus; this.userControl.mouseWheel.changeDirection = mapsFunc_userControl_mouseWheel_changeDirection; } function mapsFunc_category_change( event , category_id ){ if( maps_category[ category_id ] ){ if( categoryBox ){ mapsCategoryNavi.change( category_id ); } maps_category[ category_id ].change(); } return mapsCommon.Event.cancel( event ); } function mapsFunc_html_popupOpen( event , target_id , option ){ mapsCommon.HTML.openPopup( target_id , option ); return mapsCommon.Event.cancel( event ); } function mapsFunc_item_openInfoWindow( event , item_id ){ if( maps_item[ item_id ] ){ var option = ( maps_item[ item_id ].category != maps_focus_category ? "ADDMARKER" : "" ); maps_item[ item_id ].moveCenter(); maps_item[ item_id ].openInfoWindowByItemNavi( 0 , option ); } return mapsCommon.Event.cancel( event ); } function mapsFunc_itemNavi_autoZoom( event ){ if( !maps_html_itemNavi_autoZoom || document.getElementById( maps_html_itemNavi_autoZoom ).disabled == false ){ maps_category[ maps_focus_category ].change( 'AUTOCENTERING:2' ); } return mapsCommon.Event.cancel( event ); } function mapsFunc_itemNavi_changeThirdRow( event , tempValue ){ maps_itemNavi_thirdRow = mapsCommon.Variable.convInputValue( tempValue ); maps_category[ maps_focus_category ].marking(); return mapsCommon.Event.cancel( event ); } function mapsFunc_link__commonLink( event , url ){ switch( maps_link_type ){ case 1 : location.href = url; break; case 2 : window.open( url , "_blank" ); break; } mapsCommon.Event.cancel( event ); } function mapsFunc_link__getEvent( temp_event ){ if( typeof( temp_event ) == "string" ){ var event = mapsCommon_Variable_getTempValue( temp_event ); } else { var event = temp_event; } return event; } function mapsFunc_link_select( event , form ){ var site = form.value; if( site == "-" ){ return ; } if( site.match( /^maps,(.+)$/ ) ){ mapsFunc.link.maps( event , RegExp.$1 ); } else if( site.match( /^mapsPlugIn/ ) ){ var eid = mapsCommon.Variable.setTempValue( event ); eval( site + "( '" + eid + "' );" ); } else if( mapsEX.isPlugInExist( "mapLink" ) ) { var eid = mapsCommon.Variable.setTempValue( event ); eval( "mapsPlugIn_mapLink_" + site + "( '" + eid + "' );" ); } form.selectedIndex = 0; } function mapsFunc_link_maps( temp_event , url ){ var event = mapsFunc_link__getEvent( temp_event ); var center = mapsMap.gmap.getCenterLatLng(); url += "?lng=" + center.x; url += "&lat=" + center.y; url += "&zoom=" + mapsMap.gmap.getZoomLevel(); url += "&referer=" + escape( location.href ); mapsFunc_link__commonLink( event , url ); return false; } function mapsFunc_map_changeType( event , tempValue ){ var type = mapsCommon.Variable.convInputValue( tempValue ); if( type == "map" ){ mapsMap.gmap.setMapType( G_MAP_TYPE ); } if( type == "satellite" ){ mapsMap.gmap.setMapType( G_SATELLITE_TYPE ); } if( type == "hybrid" && mapsInit_checkHybridEnable() ){ mapsMap.gmap.setMapType( G_HYBRID_TYPE ); } return mapsCommon.Event.cancel( event ); } function mapsFunc_map_changeZoom( event , tempValue ){ var level = mapsCommon.Variable.convInputValue( tempValue ); level = ( String( level ).match( /^[+-][0-9]+$/ ) ? mapsMap.gmap.getZoomLevel() + parseInt( level ) : parseInt( level ) ); if( level < 0 ){ level = 0; } else if( level > 17 ){ level = 17; } mapsMap.gmap.zoomTo( level ); return mapsCommon.Event.cancel( event ); } function mapsFunc_mapInfo_select( event , form ){ switch( form.value ){ case "urlAddFavorite" : mapsFunc.mapInfo.urlAddFavorite( event ); break; case "urlCopyToClipboard" : mapsFunc.mapInfo.urlCopyToClipboard( event ); break; case "urlLink" : mapsFunc.mapInfo.urlLink( event ); break; case "urlSendMail" : mapsFunc.mapInfo.urlSendMail( event ); break; case "urlOpenUserMessageEditor" : mapsFunc.mapInfo.urlOpenUserMessageEditor( event ); break; } form.selectedIndex = 0; return mapsCommon.Event.cancel( event ); } function mapsFunc_mapInfo_urlAddFavorite( event ){ var url = mapsInfo.getURL(); window.external.AddFavorite( url , document.title ); return mapsCommon.Event.cancel( event ); } function mapsFunc_mapInfo_urlCopyToClipboard( event ){ var url = mapsInfo.getURL(); clipboardData.setData( "Text" , url ); return mapsCommon.Event.cancel( event ); } function mapsFunc_mapInfo_urlLink( event ){ var url = mapsInfo.getURL(); location.href = url; return mapsCommon.Event.cancel( event ); } function mapsFunc_mapInfo_urlSendMail( event ){ var url = mapsInfo.getURL(); location.href = "mailto:?body=" + escape( url ); return mapsCommon.Event.cancel( event ); } function mapsFunc_mapInfo_urlOpenUserMessageEditor( event ){ mapsInfo.userMessageEditor.open(); return mapsCommon.Event.cancel( event ); } function mapsFunc_mapInfo_pointChangeBase( event , base ){ if( !base ){ base = ( maps_mapInfo_point_base == 60 ? 10 : 60 ); } maps_mapInfo_point_base = base; var center = mapsMap.gmap.getCenterLatLng(); mapsInfo.dispPoint( center.x , center.y ); return mapsCommon.Event.cancel( event ); } function mapsFunc_move_toLatLng( event , lat , lng ){ mapsMap.gmap.closeInfoWindow(); lng = parseFloat( lng ); lat = parseFloat( lat ); mapsMap.gmap.recenterOrPanToLatLng( new GPoint( lng , lat ) ); return mapsCommon.Event.cancel( event ); } function mapsFunc_move_toLngLat( event , lng , lat ){ return mapsFunc.move.toLatLng( event , lat , lng ); } function mapsFunc_move_select( event , form ){ if( form.value == "-" ){ return ; } mapsMap.gmap.closeInfoWindow(); var point = form.value.split( /[,\s\t]/ ); lng = parseFloat( point[ 1 ] ); lat = parseFloat( point[ 0 ] ); mapsMap.gmap.recenterOrPanToLatLng( new GPoint( lng , lat ) ); } function mapsFunc_move_toNeighbor( event , tempValue ){ mapsMap.gmap.closeInfoWindow(); var direction = mapsCommon.Variable.convInputValue( tempValue ); var bounds = mapsMap.gmap.getBoundsLatLng(); var center = mapsMap.gmap.getCenterLatLng(); var lng = center.x; var lat = center.y; switch( direction.toLowerCase() ){ case "north" : lat = bounds.maxY + ( ( bounds.maxY - bounds.minY ) / 3 ); break; case "east" : lng = bounds.maxX + ( ( bounds.maxX - bounds.minX ) / 3 ); break; case "south" : lat = bounds.minY - ( ( bounds.maxY - bounds.minY ) / 3 ); break; case "west" : lng = bounds.minX - ( ( bounds.maxX - bounds.minX ) / 3 ); break; } mapsMap.gmap.recenterOrPanToLatLng( new GPoint( lng , lat ) ); return mapsCommon.Event.cancel( event ); } function mapsFunc_search_itemName_submit( event , form ){ var searchName = document.getElementById( maps_html_search_itemName_textField ).value; mapsSearch.itemName.set( searchName ); mapsSearch.search(); } function mapsFunc_search_itemName_keydown( event , form ){ if( event.keyCode == 13 ){ mapsFunc.search.itemName.submit( event , form ); } } function mapsFunc_search_itemName_clear( event , form ){ document.getElementById( maps_html_search_itemName_textField ).value = ""; mapsSearch.itemName.clear(); mapsSearch.search(); } function mapsFunc_search_narrow_change( event , form ){ var key = form.name; if( form.type == "checkbox" ){ var value = ( form.value.match( /!(\d+)/ ) ? RegExp.$1 : form.value ); var checked = ( form.checked ? 1 : 0 ); if( form.value.match( /!/ ) ){ checked = Math.abs( checked - 1 ); } value = ( checked ? value : 0 ); } else { var value = form.value; } mapsSearch.narrow.change( key , value ); mapsSearch.search(); } function mapsFunc_sort_change( event , tempValue ){ var sortKey = mapsCommon.Variable.convInputValue( tempValue ); mapsSort.clear(); if( sortKey || sortKey != "-" ){ mapsSort.setSortVar( sortKey ); } maps_category[ maps_focus_category ].marking(); return mapsCommon.Event.cancel( event ); } function mapsFunc_userControl_marker_changeVisibility( event , form ){ mapsMap.userControl.marker.changeVisibility( ( form.checked ? 1 : 0 ) ); } function mapsFunc_userControl_marker_hidden( event , form ){ mapsMap.userControl.marker.changeVisibility( 0 ); } function mapsFunc_userControl_marker_visible( event , form ){ mapsMap.userControl.marker.changeVisibility( 1 ); } function mapsFunc_userControl_centerMarker_changeVisibility( event , form ){ mapsMap.userControl.centerMarker.changeVisibility( ( form.checked ? 1 : 0 ) ); } function mapsFunc_userControl_centerMarker_hidden( event , form ){ mapsMap.userControl.centerMarker.changeVisibility( 0 ); } function mapsFunc_userControl_centerMarker_visible( event , form ){ mapsMap.userControl.centerMarker.changeVisibility( 1 ); } function mapsFunc_userControl_mouseWheel_changeStatus( event , tempValue ){ var value = mapsCommon.Variable.convInputValue( tempValue , "isChecked" ); mapsMap.userControl.mouseWheel.status = value; } function mapsFunc_userControl_mouseWheel_changeDirection( event , tempValue ){ var value = mapsCommon.Variable.convInputValue( tempValue , "isChecked" ); mapsMap.userControl.mouseWheel.reverse = tempValue; }