leadorStreetView.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. * {padding:0px; margin:0px;}
  12. html,body {
  13. width:100%;
  14. height:100%;
  15. font-size:12px;
  16. }
  17. #mapView {
  18. width:100%;
  19. height:100%;
  20. }
  21. .install-flash-player {
  22. position:absolute;
  23. left:50%;
  24. top:50%;
  25. width:300px;
  26. height:200px;
  27. text-align:center;
  28. margin:-100px 0 0 -150px;
  29. }
  30. .install-flash-player p {
  31. padding:5px;
  32. }
  33. .install-flash-player img {
  34. border:none;
  35. }
  36. .install-flash-player a {
  37. display:block;
  38. color:#00b7ef;
  39. }
  40. .install-flash-player a span {
  41. display:block;
  42. }
  43. </style>
  44. </head>
  45. <body>
  46. <div id="mapView"></div>
  47. <script type="text/javascript">
  48. function getParam(paramName){
  49. var reg = new RegExp("(^|&)" + paramName + "=([^&]*)(&|$)","i");
  50. var r = window.location.search.substr(1).match(reg);
  51. if(r != null) return decodeURI(r[2]);
  52. return '';
  53. };
  54. function setStreetViewShowByLatlon(lat,lng){
  55. /** 配置 **/
  56. var more = {};
  57. more.flashvars = {};
  58. LeadorStreetView.useHash = false;
  59. /** 设置服务信息 **/
  60. more.flashvars.TrueVisionSeverUrl = MapplusUrlConfig.leadorStreetBaseUrl;
  61. more.flashvars.Port = "22222";
  62. more.flashvars.DataName = "BJQIAN";
  63. more.flashvars.TrueVisionImageUrl = MapplusUrlConfig.leadorStreetImageUrl;
  64. more.flashvars.UIUrl = "IShowChinaTVUIBJ.swf";
  65. more.flashvars.LogoUrl = 'ld-logo.png';
  66. /** 绑定DIV **/
  67. LeadorStreetView.bindingDIV("mapView",null,more);
  68. LeadorStreetView.showFullScreenUI(false);
  69. /** 根据经纬度加载 **/
  70. if(lat && lng){
  71. LeadorStreetView.loadStreetViewByPosition(lng,lat);
  72. }else {
  73. LeadorStreetView.loadStreetViewByPosition(0,0);
  74. }
  75. //位置改变
  76. LeadorStreetView.addCompleteEvent(streetViewComplete);
  77. //视角改变
  78. LeadorStreetView.addAngleChangeEvent(streetAngleChange);
  79. };
  80. function streetViewComplete(info){
  81. window.parent.leadorStreetViewChange(info);
  82. };
  83. function streetAngleChange(info){
  84. window.parent.leadorStreetAngleViewChange(info);
  85. };
  86. function flashChecker(){
  87. var hasFlash = 0;
  88. var flashVersion =0;
  89. try{
  90. if(document.all){
  91. var swf = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
  92. if(swf){
  93. hasFlash = 1;
  94. VSwf = swf.GetVariable('$version');
  95. flashVersion = parseInt(VSwf.split(" ")[1].split(",")[0]);
  96. }
  97. }else {
  98. if(navigator.plugins && navigator.plugins.length > 0){
  99. var swf = navigator.plugins["Shockwave Flash"];
  100. }
  101. if(swf){
  102. hasFlash = 1;
  103. var words = swf.description.split(" ");
  104. for(var i=0;i<words.length; i++){
  105. if(isNaN(parseInt(words[i]))) continue;
  106. flashVersion = parseInt(words[i]);
  107. }
  108. }
  109. }
  110. }catch (e) {
  111. }
  112. return {
  113. f:hasFlash,
  114. v:flashVersion
  115. };
  116. };
  117. //setStreetViewShowByLatlon(getParam('lat'),getParam('lng'));
  118. $(function(){
  119. var flashPlayerInfo = flashChecker();
  120. if(flashPlayerInfo && flashPlayerInfo.v > 10){
  121. setStreetViewShowByLatlon(getParam('lat'),getParam('lng'));
  122. }else {
  123. if(document.all){
  124. var flashPlayerLink = map23DConfig.map23DAssetsUrl+"/soft/flashplayer_winax.exe";
  125. }else {
  126. var flashPlayerLink = map23DConfig.map23DAssetsUrl+"/soft/flashplayer_win.exe";
  127. }
  128. var installFlashHtml = '<div class="install-flash-player">' +
  129. '<p><strong>请安装Adobe flash player 11以上版本的播放器。</strong></p>' +
  130. '<a href="'+flashPlayerLink+'"><img src="static/images/get_flash.png"/><span>Adobe Flash Player 11</span></a>' +
  131. '</div>';
  132. document.getElementById('mapView').innerHTML = installFlashHtml;
  133. }
  134. });
  135. </script>
  136. </body>
  137. </html>