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
be7c95c3
Commit
be7c95c3
authored
Apr 25, 2012
by
Richard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
worked on flood browser, dikes polygons are showing
parent
c2aef539
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
21 deletions
+78
-21
www/app.js
www/app.js
+2
-2
www/app/controller/Main.js
www/app/controller/Main.js
+36
-9
www/app/store/SimulationDetailsStore.js
www/app/store/SimulationDetailsStore.js
+30
-0
www/app/view/List.js
www/app/view/List.js
+1
-1
www/app/view/Map.js
www/app/view/Map.js
+9
-9
No files found.
www/app.js
View file @
be7c95c3
...
@@ -6,8 +6,8 @@ Ext.Loader.setPath({
...
@@ -6,8 +6,8 @@ Ext.Loader.setPath({
Ext
.
application
({
Ext
.
application
({
controllers
:
[
"
Main
"
],
controllers
:
[
"
Main
"
],
models
:
[
"
SimulationModel
"
,
'
SimulationDetails
'
],
models
:
[
"
SimulationModel
"
,
"
SimulationDetails
"
],
stores
:
[
'
SimulationStore
'
,
'
Image
sStore
'
],
stores
:
[
'
SimulationStore
'
,
'
SimulationDetail
sStore
'
],
name
:
'
app
'
,
name
:
'
app
'
,
...
...
www/app/controller/Main.js
View file @
be7c95c3
...
@@ -20,21 +20,48 @@ Ext.define('app.controller.Main', {
...
@@ -20,21 +20,48 @@ Ext.define('app.controller.Main', {
setMap
:
function
(
extmap
,
map
){
setMap
:
function
(
extmap
,
map
){
this
.
globalMap
=
map
;
this
.
globalMap
=
map
;
this
.
getMapView
().
setGlobalMap
(
extmap
,
map
);
this
.
getMapView
().
setGlobalMap
(
extmap
,
map
);
var
traffic
=
new
google
.
maps
.
TrafficLayer
();
//
var traffic = new google.maps.TrafficLayer();
traffic
.
setMap
(
map
);
//
traffic.setMap(map);
},
},
showOverlay
:
function
(
list
,
index
,
element
,
record
)
{
showOverlay
:
function
(
list
,
index
,
element
,
record
)
{
var
store
=
Ext
.
getStore
(
'
ImagesStore
'
);
//var area_id = record.get('area_id');
store
.
setUrl
(
record
.
get
(
'
area_id
'
));
var
store
=
Ext
.
getStore
(
'
SimulationDetailsStore
'
);
store
.
load
();
var
area_id
=
record
.
get
(
'
area_id
'
);
var
map
=
this
.
getMapView
();
var
dikes
=
null
;
//store.setUrl(record.get('area_id'));
//console.log(store.getData().getCount());
//console.log(store.getData().getAt(0).get('dikes'));
//var dikes = store.getData().getAt(0).get('dikes');
var
bounds
=
record
.
get
(
'
visbounds
'
);
var
bounds
=
record
.
get
(
'
visbounds
'
);
var
center
=
record
.
get
(
'
center
'
);
var
center
=
record
.
get
(
'
center
'
);
var
corners
=
record
.
get
(
'
corners
'
);
var
corners
=
record
.
get
(
'
corners
'
);
var
request
=
Ext
.
Ajax
.
request
({
method
:
'
GET
'
,
url
:
'
http://sangkil.science.uva.nl:8003/area/
'
+
area_id
+
'
/info.json
'
,
success
:
function
(
response
,
opts
){
console
.
log
(
response
);
var
result
=
Ext
.
decode
(
response
.
responseText
);
console
.
log
(
this
);
if
(
result
[
'
dikes
'
].
length
>
0
)
map
.
createOverlayPolygon
(
result
[
'
dikes
'
]);
},
});
//var result = Ext.decode(request.responseText);
// console.log(result);
//if (result['dikes'].length > 0)
// this.getMapView().createOverlayPolygon(result['dikes']);
this
.
getMapView
().
createMarker
();
//this.getMapView().createOverlayImage(bounds);
this
.
getMapView
().
setCenterMap
(
center
);
this
.
getMapView
().
setCenterMap
(
center
);
this
.
getMapView
().
createOverlayImage
(
bounds
);
this
.
getMapView
().
createOverlayPolygon
(
corners
);
},
},
callMapPolygon
:
function
(
polygon
)
{
this
.
getMapView
().
createOverlayPolygon
(
polygon
);
}
});
});
\ No newline at end of file
www/app/store/
Image
sStore.js
→
www/app/store/
SimulationDetail
sStore.js
View file @
be7c95c3
Ext
.
define
(
'
app.store.
Image
sStore
'
,
{
Ext
.
define
(
'
app.store.
SimulationDetail
sStore
'
,
{
extend
:
'
Ext.data.Store
'
,
extend
:
'
Ext.data.Store
'
,
requires
:
[
'
Ext.data.proxy.Rest
'
],
requires
:
[
'
Ext.data.proxy.Rest
'
],
xtype
:
'
Image
sStore
'
,
xtype
:
'
SimulationDetail
sStore
'
,
config
:
{
config
:
{
model
:
'
app.model.SimulationDetails
'
,
model
:
'
app.model.SimulationDetails
'
,
fields
:
[
'
name
'
,
'
c
orners
'
,
'
visbounds
'
,
'
area_id
'
,
'
center
'
],
fields
:
[
'
name
'
,
'
c
enter
'
,
'
corners
'
,
'
size
'
,
'
extents
'
,
'
visbounds
'
,
'
vissize
'
,
'
projection
'
,
'
dikes
'
],
proxy
:
{
proxy
:
{
type
:
'
rest
'
,
type
:
'
rest
'
,
url
:
'
http://sangkil.science.uva.nl:8003/area/
'
,
url
:
'
http://sangkil.science.uva.nl:8003/area/
'
,
reader
:
{
reader
:
{
type
:
'
json
'
,
type
:
'
json
'
,
},
},
callback
:
function
(
response
)
{
console
.
log
(
response
.
responseText
);
}
},
listeners
:
{
beforeload
:
function
(
store
){
console
.
log
(
store
);
}
}
}
},
},
setUrl
:
function
(
area_id
)
{
setUrl
:
function
(
area_id
)
{
var
store
=
Ext
.
getStore
(
'
Image
sStore
'
).
getProxy
();
var
store
=
Ext
.
getStore
(
'
SimulationDetail
sStore
'
).
getProxy
();
store
.
_url
=
'
http://sangkil.science.uva.nl:8003/area/
'
+
area_id
+
'
/info.json
'
;
store
.
_url
=
'
http://sangkil.science.uva.nl:8003/area/
'
+
area_id
+
'
/info.json
'
;
}
}
});
});
\ No newline at end of file
www/app/view/List.js
View file @
be7c95c3
...
@@ -11,7 +11,7 @@ Ext.define("app.view.List",
...
@@ -11,7 +11,7 @@ Ext.define("app.view.List",
'
Ext.data.Store
'
,
'
Ext.dataview.List
'
,
'
Ext.Map
'
'
Ext.data.Store
'
,
'
Ext.dataview.List
'
,
'
Ext.Map
'
],
],
stores
:
[
'
SimulationStore
'
],
//
stores: ['SimulationStore'],
config
:
{
config
:
{
layout
:
"
vbox
"
,
layout
:
"
vbox
"
,
...
...
www/app/view/Map.js
View file @
be7c95c3
...
@@ -30,8 +30,8 @@ Ext.define('app.view.Map', {
...
@@ -30,8 +30,8 @@ Ext.define('app.view.Map', {
this
.
globalExtMap
.
setMapOptions
(
options
);
this
.
globalExtMap
.
setMapOptions
(
options
);
},
},
createMarker
:
function
(
pos
ition
){
createMarker
:
function
(
pos
){
var
pos
=
new
google
.
maps
.
LatLng
(
52.3700
,
4.89000
);
var
pos
=
new
google
.
maps
.
LatLng
(
52.3700
,
4.89000
);
new
google
.
maps
.
Marker
({
new
google
.
maps
.
Marker
({
position
:
pos
,
position
:
pos
,
icon
:
'
Google_Maps_Marker.png
'
,
icon
:
'
Google_Maps_Marker.png
'
,
...
@@ -51,14 +51,14 @@ Ext.define('app.view.Map', {
...
@@ -51,14 +51,14 @@ Ext.define('app.view.Map', {
createOverlayPolygon
:
function
(
corners
){
createOverlayPolygon
:
function
(
corners
){
var
cornerBounds
=
[];
var
cornerBounds
=
[];
for
(
i
in
corners
)
{
console
.
log
(
corners
);
console
.
log
(
corners
[
i
][
0
],
corners
[
i
][
1
]);
console
.
log
(
corners
[
0
].
length
);
cornerBounds
.
push
(
new
google
.
maps
.
LatLng
(
corners
[
i
][
0
],
corners
[
i
][
1
]));
for
(
var
i
=
0
;
i
<
corners
[
0
].
length
-
1
;
i
++
)
{
}
new
google
.
maps
.
LatLng
(
corners
[
1
][
0
],
corners
[
1
][
1
]),
console
.
log
(
"
i:
"
+
i
+
corners
[
0
][
i
][
0
]
+
"
-
"
+
corners
[
0
][
i
][
1
]);
new
google
.
maps
.
LatLng
(
corners
[
2
][
0
],
corners
[
2
][
1
]),
cornerBounds
.
push
(
new
google
.
maps
.
LatLng
(
corners
[
0
][
i
][
0
],
corners
[
0
][
i
][
1
]));
new
google
.
maps
.
LatLng
(
corners
[
3
][
0
],
corners
[
3
][
1
])
}
console
.
log
(
cornerBounds
);
var
rectangle
=
new
google
.
maps
.
Polygon
({
var
rectangle
=
new
google
.
maps
.
Polygon
({
paths
:
cornerBounds
,
paths
:
cornerBounds
,
...
...
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