diff --git a/resources/assets/js/map.js b/resources/assets/js/map.js index fac315fb99ef52d2d41f5841b1b85d41f48d94b3..f9acadbf42e9fd96e4a703d830eca395de20a575 100644 --- a/resources/assets/js/map.js +++ b/resources/assets/js/map.js @@ -41,7 +41,6 @@ InteractiveMap.prototype.initMap = function() { return ol.proj.transform(point, 'EPSG:3857', 'EPSG:4326'); } var source = null; - var labels = null; if(typeof android === "undefined"){ // We are not serving this for the app so we'll use our regular Tile-Serve source = new ol.source.OSM({ @@ -58,23 +57,8 @@ InteractiveMap.prototype.initMap = function() { ol.source.OSM.ATTRIBUTION, ], //url: 'https://tiles.metager.de/{z}/{x}/{y}.png' - url: '/tiles/tile/{z}/{x}/{y}.png' - }); - labels = new ol.source.OSM({ - attributions: [ - new ol.Attribution({ - html: '© ' + '<a href="https://metager.de/">MetaGer.de</a>' - }), - new ol.Attribution({ - html: '| <a href="https://metager.de/impressum">Impressum</a>' - }), - new ol.Attribution({ - html: '| © ' + '<a href="http://nominatim.openstreetmap.org/">Nominatim</a>' - }), - ol.source.OSM.ATTRIBUTION, - ], - //url: 'https://tiles.metager.de/{z}/{x}/{y}.png' - url: '/tiles/label/{z}/{x}/{y}.png' + url: '/tile_cache/{z}/{x}/{y}.png', + maxZoom: 21 }); }else{ // This is for our Android App we'll use another Tile-Server that has it's cache Disabled @@ -110,15 +94,7 @@ InteractiveMap.prototype.initMap = function() { layers.push( new ol.layer.Tile({ preload: 0, - source: source - }) - ) - } - if(labels != null){ - layers.push( - new ol.layer.Tile({ - preload: 0, - source: labels + source: source, }) ) } @@ -133,7 +109,7 @@ InteractiveMap.prototype.initMap = function() { new ol.control.ScaleLine() ]), view: new ol.View({ - maxZoom: 18, + maxZoom: 21, minZoom: 6, center: ol.proj.transform( //[9.45824, 52.48812], 'EPSG:4326', 'EPSG:3857'), diff --git a/routes/web.php b/routes/web.php index 40a812f221266b605f518815e0f6b90bff214c60..15c3b923df23b1b58dd96c31d9c38d3947931faa 100644 --- a/routes/web.php +++ b/routes/web.php @@ -47,47 +47,6 @@ Route::get('tile_cache/{z}/{x}/{y}.png', function($z, $x, $y){ return $response; }); -Route::group(['prefix' => 'tiles'], function(){ - Route::get('tile/{z}/{x}/{y}.png', function($z, $x, $y){ - $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); - socket_connect($socket, env("TILESERVER_HOST"), env("TILESERVER_PORT")); - - socket_write($socket, "tile-tile;$z;$x;$y\n", strlen("generate-tile;$z;$x,$y\n")); - - $content = ""; - while(true){ - $tmp = socket_read($socket, 4096); - if($tmp == "") break; - else $content .= $tmp; - } - $response = Response::make($content, 200); - $response->header('Content-Type', 'image/png'); - $response->header('Cache-Control', 'max-age=0, no-cache, no-store, must-revalidate'); - $response->header('Pragma', 'no-cache'); - $response->header('Expires', 'Wed, 11 Jan 1984 05:00:00 GMT'); - return $response; - }); - Route::get('label/{z}/{x}/{y}.png', function($z, $x, $y){ - $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); - socket_connect($socket, env("TILESERVER_HOST"), env("TILESERVER_PORT")); - - socket_write($socket, "tile-label;$z;$x;$y\n", strlen("generate-tile;$z;$x,$y\n")); - - $content = ""; - while(true){ - $tmp = socket_read($socket, 4096); - if($tmp == "") break; - else $content .= $tmp; - } - $response = Response::make($content, 200); - $response->header('Content-Type', 'image/png'); - $response->header('Cache-Control', 'max-age=0, no-cache, no-store, must-revalidate'); - $response->header('Pragma', 'no-cache'); - $response->header('Expires', 'Wed, 11 Jan 1984 05:00:00 GMT'); - return $response; - }); -}); - Route::group(['prefix' => 'map'], function () { Route::get('/', function () { return view('map')->with('css', [elixir('css/general.css'), elixir('css/mapSearch.css'), elixir('css/routing.css')]);