leadorStreetPointView.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title></title>
  5. <meta charset="utf-8"/>
  6. <script type="text/javascript" src="../../config/config.js"></script>
  7. <script type="text/javascript" src="../jquery/jquery.js"></script>
  8. <script type="text/javascript" src="swfobject.js"></script>
  9. <script type="text/javascript" src="leadorStreetViewAPI.js"></script>
  10. <style type="text/css">
  11. * {
  12. padding:0px;
  13. margin:0px;
  14. }
  15. html, body {
  16. width:100%;
  17. height:100%;
  18. }
  19. #mapView {
  20. width:100%;
  21. height:100%;
  22. }
  23. .install-flash-player {
  24. position:absolute;
  25. left:50%;
  26. top:50%;
  27. width:300px;
  28. height:200px;
  29. text-align:center;
  30. margin:-100px 0 0 -150px;
  31. }
  32. .install-flash-player p {
  33. padding:5px;
  34. }
  35. .install-flash-player img {
  36. border:none;
  37. }
  38. .install-flash-player a {
  39. display:block;
  40. color:#00b7ef;
  41. }
  42. .install-flash-player a span {
  43. display:block;
  44. }
  45. </style>
  46. </head>
  47. <body>
  48. <div id="mapView"></div>
  49. <script type="text/javascript">
  50. function getParam(paramName) {
  51. var reg = new RegExp("(^|&)" + paramName + "=([^&]*)(&|$)","i");
  52. var r = window.location.search.substr(1).match(reg);
  53. if(r != null) return decodeURI(r[2]);
  54. return '';
  55. }
  56. function setStreetViewShow(stationID, hYaw, hPitch) {
  57. var tvID = "mapView";
  58. LeadorStreetView.bindingDIV(tvID, null, {flashvars: {
  59. TrueVisionSeverUrl: MapplusUrlConfig.leadorStreetBaseUrl,
  60. LogoUrl: 'ld-logo.png',
  61. Port: 22222,
  62. UIUrl: "IShowChinaTVUIBJ.swf",
  63. DataName: 'BJQIAN',
  64. TrueVisionImageUrl: MapplusUrlConfig.leadorStreetImageUrl}});
  65. LeadorStreetView.loadStreetViewByID(stationID);
  66. if (hYaw && hPitch) {
  67. LeadorStreetView.setStreetViewAngle({yaw: hYaw, pitch: hPitch});
  68. }
  69. LeadorStreetView.showFullScreenUI(false);
  70. }
  71. function flashChecker(){
  72. var hasFlash = 0;
  73. var flashVersion =0;
  74. try {
  75. if(document.all){
  76. var swf = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
  77. if(swf){
  78. hasFlash = 1;
  79. VSwf = swf.GetVariable('$version');
  80. flashVersion = parseInt(VSwf.split(" ")[1].split(",")[0]);
  81. }
  82. }else {
  83. if(navigator.plugins && navigator.plugins.length > 0){
  84. var swf = navigator.plugins["Shockwave Flash"];
  85. }
  86. if(swf){
  87. hasFlash = 1;
  88. var words = swf.description.split(" ");
  89. for(var i=0;i<words.length; i++){
  90. if(isNaN(parseInt(words[i]))) continue;
  91. flashVersion = parseInt(words[i]);
  92. }
  93. }
  94. }
  95. }catch (e) {
  96. }
  97. return {
  98. f:hasFlash,
  99. v:flashVersion
  100. };
  101. };
  102. $(function(){
  103. var flashPlayerInfo = flashChecker();
  104. if(flashPlayerInfo && flashPlayerInfo.v > 10){
  105. var stationID = getParam('stationID');
  106. var yaw = getParam('yaw');
  107. var pitch = getParam('pitch');
  108. setStreetViewShow(stationID, yaw, pitch);
  109. }else {
  110. if(document.all){
  111. var flashPlayerLink = map23DConfig.map23DAssetsUrl+"/soft/flashplayer_winax.exe";
  112. }else {
  113. var flashPlayerLink = map23DConfig.map23DAssetsUrl+"/soft/flashplayer_win.exe";
  114. }
  115. var installFlashHtml = '<div class="install-flash-player">' +
  116. '<p><strong>请安装Adobe flash player 11以上版本的播放器。</strong></p>' +
  117. '<a href="'+flashPlayerLink+'"><img src="static/images/get_flash.png"/><span>Adobe Flash Player 11</span></a>' +
  118. '</div>';
  119. document.getElementById('mapView').innerHTML = installFlashHtml;
  120. }
  121. });
  122. </script>
  123. </body>
  124. </html>