-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathhellogeo.html
More file actions
54 lines (45 loc) · 1.47 KB
/
Copy pathhellogeo.html
File metadata and controls
54 lines (45 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<html>
<head>
<title>Geo Hello</title>
</head>
<body>
<script type="module">
import * as util from '../src/utils.js'
import * as gis from '../src/gis.js'
import GeoWorld from '../src/GeoWorld.js'
import Model from '../models/HelloModel.js'
import Animator from '../src/Animator.js'
import MapDraw from '../src/MapDraw.js'
import leafletInit from './leafletInit.js'
const world = new GeoWorld({ bbox: gis.santaFeBBox, patchesWidth: 100 })
const model = new Model(world)
await model.startup()
model.setup()
const drawOptions = {
// patchesColor: 'transparent', // default in MapDraw
turtlesSize: 2,
linksWidth: 0.2,
}
const view = new MapDraw(model, {
// div: util.createCanvas(0, 0), // default & the view will resize
patchSize: 5,
drawOptions,
})
// const params = await view.leafletInit({
const params = await leafletInit(model, view.canvas, {
Z: 11,
elevationOpacity: 0.5, // set to 0 for no elevation tile layer
})
const anim = new Animator(
() => {
model.step()
view.draw()
},
500, // run 500 steps
30 // 30 fps
).startStats()
util.toWindow({ util, model, view, anim, gis, params })
</script>
<div id="map"></div>
</body>
</html>