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
Genesys PGR
Genesys Backend
Commits
c407e098
Commit
c407e098
authored
Nov 18, 2013
by
Matija Obreza
Browse files
Google Maps: i18n, no streetView
parent
32572456
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/webapp/WEB-INF/jsp/accession/details.jsp
View file @
c407e098
...
...
@@ -160,6 +160,7 @@
<c:if
test=
"
${
accessionEnvironment
.
latitude
ne
null
}
"
>
<tr>
<td
colspan=
"2"
>
<h4><spring:message
code=
"accession.collecting.site"
/></h4>
<div
id=
"accessionMap"
style=
"width: 100%; height: 300px"
>
Loading Google Maps...
</div>
</td>
</tr>
...
...
@@ -244,7 +245,7 @@
<c:if
test=
"
${
accessionEnvironment
ne
null
and
accessionEnvironment
.
latitude
ne
null
}
"
>
<script
type=
"text/javascript"
>
jQuery
(
document
).
ready
(
function
()
{
var
accessionMap
=
GoogleMaps
.
map
(
$
(
"
#accessionMap
"
),
{
center
:
new
GoogleMaps
.
LatLng
(
$
{
accessionEnvironment
.
latitude
},
$
{
accessionEnvironment
.
longitude
}),
markerTitle
:
"
<spring:escapeBody
javaScriptEscape=
"true"
>
${accession.accessionName}, ${accession.instituteCode}
</spring:escapeBody>
"
});
var
accessionMap
=
GoogleMaps
.
map
(
"
${pageContext.response.locale.language}
"
,
$
(
"
#accessionMap
"
),
{
center
:
new
GoogleMaps
.
LatLng
(
$
{
accessionEnvironment
.
latitude
},
$
{
accessionEnvironment
.
longitude
}),
markerTitle
:
"
<spring:escapeBody
javaScriptEscape=
"true"
>
${accession.accessionName}, ${accession.instituteCode}
</spring:escapeBody>
"
});
});
</script>
</c:if>
...
...
src/main/webapp/html/js/crophub.js
View file @
c407e098
...
...
@@ -30,15 +30,17 @@ GoogleMaps = {
defaultOptions
:
{
zoom
:
5
,
center
:
new
GoogleMaps
.
LatLng
(
0
,
0
),
mapTypeId
:
"
terrain
"
mapTypeId
:
"
terrain
"
,
streetViewControl
:
false
},
map
:
function
(
doms
,
mapOptions
)
{
map
:
function
(
language
,
doms
,
mapOptions
)
{
var
mapOpt
=
{
zoom
:
mapOptions
.
zoom
||
this
.
defaultOptions
.
zoom
,
center
:
mapOptions
.
center
||
this
.
defaultOptions
.
center
,
mapTypeId
:
mapOptions
.
mapTypeId
||
this
.
defaultOptions
.
mapTypeId
,
markerTitle
:
mapOptions
.
markerTitle
||
null
markerTitle
:
mapOptions
.
markerTitle
||
null
,
streetViewControl
:
mapOptions
.
streetViewControl
||
this
.
defaultOptions
.
streetViewControl
};
doms
.
each
(
function
(
idx
,
el
)
{
if
(
$
.
inArray
(
el
,
this
.
loadedMaps
)
<
0
)
{
...
...
@@ -47,15 +49,15 @@ GoogleMaps = {
}
});
this
.
loadGoogleMaps
();
this
.
loadGoogleMaps
(
language
);
},
loadGoogleMaps
:
function
()
{
loadGoogleMaps
:
function
(
language
)
{
if
(
!
this
.
loaded
)
{
this
.
loaded
=
true
;
var
script
=
document
.
createElement
(
'
script
'
);
script
.
type
=
'
text/javascript
'
;
script
.
src
=
'
https://maps.googleapis.com/maps/api/js?
v=3.exp
&sensor=false&&callback=GoogleMaps.onLoad
'
;
script
.
src
=
'
https://maps.googleapis.com/maps/api/js?
language=
'
+
language
+
'
&v=3
&sensor=false&&callback=GoogleMaps.onLoad
'
;
document
.
body
.
appendChild
(
script
);
}
else
{
this
.
onLoad
();
...
...
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