Skip to content
Snippets Groups Projects
Commit 5fcaaf8a authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

The Labels are now again rendered on one Tile but all Labels should render now correctly

parent 63db88b9
No related branches found
No related tags found
No related merge requests found
......@@ -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: '&copy; ' + '<a href="https://metager.de/">MetaGer.de</a>'
}),
new ol.Attribution({
html: '| <a href="https://metager.de/impressum">Impressum</a>'
}),
new ol.Attribution({
html: '| &copy; ' + '<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'),
......
......@@ -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')]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment