Add ArcGIS map tile display.
This commit is contained in:
parent
f3d38a6045
commit
fdae11f7cd
2 changed files with 22 additions and 7 deletions
|
|
@ -39,12 +39,11 @@ class MapArcgisTile extends HTMLElement {
|
|||
style: "https://tiles.stadiamaps.com/styles/osm_bright.json",
|
||||
zoom: 22,
|
||||
});
|
||||
/*
|
||||
console.log("ArcGIS token", arcgis_access_token);
|
||||
const basemap_style = maplibreArcGIS.BasemapStyle.applyStyle(this._map, {
|
||||
style: "arcgis/light-gray",
|
||||
token: arcgis_access_token,
|
||||
});
|
||||
*/
|
||||
this._map.on("load", () => {
|
||||
console.log("map-arcgis-tile loaded");
|
||||
if (organization_id != 0) {
|
||||
|
|
@ -64,12 +63,12 @@ class MapArcgisTile extends HTMLElement {
|
|||
},
|
||||
});
|
||||
}
|
||||
/*
|
||||
if (arcgis_access_token != "") {
|
||||
this._map.addSource("flyover", {
|
||||
type: "raster",
|
||||
tiles: [
|
||||
"https://tiles.arcgis.com/tiles/pV7SH1EgRc6tpxlJ/arcgis/rest/services/TrimmedFlyover2025/MapServer/tile/{z}/{y}/{x}?token=" + arcgis_access_token,
|
||||
"https://tiles.arcgis.com/tiles/pV7SH1EgRc6tpxlJ/arcgis/rest/services/TrimmedFlyover2025/MapServer/tile/{z}/{y}/{x}?token=" +
|
||||
arcgis_access_token,
|
||||
],
|
||||
});
|
||||
console.log("added arcgis tile source");
|
||||
|
|
@ -80,7 +79,6 @@ class MapArcgisTile extends HTMLElement {
|
|||
});
|
||||
console.log("added arcgis tile layer");
|
||||
}
|
||||
*/
|
||||
this.dispatchEvent(new CustomEvent("load"), {
|
||||
bubbles: true,
|
||||
composed: true, // Allows event to cross shadow DOM boundary
|
||||
|
|
|
|||
|
|
@ -4,13 +4,30 @@ import (
|
|||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/background"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/models"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/html"
|
||||
nhttp "github.com/Gleipnir-Technology/nidus-sync/http"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
type contentIntelligenceRoot struct{}
|
||||
type contentIntelligenceRoot struct {
|
||||
ArcgisAccessToken string
|
||||
}
|
||||
|
||||
func getIntelligenceRoot(ctx context.Context, r *http.Request, org *models.Organization, user *models.User) (*html.Response[contentIntelligenceRoot], *nhttp.ErrorWithStatus) {
|
||||
return html.NewResponse("sync/intelligence-root.html", contentIntelligenceRoot{}), nil
|
||||
var oauth_token *models.ArcgisOauthToken
|
||||
var err error
|
||||
var access_token string
|
||||
oauth_token, err = background.GetOAuthForOrg(ctx, org)
|
||||
if err != nil {
|
||||
log.Warn().Err(err).Msg("Failed to get oauth")
|
||||
oauth_token = nil
|
||||
access_token = ""
|
||||
} else {
|
||||
access_token = oauth_token.AccessToken
|
||||
}
|
||||
return html.NewResponse("sync/intelligence-root.html", contentIntelligenceRoot{
|
||||
ArcgisAccessToken: access_token,
|
||||
}), nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue