Add URL for Tegola to configuration
Avoid cross-environment pollution.
This commit is contained in:
parent
21a8f9622a
commit
4f0b73c769
3 changed files with 15 additions and 5 deletions
|
|
@ -7,7 +7,7 @@ import (
|
|||
"strconv"
|
||||
)
|
||||
|
||||
var Bind, ClientID, ClientSecret, Environment, FieldseekerSchemaDirectory, MapboxToken, PGDSN, URLReport, URLSync, FilesDirectoryPublic, FilesDirectoryUser string
|
||||
var Bind, ClientID, ClientSecret, Environment, FilesDirectoryPublic, FilesDirectoryUser, FieldseekerSchemaDirectory, MapboxToken, PGDSN, URLReport, URLSync, URLTegola string
|
||||
|
||||
// Build the ArcGIS authorization URL with PKCE
|
||||
func BuildArcGISAuthURL(clientID string) string {
|
||||
|
|
@ -59,6 +59,10 @@ func Parse() error {
|
|||
if URLSync == "" {
|
||||
return fmt.Errorf("You must specify a non-empty URL_SYNC")
|
||||
}
|
||||
URLTegola = os.Getenv("URL_TEGOLA")
|
||||
if URLTegola == "" {
|
||||
return fmt.Errorf("You must specify a non-empty URL_TEGOLA")
|
||||
}
|
||||
Bind = os.Getenv("BIND")
|
||||
if Bind == "" {
|
||||
Bind = ":9001"
|
||||
|
|
|
|||
|
|
@ -29,7 +29,12 @@ var (
|
|||
sourceT = buildTemplate("source", "authenticated")
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
URLTegola string
|
||||
}
|
||||
|
||||
type ContextDashboard struct {
|
||||
Config Config
|
||||
CountInspections int
|
||||
CountMosquitoSources int
|
||||
CountServiceRequests int
|
||||
|
|
@ -233,6 +238,9 @@ func dashboard(ctx context.Context, w http.ResponseWriter, user *models.User) {
|
|||
return
|
||||
}
|
||||
data := ContextDashboard{
|
||||
Config: Config{
|
||||
URLTegola: config.URLTegola,
|
||||
},
|
||||
CountInspections: int(inspectionCount),
|
||||
CountMosquitoSources: int(sourceCount),
|
||||
CountServiceRequests: int(serviceCount),
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@ function onLoad() {
|
|||
map.addSource('tegola-bonn', {
|
||||
'type': 'vector',
|
||||
'tiles': [
|
||||
//'https://tiles.mapillary.com/maps/vtp/mly1_public/2/{z}/{x}/{y}?access_token=MLY|4142433049200173|72206abe5035850d6743b23a49c41333'
|
||||
'https://tegola.nidus.cloud/maps/bonn/{z}/{x}/{y}'
|
||||
'https://{{.Config.URLTegola}}/maps/bonn/{z}/{x}/{y}'
|
||||
]
|
||||
//'minzoom': 6,
|
||||
//'maxzoom': 14
|
||||
|
|
@ -29,8 +28,7 @@ function onLoad() {
|
|||
map.addSource('tegola-nidus', {
|
||||
'type': 'vector',
|
||||
'tiles': [
|
||||
//'https://tiles.mapillary.com/maps/vtp/mly1_public/2/{z}/{x}/{y}?access_token=MLY|4142433049200173|72206abe5035850d6743b23a49c41333'
|
||||
'https://tegola.nidus.cloud/maps/nidus/{z}/{x}/{y}?organization_id=1'
|
||||
'https://{{.Config.URLTegola}}/maps/nidus/{z}/{x}/{y}?organization_id={{.User.OrganizationID}}'
|
||||
]
|
||||
//'minzoom': 6,
|
||||
//'maxzoom': 14
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue