File tree 5 files changed +11
-13
lines changed
5 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Repository for 'Fachpraktikum Algorithms on OpenStreetMap data' at University St
4
4
# Instructions
5
5
### Install Golang
6
6
At first, you have to install golang on your System.<br >
7
- Version 1.18 is recommend .<br >
7
+ Version 1.18 is recommended .<br >
8
8
For ubuntu you can follow [ this] ( https://cmatskas.com/install-go-on-wsl-ubuntu-from-the-command-line/ ) blog post.
9
9
### Generate FMI file from PBF file
10
10
1. Navigate into the project folder, so that you are in the directory OSM.
@@ -15,11 +15,11 @@ For ubuntu you can follow [this](https://cmatskas.com/install-go-on-wsl-ubuntu-f
15
15
### Run Webserver
16
16
1. Navigate into the project folder, so that you are in the directory OSM.
17
17
2. Build the project with command: go build ./src/mainWeb.go
18
- 3. Ron project with command: ./mainWeb {pathToFmiFile} {port}
19
- 4. The GUI can be found at localhost/{port}
18
+ 3. Ron project with command: ./mainWeb {pathToFmiFile}
19
+ 4. The GUI can be found at localhost/8081
20
20
21
21
### How to use GUI
22
- - In your browser navigate to localhost/{port}
22
+ - In your browser navigate to localhost/8081
23
23
- To set a starting point just click anywhere on the map
24
24
- To create a ending point click anywhere on the map
25
25
- Both points will snap to the closest point in water that was created in Task 3
Original file line number Diff line number Diff line change 7
7
8
8
func main () {
9
9
pathToFmi := os .Args [1 ]
10
- port := os .Args [2 ]
11
- web .Main (pathToFmi , port )
10
+ web .Main (pathToFmi )
12
11
}
Original file line number Diff line number Diff line change @@ -4,23 +4,22 @@ import (
4
4
"OSM/src/backend/datastructures"
5
5
helpers2 "OSM/src/backend/helpers"
6
6
"OSM/src/backend/shortestPath"
7
- "fmt"
8
7
"log"
9
8
"math"
10
9
"net/http"
11
10
"strconv"
12
11
)
13
12
14
- func Main (pathToFmiFile string , port string ) {
13
+ func Main (pathToFmiFile string ) {
15
14
graph := helpers2 .CreateGraphFromFile (pathToFmiFile )
16
15
17
16
fileServer := http .FileServer (http .Dir ("./src/web/static" ))
18
17
http .Handle ("/" , fileServer )
19
18
http .HandleFunc ("/route" , routeHandler (graph ))
20
19
http .HandleFunc ("/point" , pointHandler (graph ))
21
20
22
- log .Printf ("Starting server at port %s \n " , port )
23
- if err := http .ListenAndServe (fmt . Sprintf ( ":%s" , port ) , nil ); err != nil {
21
+ log .Printf ("Starting server at port 8081 \n " )
22
+ if err := http .ListenAndServe (":8081" , nil ); err != nil {
24
23
log .Fatal (err )
25
24
}
26
25
}
Original file line number Diff line number Diff line change 14
14
15
15
< body >
16
16
< div id ="map "> </ div >
17
- < script src ="main.js "> </ script >
17
+ < script src ="./ main.js "> </ script >
18
18
19
19
</ body >
20
20
</ html >
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ function fetchPoint(point, isStart) {
102
102
lat : point . getLatLng ( ) . lat , lng : point . getLatLng ( ) . lng
103
103
} ;
104
104
//build URL
105
- let url = new URL ( "http://localhost:8080 /point" ) ;
105
+ let url = new URL ( "http://localhost:8081 /point" ) ;
106
106
for ( let k in data ) {
107
107
url . searchParams . append ( k , data [ k ] ) ;
108
108
}
@@ -147,7 +147,7 @@ function fetchRoute() {
147
147
} ;
148
148
149
149
// build URL
150
- let url = new URL ( "http://localhost:8080 /route" ) ;
150
+ let url = new URL ( "http://localhost:8081 /route" ) ;
151
151
for ( let k in data ) {
152
152
url . searchParams . append ( k , data [ k ] ) ;
153
153
}
You can’t perform that action at this time.
0 commit comments