mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 00:50:05 +00:00 
			
		
		
		
	Map distance helper function
This commit is contained in:
		
							parent
							
								
									2113cb9ba8
								
							
						
					
					
						commit
						5e1b1a5ba6
					
				
					 2 changed files with 12 additions and 0 deletions
				
			
		|  | @ -1,5 +1,6 @@ | |||
| #include <scwx/qt/util/maplibre.hpp> | ||||
| 
 | ||||
| #include <QMapLibreGL/utils.hpp> | ||||
| #include <mbgl/util/constants.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
|  | @ -11,6 +12,13 @@ namespace util | |||
| namespace maplibre | ||||
| { | ||||
| 
 | ||||
| boost::units::quantity<boost::units::si::length> | ||||
| GetMapDistance(const QMapLibreGL::CustomLayerRenderParameters& params) | ||||
| { | ||||
|    return QMapLibreGL::metersPerPixelAtLatitude(params.latitude, params.zoom) * | ||||
|           (params.width + params.height) / 2.0 * boost::units::si::meters; | ||||
| } | ||||
| 
 | ||||
| glm::vec2 LatLongToScreenCoordinate(const QMapLibreGL::Coordinate& coordinate) | ||||
| { | ||||
|    static constexpr double RAD2DEG_D = 180.0 / M_PI; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat