c5_labsci/web/admin/demo/front/form_map.html

80 lines
3.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<link href="/jscss/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="/jscss/theme.js"></script>
</head>
<body>
<form onsubmit="formsubmit(event);">
<div style="height:10em;">占位</div>
<div class="row" style="background:#eeeeee;">
<div class="ciy-form col-24 col-sm-24">
<label>测试a</label>
<div><ciy-map hasmore com="a" /></div>
</div>
<div class="ciy-form col-24 col-sm-24">
<label>测试b</label>
<div><ciy-map hasmore initevent com="b" value="330000000,1110000000" /></div>
</div>
<div class="ciy-form col-24 col-sm-24">
<label>测试loc</label>
<div><ciy-map com="loc" style="font-size:2em;" /></div>
</div>
<div class="ciy-form col-24 col-sm-24">
<label>毫米精度d</label>
<div><ciy-map hasmore bet="1000000000" com="d" /></div>
</div>
<div class="ciy-form col-24 col-sm-24">
<label>浮点数e</label>
<div><ciy-map hasmore bet="1" com="e" /></div>
</div>
</div>
<button type="submit" class="btn lg">提交</button>
<a class="btn" onclick="chg()">改变值</a>
<pre id="id_result"></pre>
<div style="height:30em;">占位</div>
<div style="height:30em;">占位</div>
<div style="height:30em;">占位</div>
</form>
<script type="text/javascript" src="/jscss/ciy.js"></script>
<script type="text/javascript" src="/jscss/ciycmp.js"></script>
<script type="text/javascript" src="/jscss/ciycmp2.js"></script>
<script type="text/javascript" src="../../common.js"></script>
<script type="text/javascript">
'use strict';
var c;
//经纬度乘以10000000通常使用int存储。精度在分米级。
//如果需要厘米级精度,可以自定调整精度。
ciyfn.pageload(function () {
c = ciycmp({ dom: '[com=a]', onchange: function (d) { showlog(d) } });
ciycmp({ dom: '[com=b]', onchange: function (d) { showlog(d) } });
ciycmp({ dom: '[com=loc]', value: { lat: 301331321, lng: 1200375089 }, onchange: function (d) { showlog(d) } });
ciycmp({ dom: '[com=d]',bet:1000000000, onchange: function (d) { showlog(d) } });
ciycmp({ dom: '[com=e]',bet:1, onchange: function (d) { showlog(d) } });
});
function formsubmit(event) {
event.preventDefault();
var postparam = ciyfn.getform(event.target);
showlog(postparam);
}
function showlog(dat) {
console.log(dat);
delete dat.dom;
$5('#id_result').html(JSON.stringify(dat, null, 2));
}
function chg() {
console.log(c);
c.setvalue({ lat: 300000000, lng: 1180000000 });
}
</script>
</body>
</html>