mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -05:00 
			
		
		
		
	Not an ideal implementation (too much logic resides in the gui QgsMapCanvasAnnotationItem class), but any approach using current api will be dependant on some hacks. Ideally we need a QgsVectorDataProvider method for finding the closest feature(s) to a point(/line/polygon) within a certain tolerance, with provider specific implementations which offload this to the data store's spatial indices. Then this handling could be bumped up to reside in QgsAnnotation.
		
			
				
	
	
		
			42 lines
		
	
	
		
			703 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			703 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
<html>
 | 
						|
  <head>
 | 
						|
    <style>
 | 
						|
      body
 | 
						|
      {
 | 
						|
        background-color: transparent;
 | 
						|
        margin: 6px;
 | 
						|
        padding: 0px;
 | 
						|
      }
 | 
						|
      table 
 | 
						|
      {
 | 
						|
        width: 300px;
 | 
						|
        border-spacing: 6px;
 | 
						|
        margin: 0px;
 | 
						|
        padding: 0px;
 | 
						|
      }
 | 
						|
      table tr
 | 
						|
      {
 | 
						|
        height: 40px;
 | 
						|
      }
 | 
						|
      table td
 | 
						|
      {
 | 
						|
        border: 2px solid black;
 | 
						|
        font-family: arial;
 | 
						|
        font-size: 18px;
 | 
						|
        font-weight: bold;
 | 
						|
      }
 | 
						|
      tr.row1
 | 
						|
      {
 | 
						|
        background-color: yellow;
 | 
						|
      }
 | 
						|
    </style>
 | 
						|
  </head>
 | 
						|
  <body>
 | 
						|
    <table>
 | 
						|
      <tbody>
 | 
						|
        <tr class="row1"><td>[% "station" %]</td><td>[% "suburb" %]</td></tr>
 | 
						|
      </tbody>
 | 
						|
    </table>
 | 
						|
  </body>
 | 
						|
</html>
 |