showMap.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <html lang="en">
  2. <head>
  3. <meta charset="UTF-8" />
  4. <style>
  5. .nav{
  6. width: 100%;
  7. height: 18vh;
  8. text-align: center;
  9. display: flex;
  10. align-items: center;
  11. justify-content: space-around;
  12. }
  13. .map{
  14. width: 100%;
  15. height: 77vh;
  16. }
  17. </style>
  18. <script>
  19. window.onload = function() {
  20. var ifm = document.getElementById("iframe");
  21. let data = getQueryString("data");
  22. let dataShow =JSON.parse(decodeURIComponent(data))
  23. var typeshow = document.getElementById("type");
  24. typeshow.innerText='恶意'+dataShow.type
  25. var nameshow = document.getElementById("name");
  26. nameshow.innerText='名称:'+dataShow.name
  27. var macshow = document.getElementById("mac");
  28. macshow.innerText='MAC地址:'+dataShow.mac
  29. var keywordshow = document.getElementById("keyword");
  30. keywordshow.innerText='恶意类型:'+dataShow.keyword
  31. var timeshow = document.getElementById("time");
  32. timeshow.innerText='采集时间:'+dataShow.time
  33. data=JSON.parse(decodeURIComponent(data))
  34. var url="http://api.map.baidu.com/marker?location=" + data.lat + "," + data.lng + "&title=恶意" + data.type + "&content=MAC地址(" + data.mac + ")&output=html"
  35. console.log(url,'sds');
  36. ifm.height = "900";
  37. ifm.src=url;
  38. }
  39. function getQueryString(name) {
  40. var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
  41. var r = window.location.search.substr(1).match(reg); // window.lcation.search 也可以替换成任何想获得参数的 url
  42. if (r != null) {
  43. return r[2];
  44. }
  45. return null;
  46. }
  47. </script>
  48. <title></title>
  49. <!--preload-links-->
  50. <!--app-context-->
  51. </head>
  52. <body>
  53. <div class="nav">
  54. <div id="type"></div>
  55. <div id="name"></div>
  56. <div id="mac">MAC地址</div>
  57. <div id="keyword">恶意类型</div>
  58. <div id="time">采集时间</div>
  59. </div>
  60. <!-- <div id="app" style="height:100px;">app-html</div> -->
  61. <iframe id="iframe" name="iframe" class="map"
  62. src=""></iframe>
  63. </body>
  64. </html>
  65. <script language="javascript">
  66. </script>