[CQ Award] Added legend on map
这个提交包含在:
		
							父节点
							
								
									d4c51fc75c
								
							
						
					
					
						当前提交
						49025ff0bc
					
				
					共有  2 个文件被更改,包括 41 次插入 和 0 次删除
				
			
		|  | @ -3,6 +3,32 @@ | ||||||
| 	height: calc(100vh - 430px) !important; | 	height: calc(100vh - 430px) !important; | ||||||
| 	max-height: 900px !important; | 	max-height: 900px !important; | ||||||
| } | } | ||||||
|  | /*Legend specific*/ | ||||||
|  | .legend { | ||||||
|  |   padding: 6px 8px; | ||||||
|  |   font: 14px Arial, Helvetica, sans-serif; | ||||||
|  |   background: white; | ||||||
|  |   background: rgba(255, 255, 255, 0.8); | ||||||
|  |   line-height: 24px; | ||||||
|  |   color: #555;
 | ||||||
|  | } | ||||||
|  | .legend h4 { | ||||||
|  |   text-align: center; | ||||||
|  |   font-size: 16px; | ||||||
|  |   margin: 2px 12px 8px; | ||||||
|  |   color: #777;
 | ||||||
|  | } | ||||||
|  | .legend span { | ||||||
|  |   position: relative; | ||||||
|  |   bottom: 3px; | ||||||
|  | } | ||||||
|  | .legend i { | ||||||
|  |   width: 18px; | ||||||
|  |   height: 18px; | ||||||
|  |   float: left; | ||||||
|  |   margin: 0 8px 0 0; | ||||||
|  |   opacity: 0.7; | ||||||
|  | } | ||||||
| </style> | </style> | ||||||
| 
 | 
 | ||||||
| <div class="container"> | <div class="container"> | ||||||
|  |  | ||||||
|  | @ -153,6 +153,21 @@ function load_cq_map2(data) { | ||||||
|             } |             } | ||||||
|           ).addTo(map).on('click', onClick); |           ).addTo(map).on('click', onClick); | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     /*Legend specific*/ | ||||||
|  |     var legend = L.control({ position: "topright" }); | ||||||
|  | 
 | ||||||
|  |     legend.onAdd = function(map) { | ||||||
|  |         var div = L.DomUtil.create("div", "legend"); | ||||||
|  |         div.innerHTML += "<h4>Colors</h4>"; | ||||||
|  |         div.innerHTML += '<i style="background: green"></i><span>Confirmed</span><br>'; | ||||||
|  |         div.innerHTML += '<i style="background: orange"></i><span>Worked not confirmed</span><br>'; | ||||||
|  |         div.innerHTML += '<i style="background: red"></i><span>Not worked</span><br>'; | ||||||
|  |         return div; | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     legend.addTo(map); | ||||||
|  | 
 | ||||||
|     map.setView([20, 0], 2); |     map.setView([20, 0], 2); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用