refine openfreemap offline map
This commit is contained in:
@@ -11,6 +11,7 @@ alias.url += (
|
||||
"/INSTANCE/globe_history/" => "/var/globe_history/",
|
||||
"/INSTANCE/aircraft_sil/" => "/usr/local/share/tar1090/aircraft_sil/",
|
||||
"/INSTANCE/osm_tiles_offline/" => "/usr/local/share/osm_tiles_offline/",
|
||||
"/INSTANCE/openfreemap_offline/" => "/usr/local/share/openfreemap_offline/mnt/",
|
||||
"/INSTANCE/" => "HTMLPATH/"
|
||||
)
|
||||
|
||||
@@ -112,6 +113,11 @@ $HTTP["url"] =~ "^/INSTANCE/libs/.*$" {
|
||||
"Cache-Control" => "public, max-age=1209600",
|
||||
)
|
||||
}
|
||||
$HTTP["url"] =~ "^/INSTANCE/openfreemap_offline/tiles" {
|
||||
setenv.add-response-header += (
|
||||
"Content-Encoding" => "gzip",
|
||||
)
|
||||
}
|
||||
$HTTP["url"] =~ "^/INSTANCE/style.css$" {
|
||||
setenv.add-response-header += (
|
||||
"Cache-Control" => "public, max-age=1209600",
|
||||
|
||||
@@ -108,8 +108,8 @@ function createBaseLayers() {
|
||||
onVisible: (layer) => {
|
||||
if (!layer.get('styleApplied')) {
|
||||
// ol-mapbox-style plugin packed in with ol ... (kinda ugly)
|
||||
ol.mapboxStyle.applyStyle(layer, "./openfreemap_tiles_offline/liberty");
|
||||
ol.mapboxStyle.applyBackground(layer, "./openfreemap_tiles_offline/liberty");
|
||||
ol.mapboxStyle.applyStyle(layer, "./openfreemap_offline/liberty");
|
||||
ol.mapboxStyle.applyBackground(layer, "./openfreemap_offline/liberty");
|
||||
layer.set('styleApplied', true);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -39,6 +39,13 @@ location /INSTANCE/osm_tiles_offline/ {
|
||||
alias /usr/local/share/osm_tiles_offline/;
|
||||
}
|
||||
|
||||
location /INSTANCE/openfreemap_offline/ {
|
||||
alias /usr/local/share/openfreemap_offline/mnt/;
|
||||
location /INSTANCE/openfreemap_offline/tiles/ {
|
||||
add_header Content-Encoding "gzip";
|
||||
}
|
||||
}
|
||||
|
||||
location /INSTANCE/globe_history/ {
|
||||
alias /var/globe_history/;
|
||||
gzip on;
|
||||
|
||||
Reference in New Issue
Block a user