3.1 输入参数
3.2插入下方代码段:
/*INSBEGIN:RESTAPI*/ //@wwcomments:通过百度api将地址转成坐标 function() { var requestlib = require("request"); var urllib = require("url"); var url = "http://api.map.baidu.com/geocoding/v3/?output=json&ak=N6pjAxohY1KrGQ4hKtB6wMyHwNkB7FRs&address=" + encodeURIComponent(inputs.dizhi); var urlObj = urllib.parse(url); var option = { "url": urlObj, "method": "GET" }; option.headers = {}; return when.promise(function(resolve, reject, notify) { requestlib(option, function(e, r, b) { if (e) { reject(e); } resolve(b); }); }); }, // //@wweditorinfo:{"id":"5426511f4d83cc3e09ef48e0d5f579d2","editor":{"step1":{"url":{"from":"const","value":"http://api.map.baidu.com//geocoder/v2/?output=json&ak=qlZzbMADpf5wc7NQqpDuGAHWqwSPmY7h&address=%E5%8C%97%E4%BA%AC%E5%B8%82"},"method":"GET","multiUrl":false},"step2":{"bodytype":"application/x-www-form-urlencoded","auth":{"empty":""},"parameters":[],"signature":"no"},"step3":{"xml2json":false,"selfcert":false,"headers":[],"customeHeaders":[]}}} /*INSEND:RESTAPI*/
3.2添加变量采集器:
3.3 插入自定义代码段: