Skip to content

Commit

Permalink
Начало перехода на Snap.svg для создания геоданных
Browse files Browse the repository at this point in the history
  • Loading branch information
filippov70 committed Sep 22, 2014
1 parent de256dc commit 2bcb450
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 7,306 deletions.
19 changes: 15 additions & 4 deletions public_html/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,37 @@ var areaArr = [];
var pointNumber = 0;
var pageHeight = 0;
var pageWidth = 0;
var paper;

function log(msg) {
//$('.log').val($('.log').val() + '\n' + msg);
}

function createGeodataRepoprt() {
paper = Snap("#svg");
prepare();
pageHeight = $('.pg-height').val();
pageWidth = $('.pg-width').val();
$('#svg').css('width:', pageHeight);
$('#svg').css('height:' + pageHeight);
paper.rect(0, 0, pageHeight, pageWidth).attr({
fill: "#bada55",
stroke: "#000",
strokeWidth: 5
});

var newtable = '';
for(var i=0; i < geodataTableArr.length; i++) {
newtable += '<table>' + $(geodataTableArr[i]).html() + '</table><span>'+areaArr[i]+' кв.м</span><br><br>';
}
var geodataReport = window.open('geodata.html', 'Geodata');
var geodataReport = window.open('geodata-svg.html', 'Geodata');

geodataReport.onload = function () {
$('#h', geodataReport.document).text(pageHeight);
$('#w', geodataReport.document).text(pageWidth);
// $('#h', geodataReport.document).text(pageHeight);
// $('#w', geodataReport.document).text(pageWidth);
var data = $('#data', geodataReport.document);
data.html(newtable);
//data.html(newtable);
data.html($('#svg').toggleClass('hidden'));
};
geodataReport.focus();
}
Expand Down
Loading

0 comments on commit 2bcb450

Please sign in to comment.