-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
executable file
·37 lines (32 loc) · 1.3 KB
/
main.go
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
package main
import (
"osmium/internal"
"github.com/go-chi/chi/v5"
)
func main() {
osm := internal.Provider{
Url: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
Dir: internal.GetTilesPath() + "/osm",
Attribution: "© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors",
}
arcgis := internal.Provider{
Url: "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}.png",
Dir: internal.GetTilesPath() + "/arcgis",
Attribution: "Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community",
}
tilezen := internal.Provider{
Url: "https://tile.nextzen.org/tilezen/terrain/v1/256/terrarium/{z}/{x}/{y}.png",
Dir: internal.GetTilesPath() + "/tilezen",
}
lukla := internal.Provider{
Url: "http://localhost:9000/64/{z}/{x}/{y}.png",
Dir: internal.GetTilesPath() + "/lukla",
}
api := internal.HttpApi{
Router: chi.NewRouter(),
BasePath: internal.GetRootPath(),
Providers: map[string]internal.Provider{"osm": osm, "arcgis": arcgis, "tilezen": tilezen, "lukla": lukla},
AllowedOrigins: internal.GetAllowedOrigins(),
}
api.Run(internal.GetApiPort())
}