Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. map.legend.append("rect")
  2. .attr("x", 0).attr("y", 0)
  3. .attr("width", 180).attr("height", Math.min( (systems.length*16)+15,(map.height-50)))
  4. .style("fill", "rgb(255,255,255)");
  5. for(i=0;i<systems.length;i++){
  6. tmpSys = map.legend.append("g")
  7. .attr("class", "legend")
  8. .on("click", function(systemId, index){
  9. return function(){
  10. Toggle(index);
  11. if(map.filters.systems.indexOf(systemId) != -1){map.filters.systems.splice(map.filters.systems.indexOf(systemId),1);ReDraw();}
  12. else{map.filters.systems.push(systemId);ReDraw();}
  13. }
  14. } (systems["SystemId"][i], i) );
  15. tmpSys.append("rect")
  16. .attr("x", 10).attr("y", 10+(i*16))
  17. .attr("width", 10).attr("height", 10)
  18. .attr("class", "legendColor")
  19. .style("fill", systems["Color"][i]);
  20. tmpSys.append("text")
  21. .attr("x", 25).attr("y", (i*16)+18)
  22. .text(systems["Name"][i]);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement