mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 05:20:06 +00:00 
			
		
		
		
	Add map copyrights and map provider to map context
This commit is contained in:
		
							parent
							
								
									6b00c55bac
								
							
						
					
					
						commit
						5c7c7e6a19
					
				
					 5 changed files with 73 additions and 25 deletions
				
			
		|  | @ -88,10 +88,11 @@ 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) | ||||
| void SetMapStyleUrl(const std::shared_ptr<map::MapContext>& mapContext, | ||||
|                     const std::string&                      url) | ||||
| { | ||||
|    const auto mapProvider = mapContext->map_provider(); | ||||
| 
 | ||||
|    QString qUrl = QString::fromStdString(url); | ||||
| 
 | ||||
|    if (mapProvider == map::MapProvider::MapTiler) | ||||
|  | @ -100,7 +101,11 @@ void SetMapStyleUrl(const std::shared_ptr<QMapLibre::Map>& map, | |||
|       qUrl.append(map::GetMapProviderApiKey(mapProvider)); | ||||
|    } | ||||
| 
 | ||||
|    map->setStyleUrl(qUrl); | ||||
|    auto map = mapContext->map().lock(); | ||||
|    if (map != nullptr) | ||||
|    { | ||||
|       map->setStyleUrl(qUrl); | ||||
|    } | ||||
| } | ||||
| 
 | ||||
| } // namespace maplibre
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat