<!DOCTYPE html>
|
|
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
<head>
|
<meta charset="utf-8" />
|
<title></title>
|
<script src="Resources/jquery.3.2.1.js"></script>
|
<script src="Resources/LZBuilding.json"></script>
|
<script src="Resources/LZProperty.json"></script>
|
<script src="Resources/Camera.json"></script>
|
<script>
|
function ReadLZBuilding() {
|
LZBuilding.features.sort(function (a, b) {
|
if (a.properties.name == b.properties.name) return 0;
|
|
return a.properties.name > b.properties.name ? 1 : -1;
|
});
|
|
var strs = [];
|
for (var i = 0, c = LZBuilding.features.length; i < c; i++) {
|
var p = LZBuilding.features[i].properties;
|
strs.push("insert into Building values (" + p.Id + ",1,'" + p.name + "'," + p.height + "," + p.Floor + ",'','','');");
|
}
|
|
var vals = strs.join("\r\n");
|
$("#txtArea").val(vals);
|
}
|
|
function ReadLZProperty() {
|
LZProperty.features.sort(function (a, b) {
|
return a.properties.Id - b.properties.Id;
|
});
|
|
var strs = [], lastId = -1;
|
for (var i = 0, c = LZProperty.features.length; i < c; i++) {
|
var p = LZProperty.features[i].properties;
|
if (p.Id == lastId) continue;
|
|
lastId = p.Id;
|
strs.push("insert into Property (Id,Name) values (" + p.Id + ",'" + p.PPE_Name + "');");
|
}
|
|
var vals = strs.join("\r\n");
|
$("#txtArea").val(vals);
|
}
|
|
function ReadCamera() {
|
var strs = [];
|
for (var i = 0, c = Camera.features.length; i < c; i++) {
|
var p = Camera.features[i].properties;
|
strs.push("insert into Camera values (" + p.Id + ",'" + p.CType + "','" + p.CName + "','');");
|
}
|
|
var vals = strs.join("\r\n");
|
$("#txtArea").val(vals);
|
}
|
</script>
|
</head>
|
<body>
|
<button onclick="ReadLZBuilding();">Read LZBuilding Json</button>
|
<button onclick="ReadLZProperty();">Read LZProperty Json</button>
|
<button onclick="ReadCamera();">Read Camera Json</button>
|
|
<br /><br />
|
<textarea id="txtArea" style="height: 300px; width: 500px;"></textarea>
|
</body>
|
</html>
|