... | ... |
@@ -8,7 +8,7 @@ var MapTiles = { |
8 | 8 |
m.tile_size = 256; |
9 | 9 |
m.maps_base = getprop("/sim/fg-home") ~ '/cache/maps'; |
10 | 10 |
m.makeUrl = string.compileTemplate(data['tiles-template']); |
11 |
- m.makePath = string.compileTemplate(m.maps_base ~ '/{server}/{type}/{z}/{x}/{y}.png'); |
|
11 |
+ m.makePath = string.compileTemplate(m.maps_base ~ '/{server}/{type}/{z}/{x}/{y}.{format}'); |
|
12 | 12 |
m.num_tiles = [ |
13 | 13 |
math.ceil( m.device.data.mapsize[0] / m.tile_size ) + 1, |
14 | 14 |
math.ceil( m.device.data.mapsize[1] / m.tile_size ) + 1 |
... | ... |
@@ -79,6 +79,7 @@ var MapTiles = { |
79 | 79 |
y: int(offset[1] + y), |
80 | 80 |
type: data['tiles-type'], |
81 | 81 |
server : data['tiles-server'], |
82 |
+ format: data['tiles-format'], |
|
82 | 83 |
apikey: data['tiles-apikey'], |
83 | 84 |
}; |
84 | 85 |
|
... | ... |
@@ -254,7 +254,13 @@ or if there is no type, just use type `/`: |
254 | 254 |
--prop:/sim/online-tiles-server=a.tile.opentopomap.org |
255 | 255 |
--prop:/sim/online-tiles-type=/ |
256 | 256 |
|
257 |
-The only used protocol is `https` (check Nasal/map.nas). |
|
257 |
+The only used protocol is `https` but you can provide your own template with option |
|
258 |
+ |
|
259 |
+ --prop:/sim/online-tiles-template=http://{server}/{type}/{z}/{x}/{y}.jpeg |
|
260 |
+ |
|
261 |
+An option is also available to tell the format of the tile image which can be used in template with the `{format}` anchor |
|
262 |
+ |
|
263 |
+ --prop:/sim/online-tiles-format=jpeg |
|
258 | 264 |
|
259 | 265 |
## Switch it up |
260 | 266 |
You can use the multikey (souvenirs, thanks to Melchior having that much expended this feature years ago :)) service by typing: |
... | ... |
@@ -145,7 +145,8 @@ var init_props = func { |
145 | 145 |
server: 'maps.wikimedia.org', |
146 | 146 |
type: 'osm-intl', |
147 | 147 |
apikey: '', |
148 |
- template: 'https://{server}/{type}/{z}/{x}/{y}.png{apikey}', |
|
148 |
+ format: 'png', |
|
149 |
+ template: 'https://{server}/{type}/{z}/{x}/{y}.{format}{apikey}', |
|
149 | 150 |
}; |
150 | 151 |
foreach (var v; keys(tiles_defaults)) { |
151 | 152 |
var val = getprop('/sim/online-tiles-' ~ v); |