Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MetaGerMaps
Frontend
Commits
5fcaaf8a
Commit
5fcaaf8a
authored
6 years ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
resources/assets/js/map.js
+4
-28
4 additions, 28 deletions
resources/assets/js/map.js
routes/web.php
+0
-41
0 additions, 41 deletions
routes/web.php
with
4 additions
and
69 deletions
resources/assets/js/map.js
+
4
−
28
View file @
5fcaaf8a
...
...
@@ -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
:
1
8
,
maxZoom
:
2
1
,
minZoom
:
6
,
center
:
ol
.
proj
.
transform
(
//[9.45824, 52.48812], 'EPSG:4326', 'EPSG:3857'),
...
...
This diff is collapsed.
Click to expand it.
routes/web.php
+
0
−
41
View file @
5fcaaf8a
...
...
@@ -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'
)]);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment