forked from MapComplete/MapComplete
		
	Chore: remove maptiler mentions
This commit is contained in:
		
							parent
							
								
									51cdf9060e
								
							
						
					
					
						commit
						7aa97c9a99
					
				
					 5 changed files with 1 additions and 38 deletions
				
			
		
							
								
								
									
										2
									
								
								android
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								android
									
										
									
									
									
								
							|  | @ -1 +1 @@ | |||
| Subproject commit bdd43dc65c3e1c5c5b12bc60af30e909df7dd95b | ||||
| Subproject commit 1d442585b5202fcb4424d41fa2597cc23f0a9b65 | ||||
|  | @ -211,7 +211,6 @@ export default class Constants { | |||
|     public static GeoIpServer: string | undefined = Constants.config.geoip_server | ||||
|     public static ErrorReportServer: string | undefined = Constants.config.error_server | ||||
| 
 | ||||
|     public static readonly maptilerApiKey = "GvoVAJgu46I5rZapJuAy" | ||||
|     public static readonly SummaryServer: string = Constants.config.summary_server | ||||
| 
 | ||||
|     public static allServers: string[] = [ | ||||
|  |  | |||
|  | @ -29,7 +29,6 @@ export interface MapProperties { | |||
|         nearestFeature?: Feature | ||||
|     }> | ||||
|     readonly allowZooming: UIEventSource<true | boolean> | ||||
|     readonly useTerrain: Store<boolean> | ||||
|     readonly showScale: UIEventSource<boolean> | ||||
| 
 | ||||
|     /** | ||||
|  |  | |||
|  | @ -57,7 +57,6 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap { | |||
|     readonly maxzoom: UIEventSource<number> | ||||
|     readonly rotation: UIEventSource<number> | ||||
|     readonly pitch: UIEventSource<number> | ||||
|     readonly useTerrain: Store<boolean> | ||||
|     readonly showScale: UIEventSource<boolean> | ||||
| 
 | ||||
|     private static pmtilesInited = false | ||||
|  | @ -107,7 +106,6 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap { | |||
|         this.bounds = state?.bounds ?? new UIEventSource(undefined) | ||||
|         this.rotation = state?.rotation ?? new UIEventSource<number>(0) | ||||
|         this.pitch = state?.pitch ?? new UIEventSource<number>(0) | ||||
|         this.useTerrain = state?.useTerrain ?? new ImmutableStore<boolean>(false) | ||||
|         this.rasterLayer = | ||||
|             state?.rasterLayer ?? new UIEventSource<RasterLayerPolygon | undefined>(undefined) | ||||
|         this.showScale = state?.showScale ?? new UIEventSource<boolean>(false) | ||||
|  | @ -182,7 +180,6 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap { | |||
|             this.setBounds(this.bounds.data) | ||||
|             this.SetRotation(this.rotation.data) | ||||
|             this.setScale(this.showScale.data) | ||||
|             this.setTerrain(this.useTerrain.data) | ||||
|             this.updateStores(true) | ||||
|         } | ||||
| 
 | ||||
|  | @ -265,7 +262,6 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap { | |||
|         ) | ||||
|         this.allowZooming.addCallbackAndRun((allowZooming) => this.setAllowZooming(allowZooming)) | ||||
|         this.bounds.addCallbackAndRunD((bounds) => this.setBounds(bounds)) | ||||
|         this.useTerrain?.addCallbackAndRun((useTerrain) => this.setTerrain(useTerrain)) | ||||
|         this.showScale?.addCallbackAndRun((showScale) => this.setScale(showScale)) | ||||
|     } | ||||
| 
 | ||||
|  | @ -718,35 +714,6 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap { | |||
|         this.zoom.setData(1) | ||||
|     } | ||||
| 
 | ||||
|     private async setTerrain(useTerrain: boolean) { | ||||
|         const map = this._maplibreMap.data | ||||
|         if (!map) { | ||||
|             return | ||||
|         } | ||||
|         const id = "maptiler-terrain-data" | ||||
|         if (useTerrain) { | ||||
|             if (map.getTerrain()) { | ||||
|                 return | ||||
|             } | ||||
|             map.addSource(id, { | ||||
|                 type: "raster-dem", | ||||
|                 url: | ||||
|                     "https://api.maptiler.com/tiles/terrain-rgb/tiles.json?key=" + | ||||
|                     Constants.maptilerApiKey, | ||||
|             }) | ||||
|             try { | ||||
|                 while (!map?.isStyleLoaded()) { | ||||
|                     await Utils.waitFor(250) | ||||
|                 } | ||||
|                 map.setTerrain({ | ||||
|                     source: id, | ||||
|                 }) | ||||
|             } catch (e) { | ||||
|                 console.error(e) | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     private scaleControl: maplibregl.ScaleControl = undefined | ||||
| 
 | ||||
|     private setScale(showScale: boolean) { | ||||
|  |  | |||
|  | @ -16,8 +16,6 @@ | |||
|     <!-- We don't support dark mode (yet); disable it to prevent bugs --> | ||||
|     <meta name="color-scheme" content="light only"> | ||||
| 
 | ||||
|     <link rel="preconnect" href="https://api.maptiler.com"> | ||||
|     <link rel="dns-prefetch" href="https://api.maptiler.com"> | ||||
|     <link rel="preconnect" href="https://api.openstreetmap.org"> | ||||
|     <link rel="dns-prefetch" href="https://api.openstreetmap.com"> | ||||
|     <link rel="preconnect" href="https://www.openstreetmap.org"> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue