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
plugins
vizAR
Commits
84313101
Commit
84313101
authored
Dec 05, 2018
by
ambak
Browse files
Update plugin.js, add info about zoom
parent
358e902f
Pipeline
#7748
passed with stage
in 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/js/plugin.js
View file @
84313101
...
...
@@ -3,6 +3,7 @@ minervaDefine(function () {
register
:
function
(
minervaObject
)
{
minervaObject
.
element
.
innerHTML
=
"
<div>
"
+
"
<label>Map: </label><input id='model-id'/><br/>
"
+
"
<label>Zoom: </label><input id='zoom'/></br>
"
+
"
<label>P1: </label><input id='left-top-corner'/><br/>
"
+
"
<label>P2: </label2><input id='right-bottom-corner'/><br/>
"
+
"
<label>Dialog content pos: </label><input id='dialog-left-top-corner'/><br/>
"
+
...
...
@@ -14,9 +15,13 @@ minervaDefine(function () {
//listeners for bounds change
var
persistBoundsData
=
function
(
modelId
)
{
var
bounds
=
minervaObject
.
project
.
map
.
getBounds
({
modelId
:
modelId
});
var
zoom
=
minervaObject
.
project
.
map
.
getZoom
({
modelId
:
modelId
});
$
(
"
#left-top-corner
"
,
minervaObject
.
element
).
val
(
Math
.
round
(
bounds
.
getTopLeft
().
x
)
+
"
;
"
+
Math
.
round
(
bounds
.
getTopLeft
().
y
));
$
(
"
#right-bottom-corner
"
,
minervaObject
.
element
).
val
(
Math
.
round
(
bounds
.
getRightBottom
().
x
)
+
"
;
"
+
Math
.
round
(
bounds
.
getRightBottom
().
y
));
return
minervaObject
.
pluginData
.
setUserParam
(
"
bounds-
"
+
modelId
,
Math
.
round
(
bounds
.
getTopLeft
().
x
)
+
"
;
"
+
Math
.
round
(
bounds
.
getTopLeft
().
y
)
+
"
"
+
Math
.
round
(
bounds
.
getRightBottom
().
x
)
+
"
;
"
+
Math
.
round
(
bounds
.
getRightBottom
().
y
))
$
(
"
#zoom
"
,
minervaObject
.
element
).
val
(
Math
.
round
(
zoom
));
return
minervaObject
.
pluginData
.
setUserParam
(
"
bounds-
"
+
modelId
,
Math
.
round
(
bounds
.
getTopLeft
().
x
)
+
"
;
"
+
Math
.
round
(
bounds
.
getTopLeft
().
y
)
+
"
"
+
Math
.
round
(
bounds
.
getRightBottom
().
x
)
+
"
;
"
+
Math
.
round
(
bounds
.
getRightBottom
().
y
)).
then
(
function
()
{
return
minervaObject
.
pluginData
.
setUserParam
(
"
zoom-
"
+
modelId
,
Math
.
round
(
zoom
));
});
};
//listener for dialog position/size change
...
...
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