Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
FloodSimulation-Browser
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Richard Torenvliet
FloodSimulation-Browser
Commits
92977e77
Commit
92977e77
authored
May 07, 2012
by
Richard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scroll trough simulation
parent
1b251929
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
26 deletions
+99
-26
www/app/controller/Main.js
www/app/controller/Main.js
+29
-5
www/app/view/Map.js
www/app/view/Map.js
+44
-9
www/app/view/Simulation.js
www/app/view/Simulation.js
+26
-12
No files found.
www/app/controller/Main.js
View file @
92977e77
...
@@ -13,7 +13,7 @@ Ext.define('app.controller.Main', {
...
@@ -13,7 +13,7 @@ Ext.define('app.controller.Main', {
control
:
{
control
:
{
'
listpanel #cities
'
:
{
'
listpanel #cities
'
:
{
itemtap
:
'
showOverlay
'
,
itemtap
:
'
showOverlay
'
,
tap
:
'
closeoverlay
'
tap
:
'
closeoverlay
'
,
},
},
'
sliderfield
'
:
{
'
sliderfield
'
:
{
...
@@ -24,27 +24,51 @@ Ext.define('app.controller.Main', {
...
@@ -24,27 +24,51 @@ Ext.define('app.controller.Main', {
itemtap
:
'
simulation
'
,
itemtap
:
'
simulation
'
,
},
},
'
#ext-button-1
'
:
{
tap
:
'
callRemoveImages
'
},
'
#mapa
'
:
{
'
#mapa
'
:
{
maprender
:
'
setMap
'
maprender
:
'
setMap
'
},
},
'
#closebutton
'
:
{
'
#closebutton
'
:
{
tap
:
'
closeoverlay
'
tap
:
'
closeoverlay
'
},
'
#backwards
'
:
{
tap
:
'
prevImage
'
},
'
#forward
'
:
{
tap
:
'
nextImage
'
},
'
#overlay
'
:
{
hide
:
'
callRemoveImages
'
,
}
}
}
}
},
},
callRemoveImages
:
function
(){
callRemoveImages
:
function
()
{
//console.log('hide removeimages');
//this.getOverlay().hide();
},
prevImage
:
function
(){
this
.
getMapView
().
prevImage
();
},
},
callN
extImage
:
function
(){
n
extImage
:
function
(){
this
.
getMapView
().
nextImage
();
this
.
getMapView
().
nextImage
();
},
},
closeoverlay
:
function
()
{
closeoverlay
:
function
()
{
console
.
log
(
this
.
getOverlay
());
// console.log('call removeimages');
this
.
getOverlay
().
hide
();
// console.log(this.getOverlay());
// this.getMapView().removeImages();
// this.getOverlay().hide();
},
},
setMap
:
function
(
extmap
,
map
){
setMap
:
function
(
extmap
,
map
){
...
...
www/app/view/Map.js
View file @
92977e77
...
@@ -18,7 +18,7 @@ Ext.define('app.view.Map', {
...
@@ -18,7 +18,7 @@ Ext.define('app.view.Map', {
{
{
this
.
overlayImages
=
[];
this
.
overlayImages
=
[];
this
.
Images
=
[];
this
.
Images
=
[];
this
.
imageIndex
=
null
;
this
.
imageIndex
=
0
;
this
.
imageBounds
=
null
;
this
.
imageBounds
=
null
;
}
}
}
}
...
@@ -62,6 +62,7 @@ Ext.define('app.view.Map', {
...
@@ -62,6 +62,7 @@ Ext.define('app.view.Map', {
// 'http://sangkil.science.uva.nl:8003/drfsm/199419691/visualization/level/map/600.png'
// 'http://sangkil.science.uva.nl:8003/drfsm/199419691/visualization/level/map/600.png'
// 'http://sangkil.science.uva.nl:8003/drfsm/207/visualization/level/map/300.png' ;
// 'http://sangkil.science.uva.nl:8003/drfsm/207/visualization/level/map/300.png' ;
createOverlayImage
:
function
(
bounds
,
area_id
,
timesteps
)
{
createOverlayImage
:
function
(
bounds
,
area_id
,
timesteps
)
{
//console.log('createOverlayImage');
this
.
imageIndex
=
0
;
this
.
imageIndex
=
0
;
this
.
imageBounds
=
new
google
.
maps
.
LatLngBounds
(
this
.
imageBounds
=
new
google
.
maps
.
LatLngBounds
(
new
google
.
maps
.
LatLng
(
bounds
[
2
],
bounds
[
3
]),
new
google
.
maps
.
LatLng
(
bounds
[
2
],
bounds
[
3
]),
...
@@ -69,9 +70,10 @@ Ext.define('app.view.Map', {
...
@@ -69,9 +70,10 @@ Ext.define('app.view.Map', {
this
.
bounds
=
bounds
;
this
.
bounds
=
bounds
;
// delete all other images
// delete all other images
if
(
this
.
overlayImages
.
length
>
0
)
if
(
this
.
overlayImages
.
length
>
1
)
for
(
i
in
this
.
overlayImages
)
{
this
.
overlayImages
[
i
].
setMap
(
null
);
this
.
removeImages
();
}
//var image = 'http://sangkil.science.uva.nl:8003/lsm/' + area_id +'/visualization/level/map/400.png';
//var image = 'http://sangkil.science.uva.nl:8003/lsm/' + area_id +'/visualization/level/map/400.png';
for
(
i
in
timesteps
)
for
(
i
in
timesteps
)
...
@@ -88,16 +90,50 @@ Ext.define('app.view.Map', {
...
@@ -88,16 +90,50 @@ Ext.define('app.view.Map', {
nextImage
:
function
()
nextImage
:
function
()
{
{
this
.
imageIndex
+=
1
;
var
lastImagesIndex
=
this
.
imageIndex
;
this
.
overlayImages
[
this
.
imageIndex
-
1
].
setMap
(
null
);
this
.
imageIndex
+=
this
.
imageIndex
<=
this
.
Images
.
length
-
2
?
1
:
0
;
var
overlay
=
new
google
.
maps
.
GroundOverlay
(
this
.
Images
[
this
.
imageIndex
],
this
.
imageBounds
,
{
map
:
this
.
globalMap
});
console
.
log
(
this
.
imageIndex
);
this
.
overlayImages
.
push
(
overlay
);
if
(
this
.
imageIndex
!=
lastImagesIndex
)
{
if
(
this
.
imageIndex
>=
this
.
overlayImages
.
length
||
this
.
overlayImages
.
length
==
0
)
{
var
overlay
=
new
google
.
maps
.
GroundOverlay
(
this
.
Images
[
this
.
imageIndex
],
this
.
imageBounds
,
{
map
:
this
.
globalMap
});
this
.
overlayImages
.
push
(
overlay
);
console
.
log
(
this
.
overlayImages
);
console
.
log
(
"
pushed
"
+
overlay
);
}
else
{
console
.
log
(
this
.
overlayImages
);
this
.
overlayImages
[
this
.
imageIndex
].
setMap
(
this
.
globalMap
);
}
this
.
overlayImages
[
this
.
imageIndex
-
1
].
setMap
(
null
);
}
},
prevImage
:
function
()
{
console
.
log
(
this
.
overlayImages
);
console
.
log
(
this
.
overlayImages
[
this
.
imageIndex
]);
console
.
log
(
this
.
imageIndex
);
this
.
overlayImages
[
this
.
imageIndex
].
setMap
(
null
);
console
.
log
(
'
removed
'
);
this
.
imageIndex
-=
this
.
imageIndex
>
0
?
1
:
0
;
if
(
this
.
imageIndex
>=
0
)
{
this
.
overlayImages
[
this
.
imageIndex
].
setMap
(
this
.
globalMap
);
console
.
log
(
this
.
overlayImages
[
this
.
imageIndex
]);
}
},
},
removeImages
:
function
()
removeImages
:
function
()
{
{
console
.
log
(
'
removedImages
'
);
for
(
i
in
this
.
overlayImages
)
for
(
i
in
this
.
overlayImages
)
this
.
overlayImages
[
i
].
setMap
(
null
);
this
.
overlayImages
[
i
].
setMap
(
null
);
this
.
imageIndex
=
0
;
this
.
overlayImages
=
[];
this
.
Images
=
[];
},
},
createOverlayPolygon
:
function
(
corners
){
createOverlayPolygon
:
function
(
corners
){
...
@@ -105,7 +141,6 @@ Ext.define('app.view.Map', {
...
@@ -105,7 +141,6 @@ Ext.define('app.view.Map', {
for
(
var
i
=
0
;
i
<
corners
[
0
].
length
-
1
;
i
++
)
{
for
(
var
i
=
0
;
i
<
corners
[
0
].
length
-
1
;
i
++
)
{
cornerBounds
.
push
(
new
google
.
maps
.
LatLng
(
corners
[
0
][
i
][
0
],
corners
[
0
][
i
][
1
]));
cornerBounds
.
push
(
new
google
.
maps
.
LatLng
(
corners
[
0
][
i
][
0
],
corners
[
0
][
i
][
1
]));
}
}
console
.
log
(
cornerBounds
);
var
rectangle
=
new
google
.
maps
.
Polygon
({
var
rectangle
=
new
google
.
maps
.
Polygon
({
paths
:
cornerBounds
,
paths
:
cornerBounds
,
...
...
www/app/view/Simulation.js
View file @
92977e77
...
@@ -18,29 +18,43 @@ Ext.define('app.view.Simulation', {
...
@@ -18,29 +18,43 @@ Ext.define('app.view.Simulation', {
width
:
300
,
width
:
300
,
height
:
80
,
height
:
80
,
scroll
:
false
,
scroll
:
false
,
items
:
[{
items
:
[
{
xtype
:
'
button
'
,
xtype
:
'
button
'
,
id
:
'
closebutton
'
,
id
:
'
closebutton
'
,
iconCls
:
'
delete
'
,
iconCls
:
'
delete
'
,
iconMask
:
true
,
iconMask
:
true
,
width
:
45
,
width
:
45
,
bottom
:
-
30
,
bottom
:
-
30
,
right
:
-
20
,
right
:
-
20
,
},
},
{
{
xtype
:
'
segmentedbutton
'
,
layout
:
'
vbox
'
,
items
:
[
top
:
15
,
align
:
'
center
'
,
items
:
[
{
{
text
:
'
back
'
xtype
:
"
button
"
,
id
:
'
backwards
'
,
width
:
45
,
iconCls
:
'
arrow_left
'
,
floating
:
'
right
'
,
iconMask
:
true
,
left
:
90
,
align
:
'
center
'
,
},
},
{
{
text
:
'
forward
'
xtype
:
"
button
"
,
}
id
:
'
forward
'
,
width
:
45
,
]
floating
:
'
left
'
,
iconCls
:
'
arrow_right
'
,
align
:
'
center
'
,
left
:
155
,
iconMask
:
true
,
}]
}],
}],
}]
,
}]
},
},
});
});
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