Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
63d77256
Commit
63d77256
authored
Nov 14, 2016
by
Piotr Gawron
Browse files
debug funcitons refactorized
parent
0a4967cc
Changes
6
Hide whitespace changes
Inline
Side-by-side
frontend-js/.jshintrc
View file @
63d77256
...
...
@@ -78,7 +78,10 @@
"_searchMissingConnections" : false,
"_updateCommentList" : false,
/* JSF objects */
"_tabViewVar" : false,
"_overviewDialog" : false,
/* jQuery */
"$" : false,
...
...
frontend-js/src/main/js/map/.CustomMap.js.un~
deleted
100644 → 0
View file @
0a4967cc
File deleted
frontend-js/src/main/js/map/AbstractCustomMap.js
View file @
63d77256
...
...
@@ -96,6 +96,8 @@ function AbstractCustomMap(options) {
this
.
_bigLogo
=
options
.
isBigLogo
();
this
.
_customTouchInterface
=
options
.
isCustomTouchInterface
();
this
.
setDebug
(
options
.
isDebug
());
}
// define super constructor
...
...
frontend-js/src/main/js/map/CustomMap.js
View file @
63d77256
...
...
@@ -892,23 +892,8 @@ CustomMap.prototype.showOverview = function(overviewImageId) {
canvas
.
onclick
=
onclickevent
;
// in debug mode draw clickable shapes
if
(
DEBUG_ON
)
{
var
ctx
=
canvas
.
getContext
(
"
2d
"
);
// clear canvas
ctx
.
clearRect
(
0
,
0
,
canvas
.
width
,
canvas
.
height
);
for
(
var
i
=
0
;
i
<
this
.
overviewImage
.
links
.
length
;
i
++
)
{
ctx
.
beginPath
();
var
polygon
=
this
.
overviewImage
.
links
[
i
].
polygon
;
for
(
var
j
=
0
;
j
<
polygon
.
length
;
j
++
)
{
var
x
=
polygon
[
j
].
x
*
ratio
;
var
y
=
polygon
[
j
].
y
*
ratio
;
ctx
.
moveTo
(
x
,
y
);
x
=
polygon
[(
j
+
1
)
%
polygon
.
length
].
x
*
ratio
;
y
=
polygon
[(
j
+
1
)
%
polygon
.
length
].
y
*
ratio
;
ctx
.
lineTo
(
x
,
y
);
}
ctx
.
stroke
();
}
if
(
this
.
isDebug
())
{
this
.
drawClickableShapes
(
canvas
,
ratio
);
}
this
.
overviewImage
.
mousePos
=
{
...
...
@@ -961,6 +946,25 @@ CustomMap.prototype.showOverview = function(overviewImageId) {
}
};
CustomMap
.
prototype
.
drawClickableShapes
=
function
(
canvas
,
ratio
)
{
var
ctx
=
canvas
.
getContext
(
"
2d
"
);
// clear canvas
ctx
.
clearRect
(
0
,
0
,
canvas
.
width
,
canvas
.
height
);
for
(
var
i
=
0
;
i
<
this
.
overviewImage
.
links
.
length
;
i
++
)
{
ctx
.
beginPath
();
var
polygon
=
this
.
overviewImage
.
links
[
i
].
polygon
;
for
(
var
j
=
0
;
j
<
polygon
.
length
;
j
++
)
{
var
x
=
polygon
[
j
].
x
*
ratio
;
var
y
=
polygon
[
j
].
y
*
ratio
;
ctx
.
moveTo
(
x
,
y
);
x
=
polygon
[(
j
+
1
)
%
polygon
.
length
].
x
*
ratio
;
y
=
polygon
[(
j
+
1
)
%
polygon
.
length
].
y
*
ratio
;
ctx
.
lineTo
(
x
,
y
);
}
ctx
.
stroke
();
}
};
CustomMap
.
prototype
.
showModel
=
function
(
id
,
point
,
zoomLevel
)
{
if
(
point
!==
undefined
)
{
this
.
setCenter
(
id
,
point
);
...
...
frontend-js/src/main/js/minerva.js
View file @
63d77256
...
...
@@ -29,7 +29,11 @@ function create(params) {
if
(
global
.
GuiConnector
===
undefined
)
{
global
.
GuiConnector
=
OriginalGuiConnector
;
global
.
ServerConnector
=
OriginalServerConnector
;
logger
.
setLevel
(
"
info
"
);
if
(
params
.
debug
)
{
logger
.
setLevel
(
"
debug
"
);
}
else
{
logger
.
setLevel
(
"
info
"
);
}
}
else
{
logger
.
warn
(
"
global GuiConnector found
"
);
}
...
...
@@ -49,14 +53,14 @@ function create(params) {
logger
.
warn
(
message
);
}
}
processUrlGetParams
(
params
.
configuration
);
var
result
=
new
CustomMap
(
params
);
ServerConnector
.
setCustomMap
(
result
);
GuiConnector
.
setCustomMap
(
result
);
GuiConnector
.
showGoogleMap
();
if
(
params
.
dataCollections
!==
undefined
)
{
...
...
web/src/main/webapp/index.xhtml
View file @
63d77256
...
...
@@ -27,8 +27,6 @@
<
script
type
=
"
text/javascript
"
>
//
<!
[
CDATA
[
var
DEBUG_ON
=
false
;
function
initMap
(){
var
configuration
=
new
minerva
.
Configuration
(
document
.
getElementById
(
'
configurationForm:configurationGson
'
).
value
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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