BaiduMapPlugnIn

try to take over the world!

目前為 2019-07-29 提交的版本,檢視 最新版本

// ==UserScript==
// @name         BaiduMapPlugnIn
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       kizj
// @match        http://api.map.baidu.com/lbsapi/getpoint/
// @grant        none
// ==/UserScript==

(function() {
  'use strict';
  // Your code here...
  // $('body').append('<div class="container"></div>');

  

  //按钮
  var button = document.createElement("button");
  var buttonNode = document.createTextNode("计算");
  button.appendChild(buttonNode);
  button.style.position = 'relative';
  button.style.width = '50px';
  button.style.height = '25px';
  button.style.left = '75px';
  button.style.top = '3px';


  var body = document.getElementById('copyButton');
  body.parentNode.appendChild(button);

  var inputVal = document.getElementById('pointInput');
  button.addEventListener('click',function(){
    var point = inputVal.getAttribute("data-clipboard-text");
    if (point != null) {
      window.open('https://www.yimishuyuan.com/baiduApI?'+point,'newwindow');
    }else{
      alert('请拾取坐标后再点击!')
    }
  },false);


})();