-
Notifications
You must be signed in to change notification settings - Fork 3
/
wayfootways.js
36 lines (36 loc) · 1.1 KB
/
wayfootways.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function Wayfootways(){
this.items = {};
this.p = modules.ways;
this.parse_itm = function(itm, node){
var id = node.getAttribute("id");
if(processed.ways.indexOf(id)>-1){
console.warn("Already processed");
return;
}
for(var i=0; i<node.children.length; i++){
var child = node.children[i];
if(child.tagName==='tag'){
var k = child.getAttribute("k");
if(k==='highway'){
if(child.getAttribute("v")==='footway'){
this.items[id] = itm;
processed.ways.push(id);
return;
}
}
}
}
}
this.get_mesh = function(meshgroup){
var wayshapes = [];
for(way in this.items){
wayshapes.push(CPath(this.items[way].points, 0.3));
}
meshgroup.add( CMesh(wayshapes, 0xffaa66) );
}
this.to_render = function(camera){
for(way in this.names){
}
}
}
modules.ways.modules.wayfootways = new Wayfootways();