mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 04:10:06 +00:00 
			
		
		
		
	With MapTiler, use https for style URLs
- Eliminates issues with rewriting maptiler:// to incorrect URLs
This commit is contained in:
		
							parent
							
								
									a74fb22c88
								
							
						
					
					
						commit
						e0c1138250
					
				
					 5 changed files with 49 additions and 19 deletions
				
			
		|  | @ -88,6 +88,21 @@ glm::vec2 LatLongToScreenCoordinate(const QMapLibre::Coordinate& coordinate) | |||
|    return screen; | ||||
| } | ||||
| 
 | ||||
| void SetMapStyleUrl(const std::shared_ptr<QMapLibre::Map>& map, | ||||
|                     map::MapProvider                       mapProvider, | ||||
|                     const std::string&                     url) | ||||
| { | ||||
|    QString qUrl = QString::fromStdString(url); | ||||
| 
 | ||||
|    if (mapProvider == map::MapProvider::MapTiler) | ||||
|    { | ||||
|       qUrl.append("?key="); | ||||
|       qUrl.append(map::GetMapProviderApiKey(mapProvider)); | ||||
|    } | ||||
| 
 | ||||
|    map->setStyleUrl(qUrl); | ||||
| } | ||||
| 
 | ||||
| } // namespace maplibre
 | ||||
| } // namespace util
 | ||||
| } // namespace qt
 | ||||
|  |  | |||
|  | @ -1,5 +1,8 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/qt/map/map_provider.hpp> | ||||
| 
 | ||||
| #include <QMapLibre/Map> | ||||
| #include <QMapLibre/Types> | ||||
| #include <glm/gtc/type_ptr.hpp> | ||||
| #include <units/length.h> | ||||
|  | @ -31,6 +34,10 @@ bool IsPointInPolygon(const std::vector<glm::vec2>& vertices, | |||
| 
 | ||||
| glm::vec2 LatLongToScreenCoordinate(const QMapLibre::Coordinate& coordinate); | ||||
| 
 | ||||
| void SetMapStyleUrl(const std::shared_ptr<QMapLibre::Map>& map, | ||||
|                     map::MapProvider                       mapProvider, | ||||
|                     const std::string&                     url); | ||||
| 
 | ||||
| } // namespace maplibre
 | ||||
| } // namespace util
 | ||||
| } // namespace qt
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat