Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
civitas-digitalis
platform
Commits
590e11df
Commit
590e11df
authored
Feb 20, 2018
by
Elias Englmeier
Browse files
map is now always showing Kassel if there are no markers to be displayed
parent
724b2a2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/MapModule/bin/META-INF/resources/view.jsp
View file @
590e11df
...
...
@@ -30,8 +30,10 @@ $(document).ready(function(){
id
:
'
mapbox.streets
'
,
accessToken
:
'
your.mapbox.access.token
'
}).
addTo
(
map
);
//load markers from server
var
ideasJsonArray
=
JSON
.
parse
(
'
${allIdeas}
'
);
if
(
ideasJsonArray
.
length
>
0
){
var
markerGroup
=
new
L
.
featureGroup
();
$
.
each
(
ideasJsonArray
,
function
(
index
,
value
)
{
if
(
value
.
isVisibleOnMap
){
...
...
@@ -46,7 +48,9 @@ $(document).ready(function(){
}
});
map
.
fitBounds
(
markerGroup
.
getBounds
().
pad
(
0.5
));
}
else
{
map
.
setView
([
51.312066
,
9.492901
],
12
)
}
function
getMarkerPopUp
(
id
,
title
,
description
,
link
){
return
"
<h4>
"
+
title
+
"
</h4>
"
+
"
<p>
"
+
description
+
"
</p><br>
"
+
"
<a href=
"
+
link
+
"
>Goto</a>
"
;
}
...
...
modules/MapModule/src/main/resources/META-INF/resources/view.jsp
View file @
590e11df
...
...
@@ -30,8 +30,10 @@ $(document).ready(function(){
id
:
'
mapbox.streets
'
,
accessToken
:
'
your.mapbox.access.token
'
}).
addTo
(
map
);
//load markers from server
var
ideasJsonArray
=
JSON
.
parse
(
'
${allIdeas}
'
);
if
(
ideasJsonArray
.
length
>
0
){
var
markerGroup
=
new
L
.
featureGroup
();
$
.
each
(
ideasJsonArray
,
function
(
index
,
value
)
{
if
(
value
.
isVisibleOnMap
){
...
...
@@ -46,7 +48,9 @@ $(document).ready(function(){
}
});
map
.
fitBounds
(
markerGroup
.
getBounds
().
pad
(
0.5
));
}
else
{
map
.
setView
([
51.312066
,
9.492901
],
12
)
}
function
getMarkerPopUp
(
id
,
title
,
description
,
link
){
return
"
<h4>
"
+
title
+
"
</h4>
"
+
"
<p>
"
+
description
+
"
</p><br>
"
+
"
<a href=
"
+
link
+
"
>Goto</a>
"
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment