Skip to content

Commit

Permalink
kapcsolatok számának megjelenítése
Browse files Browse the repository at this point in the history
  • Loading branch information
kolesar-andras committed Sep 20, 2016
1 parent 54f0d59 commit 8edcc72
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<div><img src="img/70.svg" /><input type="checkbox" id="checkbox.vodafone" onclick="clickOperator()""/> <label for="checkbox.vodafone">Vodafone</label></div>
<div lang="hu" title="bázisállomás egyelőre meghatározatlan szolgáltatóval"><img src="img/00.svg" /><input type="checkbox" id="checkbox.unknown" onclick="clickOperator()"/> <label lang="hu" for="checkbox.unknown">ismeretlen szolgáltató</label></div>
<div lang="hu" title="egyéb torony (kémény, víztorony), amelyől még nem tudjuk, hogy bázisállomás-e"><img src="img/nosite.svg" /><input type="checkbox" id="checkbox.nosite" onclick="clickOperator()"/> <label lang="hu" for="checkbox.nosite">egyéb torony</label></div>
<div lang="hu" title="mikrohullámú összeköttetések a bázisállomások között"><span class="placeholder"></span><input type="checkbox" id="checkbox.connections" onclick="clickOperator()"/> <label lang="hu" for="checkbox.connections">kapcsolatok</label></div>
<div lang="hu" title="mikrohullámú összeköttetés a bázisállomások között"><span class="placeholder"></span><input type="checkbox" id="checkbox.connections" onclick="clickOperator()"/> <label lang="hu" for="checkbox.connections">kapcsolatok</label></div>
</div>
<div id="count">
<div lang="hu" title="a szűrőfeltételeknek megfelelő helyszínek száma"><span id="count.all"></span> helyszín</div>
Expand All @@ -65,6 +65,7 @@
<div lang="hu" title="bázisállomások összesen (közös helyszínek külön-külön számítva)"><span id="count.unique.site"></span> ~ szolgáltatókra bontva</div>
<div lang="hu" title="cella-azonosítókkal is címkézett bázisállomások"><span id="count.cellid"></span> ~ cella-azonosítókkal</div>
<div lang="hu" title="bázisállomásokhoz kapcsolt cellák darabszáma technológiánként (gsm, umts, lte) és összesen"><span id="count.unique.cellid"></span> cella</div>
<div lang="hu" title="mikrohullámú összeköttetés a bázisállomások között"><span id="count.connection"></span> kapcsolat</div>
</div>
<div>
<a href="#lang-en" onclick="window.lang.change('en'); return false;">english</a>
Expand Down
12 changes: 9 additions & 3 deletions js/stat.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@ function getOperatorArray (feature) {
function getOperators(feature) {
var operator = feature.n.tags.operator;
var is = {};
if (feature.n.type == 'relation') is.connection = true;
if (operator) {
if (operator.indexOf('Telenor') != -1) is.telenor = true; // operators.push('01');
if (operator.indexOf('Telekom') != -1) is.telekom = true; // operators.push('30');
if (operator.indexOf('Vodafone') != -1) is.vodafone = true; // operators.push('70');
}
if (feature.n.tags['communication:mobile_phone']) is.site = true;
if (is.site && !is.telenor && !is.telekom && !is.vodafone) is.unknown = true; // operators.push('00');
if ((is.connection || is.site) && !is.telenor && !is.telekom && !is.vodafone) is.unknown = true; // operators.push('00');
return is;
}

Expand All @@ -109,7 +110,6 @@ function getOperatorColours(feature) {
if (display.telenor && is.telenor) colours.push('#00a9e3');
if (display.telekom && is.telekom) colours.push('#000000');
if (display.vodafone && is.vodafone) colours.push('#d5030b');
if (!is.telenor && !is.telekom && !is.vodafone) is.unknown = true;
if (display.unknown && is.unknown) colours.push('#808080');
return colours;
}
Expand All @@ -125,6 +125,7 @@ function countCells () {
count.unique.cellid.gsm = 0;
count.unique.cellid.umts = 0;
count.unique.cellid.lte = 0;
count.connection = 0;

source.forEachFeature(function (feature) {
is = getOperators(feature);
Expand All @@ -135,7 +136,11 @@ function countCells () {
(is.unknown && display.unknown) ||
(!is.site && display.nosite)
)) return;
count.all++;
if (is.connection) {
count.connection++;
} else {
count.all++;
}
if (
feature.n.tags['communication:mobile_phone'] &&
feature.n.tags['communication:mobile_phone'] != 'no'
Expand Down Expand Up @@ -163,6 +168,7 @@ function countCells () {
count.unique.cellid.gsm +
count.unique.cellid.umts +
count.unique.cellid.lte);
document.getElementById('count.connection').innerHTML = count.connection;

document.getElementById('sarok').style.visibility = 'visible';
}
Expand Down

0 comments on commit 8edcc72

Please sign in to comment.