Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- map.legend.append("rect")
- .attr("x", 0).attr("y", 0)
- .attr("width", 180).attr("height", Math.min( (systems.length*16)+15,(map.height-50)))
- .style("fill", "rgb(255,255,255)");
- for(i=0;i<systems.length;i++){
- tmpSys = map.legend.append("g")
- .attr("class", "legend")
- .on("click", function(systemId, index){
- return function(){
- Toggle(index);
- if(map.filters.systems.indexOf(systemId) != -1){map.filters.systems.splice(map.filters.systems.indexOf(systemId),1);ReDraw();}
- else{map.filters.systems.push(systemId);ReDraw();}
- }
- } (systems["SystemId"][i], i) );
- tmpSys.append("rect")
- .attr("x", 10).attr("y", 10+(i*16))
- .attr("width", 10).attr("height", 10)
- .attr("class", "legendColor")
- .style("fill", systems["Color"][i]);
- tmpSys.append("text")
- .attr("x", 25).attr("y", (i*16)+18)
- .text(systems["Name"][i]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement