mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 08: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
				
			
		|  | @ -77,49 +77,52 @@ static const std::unordered_map<MapProvider, MapProviderInfo> mapProviderInfo_ { | |||
|           QMapLibre::Settings::ProviderTemplate::MapTilerProvider}, | ||||
|        .mapStyles_ { | ||||
|           {.name_ {"Satellite"}, | ||||
|            .url_ {"maptiler://maps/hybrid"}, | ||||
|            .url_ {"https://api.maptiler.com/maps/hybrid/style.json"}, | ||||
|            .drawBelow_ {"tunnel"}}, | ||||
|           {.name_ {"Streets"}, | ||||
|            .url_ {"maptiler://maps/streets-v2"}, | ||||
|            .url_ {"https://api.maptiler.com/maps/streets-v2/style.json"}, | ||||
|            .drawBelow_ {"aeroway"}}, | ||||
|           {.name_ {"Streets Dark"}, | ||||
|            .url_ {"maptiler://maps/streets-v2-dark"}, | ||||
|            .url_ {"https://api.maptiler.com/maps/streets-v2-dark/style.json"}, | ||||
|            .drawBelow_ {"aeroway"}}, | ||||
|           {.name_ {"Basic"}, | ||||
|            .url_ {"maptiler://maps/basic-v2"}, | ||||
|            .url_ {"https://api.maptiler.com/maps/basic-v2/style.json"}, | ||||
|            .drawBelow_ {"railway_transit_tunnel", "Transit tunnel"}}, | ||||
|           {.name_ {"Bright"}, | ||||
|            .url_ {"maptiler://maps/bright-v2"}, | ||||
|            .url_ {"https://api.maptiler.com/maps/bright-v2/style.json"}, | ||||
|            .drawBelow_ {"ferry"}}, | ||||
|           {.name_ {"Dataviz"}, | ||||
|            .url_ {"maptiler://maps/dataviz"}, | ||||
|            .url_ {"https://api.maptiler.com/maps/dataviz/style.json"}, | ||||
|            .drawBelow_ {"aeroway"}}, | ||||
|           {.name_ {"Dataviz Dark"}, | ||||
|            .url_ {"maptiler://maps/dataviz-dark"}, | ||||
|            .url_ {"https://api.maptiler.com/maps/dataviz-dark/style.json"}, | ||||
|            .drawBelow_ {"aeroway"}}, | ||||
|           {.name_ {"Outdoor"}, | ||||
|            .url_ {"maptiler://maps/outdoor-v2"}, | ||||
|            .url_ {"https://api.maptiler.com/maps/outdoor-v2/style.json"}, | ||||
|            .drawBelow_ {"aeroway_runway", "Aeroway"}}, | ||||
|           {.name_ {"Swisstopo"}, | ||||
|            .url_ {"maptiler://maps/ch-swisstopo-lbm"}, | ||||
|            .url_ {"https://api.maptiler.com/maps/ch-swisstopo-lbm/style.json"}, | ||||
|            .drawBelow_ {"pattern_landcover_vineyard", "Vineyard pattern"}}, | ||||
|           {.name_ {"Swisstopo Dark"}, | ||||
|            .url_ {"maptiler://maps/ch-swisstopo-lbm-dark"}, | ||||
|            .url_ { | ||||
|               "https://api.maptiler.com/maps/ch-swisstopo-lbm-dark/style.json"}, | ||||
|            .drawBelow_ {"pattern_landcover_vineyard", "Vineyard pattern"}}, | ||||
|           {.name_ {"Swisstopo Grey"}, | ||||
|            .url_ {"maptiler://maps/ch-swisstopo-lbm-grey"}, | ||||
|            .url_ { | ||||
|               "https://api.maptiler.com/maps/ch-swisstopo-lbm-grey/style.json"}, | ||||
|            .drawBelow_ {"pattern_landcover_vineyard", "Vineyard pattern"}}, | ||||
|           {.name_ {"Swisstopo Vivid"}, | ||||
|            .url_ {"maptiler://maps/ch-swisstopo-lbm-vivid"}, | ||||
|            .url_ {"https://api.maptiler.com/maps/ch-swisstopo-lbm-vivid/" | ||||
|                   "style.json"}, | ||||
|            .drawBelow_ {"pattern_landcover_vineyard", "Vineyard pattern"}}, | ||||
|           {.name_ {"Topo"}, | ||||
|            .url_ {"maptiler://maps/topo-v2"}, | ||||
|            .url_ {"https://api.maptiler.com/maps/topo-v2/style.json"}, | ||||
|            .drawBelow_ {"aeroway_runway", "Runway"}}, | ||||
|           {.name_ {"Topo Dark"}, | ||||
|            .url_ {"maptiler://maps/topo-v2-dark"}, | ||||
|            .url_ {"https://api.maptiler.com/maps/topo-v2-dark/style.json"}, | ||||
|            .drawBelow_ {"aeroway_runway", "Runway"}}, | ||||
|           {.name_ {"Winter"}, | ||||
|            .url_ {"maptiler://maps/winter-v2"}, | ||||
|            .url_ {"https://api.maptiler.com/maps/winter-v2/style.json"}, | ||||
|            .drawBelow_ {"aeroway_runway", "Aeroway"}}}}}, | ||||
|    {MapProvider::Unknown, MapProviderInfo {}}}; | ||||
| 
 | ||||
|  |  | |||
|  | @ -737,7 +737,8 @@ void MapWidget::SetMapStyle(const std::string& styleName) | |||
| 
 | ||||
|          logger_->debug("Updating style: {}", styles[i].name_); | ||||
| 
 | ||||
|          p->map_->setStyleUrl(styles[i].url_.c_str()); | ||||
|          util::maplibre::SetMapStyleUrl( | ||||
|             p->map_, p->mapProvider_, styles[i].url_); | ||||
| 
 | ||||
|          if (++p->currentStyleIndex_ == styles.size()) | ||||
|          { | ||||
|  | @ -763,7 +764,8 @@ void MapWidget::changeStyle() | |||
| 
 | ||||
|    logger_->debug("Updating style: {}", styles[p->currentStyleIndex_].name_); | ||||
| 
 | ||||
|    p->map_->setStyleUrl(styles[p->currentStyleIndex_].url_.c_str()); | ||||
|    util::maplibre::SetMapStyleUrl( | ||||
|       p->map_, p->mapProvider_, styles[p->currentStyleIndex_].url_); | ||||
| 
 | ||||
|    if (++p->currentStyleIndex_ == styles.size()) | ||||
|    { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat