Commit e581a5ba2b488b779d26788fde980df823b79747

  • avatar
  • arvind
  • Sun Sep 22 17:12:55 IST 2013
Improvements to map code
  
1818 return;
1919 }
2020
21
2122 function getColor(d){
22 return d > 3 ? "#fecc5c" :
23 d > 2 ? "#f03b20" :
24 "#b10026";
23 return d > 9 ? "#5E4FA2" :
24 d > 8 ? "#3288BD" :
25 d > 7 ? "#66C2A5" :
26 d > 6 ? "#ABDDA4" :
27 d > 5 ? "#E6F598" :
28 d > 4 ? "#FEE08B" :
29 d > 2 ? "#D53E4F" :
30 "#9E0142";
2531
2632 }
2733 var india_map = L.tileLayer('http://{s}.tile.cloudmade.com/157f9082094e402f89d242e9b9144483/997/256/{z}/{x}/{y}.png', {
5252 // info.policyExplain(props.rating) + '</small></p>'
5353 new L.Popup()
5454 .setLatLng(e.latlng)
55 .setContent("<div style='height:250px;overflow-y:scroll;'><b>"+e.target.feature.properties.name+"</b></br><span class='yellow'>"+M.filterTags(['rating'], e.target.feature.properties.id)[0].attributes.data +"</span>/<span class='red'>5</span><small>&gt;&gt; "+info.policyExplain(e.target.feature.properties.rating)+"</small></br>Pros:"+e.target.feature.properties.pros+"</br>Cons:"+e.target.feature.properties.cons+"</br><a href='#/funding'>Funding</a><br/><a href='#/policies/"+e.target.feature.id+"'>Read more...</a></br></div>")
55 .setContent("<div style='height:250px;overflow-y:scroll;'><b>"+e.target.feature.properties.name+"</b></br><span class='yellow'>Rating:"+M.filterTags(['rating'], e.target.feature.id)[0].attributes.data.match(/Rating: (\d+)/)[1] +"</span>/<span class='red'>5</span><small>&gt;&gt; "+info.policyExplain(M.filterTags(['rating'], e.target.feature.id)[0].attributes.data.match(/Rating: (\d+)/)[1])+"</small></br>Pros:"+M.filterTags(["pros"], e.target.feature.id)[0].attributes.data+"</br>Cons:"+M.filterTags(["cons"], e.target.feature.id)[0].attributes.data +"</br><a href='#/funding'>Funding</a><br/><a href='#/policies/"+e.target.feature.id+"'>Read more...</a></br></div>")
5656 .openOn(map);
5757
5858 // info.update(layer.feature.properties);
8686 function(feature){
8787 return{
8888 weight:1,
89 fillColor: getColor(feature.properties.rating),
89 fillColor: getColor(M.filterTags(['rating'], feature.id)[0].attributes.data.match(/Rating: (\d+)/)[1]),
9090 opacity:0,
9191 //color:'white',
9292 dashArray:'3',