var bolPc = true; var arrSystemType = [ "", "レーダー式", "Hシステム", "ループコイル式", "ループコイル式H", "移動式車両", "移動式小型", "移動式中型", "レーザー自立型", "レーザー支柱型", "半固定式" ]; var arrCameraPosition = [ "", "左側に設置", "右側に設置", "上に設置" ]; var arrLaneSide = [ "", "左", "右" ]; var arrRoadType = [ "", "一般道", "有料・高速" ]; var arrDirectionType = [ "", "上り方面", "下り方面", "北行き", "北東行き", "東行き", "南東行き", "南行き", "南西行き", "西行き", "北西行き", "内回り", "外回り" ]; var ico_r_normal = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_r_normal.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_r_highway = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_r_highway.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_h_normal = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_h_normal.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_h_highway = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_h_highway.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_l_normal = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_l_normal.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_l_highway = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_l_highway.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_lh_normal = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_lh_normal.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_lh_highway = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_lh_highway.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_ic_normal = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_ic_normal.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_ic_highway = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_ic_highway.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_is_normal = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_is_normal.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_is_highway = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_is_highway.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_im_normal = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_im_normal.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_im_highway = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_im_highway.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_lp_normal = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_lp_normal.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_lp_highway = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_lp_highway.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_ls_normal = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_ls_normal.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_ls_highway = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_ls_highway.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_hk_normal = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_hk_normal.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_hk_highway = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_orbis_hk_highway.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_mobile = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_mobile.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_mousetrap = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_mousetrap.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_inspection = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_inspection.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var ico_common = L.icon( { iconUrl: '//orbis-guide.com/cmn/image/icon/map_marker_common.png', iconSize: [ 26, 32 ], iconAnchor: [ 13, 32 ], popupAnchor: [ 13, -36 ], } ); var dobLatitude = 36.12632; var dobLongitude = 137.256079; // var map; var arrMarkerList = []; var iconExplain; function initMap() { map = ( dobLatitude > 0 && dobLongitude ) ? L.map( "map_canvas" ).setView( [ dobLatitude, dobLongitude ], 13 ) : L.map( "map_canvas" ).setView( [ 35.180188, 136.906565 ], 8 ) ; var tiles = L.tileLayer( "//{s}.tile.osm.org/{z}/{x}/{y}.png", { minZoom: 8, maxZoom: 16, attribution: '© OpenStreetMap contributors' } ); map.addLayer( tiles ); L.Control.Watermark = L.Control.extend( { onAdd: function(map) { var img = L.DomUtil.create( "img" ); img.src = "https://orbis-guide.com/cmn/image/index/marker_explain.png"; img.style.width = "110px"; img.style.cursor = "pointer"; img.setAttribute( 'onclick', 'clearExplain()' ); return img; }, onRemove: function(map) { } }); L.control.watermark = function(opts) { return new L.Control.Watermark(opts); } iconExplain = L.control.watermark({ position: 'bottomleft' }).addTo(map); /////////////////////////// L.CustomControl = L.Control.extend( { options: { position: 'topright' }, onAdd: function (map) { var container = L.DomUtil.create( 'div', 'leaflet-bar leaflet-control' ); container.style.cursor = "pointer"; container.style.backgroundColor = "white"; container.style.padding = "5px"; container.innerHTML = '' + '' + '' + ''; return container; } }); // var control = new L.CustomControl().addTo(map); updateMap(); } var intRoadType = 0; var intMobile = 1; function setRoadType( intValue ) { intRoadType = intValue; updateMap(); } function setMobile() { intMobile = document.getElementsByName( "controlMobile" )[ 0 ].checked ? 1 : 0; updateMap(); } function updateMap() { clearMarker() $.getJSON( "//orbis-guide.com/cmn/script/point.php", { "latStart" : 25, "latEnd" : 46, "lngStart" : 125, "lngEnd" : 150, "road" : intRoadType, "mobile" : intMobile, timestamp: new Date().getTime() }, function(ret) { if( ret.error.code != 0 ) { alert( "error\n" + ret.error.desc ); return false; } var data = ret[ "data" ]; for( var i = 0; i < data[ "arrPointList" ].length; i++ ) { var pointData = data[ "arrPointList" ][ i ]; var decLatitude = data[ "arrPointList" ][ i ][ "decLatitude" ]; var decLongitude = data[ "arrPointList" ][ i ][ "decLongitude" ]; var intOrbisKey = parseInt( data[ "arrPointList" ][ i ][ "intOrbisKey" ].replace( "o", "" ) ); var intImageKey = parseInt( data[ "arrPointList" ][ i ][ "intImageKey" ] ); var strYoutubeKey = data[ "arrPointList" ][ i ][ "strYoutubeKey" ]; var intSystemType = parseInt( data[ "arrPointList" ][ i ][ "intSystemType" ] ); var intCameraPosition = parseInt( data[ "arrPointList" ][ i ][ "intCameraPosition" ] ); var intSpeedLimit = parseInt( data[ "arrPointList" ][ i ][ "intSpeedLimit" ] ); var intLaneType = parseInt( data[ "arrPointList" ][ i ][ "intLaneType" ] ); var intLaneSide = parseInt( data[ "arrPointList" ][ i ][ "intLaneSide" ] ); var intLaneNum = parseInt( data[ "arrPointList" ][ i ][ "intLaneNum" ] ); var strOtherDetail = data[ "arrPointList" ][ i ][ "strOtherDetail" ]; var intRoadType = parseInt( data[ "arrPointList" ][ i ][ "intRoadType" ] ); var strRoadName = data[ "arrPointList" ][ i ][ "strRoadName" ]; var intDirectionType = parseInt( data[ "arrPointList" ][ i ][ "intDirectionType" ] ); var strDirectionDetail = data[ "arrPointList" ][ i ][ "strDirectionDetail" ]; var strKilopost = data[ "arrPointList" ][ i ][ "strKilopost" ]; var strAddress = data[ "arrPointList" ][ i ][ "strPrefecturesName" ] + data[ "arrPointList" ][ i ][ "strCityName" ] + data[ "arrPointList" ][ i ][ "strAddress" ]; var strHint = data[ "arrPointList" ][ i ][ "strHint" ]; var intDirection = parseInt( data[ "arrPointList" ][ i ][ "intDirection" ] ); var strDetail = ( bolPc ) ? '
' + '' + ''+ ''+ '' + ''+ '' + '' + '
' + '' + strRoadName + '
' + strAddress + ' ☞
' + '
' + '' + '' + '' + '' + '' + '' + '' + '
動画Youtube
システム' + arrSystemType[ intSystemType ] + '
設置位置' + arrCameraPosition[ intCameraPosition ] + '
制限速度' + ( ( intSpeedLimit > 0 ) ? intSpeedLimit + 'km/h' : "" ) + '
車線' + ( ( intLaneType == 1 ) ? "全車線" : arrLaneSide[ intLaneSide ] + "側 " + intLaneNum + '車線' ) + '
' + '
' + ( ( intSystemType == 5 || intSystemType == 6 || intSystemType == 7 ) ? '

移動式オービスは過去の目撃ポイントです。

' : '' ) + '
' : '
' + ''+ ''+ '
' ; arrMarkerList.push( L.marker( [ decLatitude, decLongitude ], { icon: getIcon( intSystemType, intRoadType ) } ).bindPopup( strDetail ).addTo( map ) ); } if( dobLatitude > 0 && dobLongitude ) { arrMarkerList.push( L.marker( [ dobLatitude, dobLongitude ], { icon: ico_common } ).addTo( map ) ); } } ); //////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// var divInfoShareMap = document.getElementById( "map_infoshare" ); if( divInfoShareMap != null ) { var mapInfoShare = L.map( "map_infoshare" ).setView( [ 35.937492, 138.391653 ], 7 ) ; var tiles = L.tileLayer( "//{s}.tile.osm.org/{z}/{x}/{y}.png", { minZoom: 7, maxZoom: 16, attribution: '© OpenStreetMap contributors' } ); mapInfoShare.addLayer( tiles ); $.getJSON( "//orbis-guide.com/cmn/script/infoshare.php", { timestamp: new Date().getTime() }, function(data) { if( data == null ) { return; } var ul = document.getElementById( "infoshare_list_ul" ); var strHtml = ""; for( var i = 0; i < data[ "arrList" ].length; i++ ) { var point = data[ "arrList" ][ i ]; var latitude = point[ "dobLatitude" ]; var longitude = point[ "dobLongitude" ]; var intPointType = parseInt( point[ "intPointType" ] ); L.marker( [ latitude, longitude ], { icon: getIcon2( intPointType ) } ).addTo( mapInfoShare ); if( i < 4 ) { var strIconSrc = ""; var strPointType = ""; var strDate = ""; if( intPointType == 4 ) { strIconSrc = "//orbis-guide.com/cmn/image/icon/map_marker_mousetrap.png"; strPointType = "ネズミ捕り"; } if( intPointType == 5 ) { strIconSrc = "//orbis-guide.com/cmn/image/icon/map_marker_inspection.png"; strPointType = "検問"; } if( intPointType == 6 ) { strIconSrc = "//orbis-guide.com/cmn/image/icon/map_marker_mobile.png"; strPointType = "移動式オービス"; } strHtml += '
  • '+ ''+ '' + strPointType + '
    ' + '' + point[ "strAddress" ] + '
    '+ '' + point[ "strDate" ] + '' + '
  • '; } if( i > 300 ) { break; } } ul.innerHTML = strHtml; } ); } } function getIcon( intSystemType, intRoadType ) { switch( intSystemType ) { case 1 : { return intRoadType == 1 ? ico_r_normal : ico_r_highway; } case 2 : { return intRoadType == 1 ? ico_h_normal : ico_h_highway; } case 3 : { return intRoadType == 1 ? ico_l_normal : ico_l_highway; } case 4 : { return intRoadType == 1 ? ico_lh_normal : ico_lh_highway; } case 5 : { return intRoadType == 1 ? ico_ic_normal : ico_ic_highway; } case 6 : { return intRoadType == 1 ? ico_is_normal : ico_is_highway; } case 7 : { return intRoadType == 1 ? ico_im_normal : ico_im_highway; } case 8 : { return intRoadType == 1 ? ico_lp_normal : ico_lp_highway; } case 9 : { return intRoadType == 1 ? ico_ls_normal : ico_ls_highway; } case 10 : { return intRoadType == 1 ? ico_hk_normal : ico_hk_highway; } } return null; } function getIcon2( intPointType ) { switch( intPointType ) { case 4 : { return ico_mousetrap; } case 5 : { return ico_inspection; } case 6 : { return ico_mobile; } } return null; } function clearExplain() { map.removeControl( iconExplain ); } function clearMarker() { for( var i = 0; i < arrMarkerList.length; i++ ) { map.removeLayer( arrMarkerList[ i ] ); } arrMarkerList = []; }