Hello everyone. I am attempting to create a mapping application using CesiumJS with react through the Resium library. I am wanting to display the FAA VFR Sectional Charts located here: https://faa.maps.arcgis.com/home/item.html?id=6ab79dc5de5743adb3e3b6e3c803aa59
I'm am fairly new to Cesium/Resium. I have been reading the ArcGis/CesiumJS docs located here for loading map tiles: https://developers.arcgis.com/cesiumjs/layers/add-map-tiles/ Which of course just uses base CesiumJS. I have verified that my access tokens are correct and not null or anything. My arcgis developer token has all the available permissions that I could set. I've tried using the map tile URL for the santa monica parcels here as well: https://developers.arcgis.com/cesiumjs/layers/ and still get a 404 error. I am passing my access token as you can see, and there was 1 arcgis URL that I found that I COULD get tiles to load for. is there some kind of permissions thing I need to setup for to access those FAA tiles? It says they are public? I'm new to all this so there's gotta be something I'm missing to correctly connect to get these tiles. Thanks for any help you can provide.
import { ArcGisMapServerImageryProvider, ArcGisMapService, ImageryLayer, Ion } from 'cesium';
import { useEffect, useState } from "react";
import { Viewer } from "resium";
function App() {
const arcGisApiKey = import.meta.env.VITE_ARCGIS_API_KEY;
const cesiumAccessToken = import.meta.env.VITE_CESIUM_API_KEY;
Ion.defaultAccessToken = cesiumAccessToken;
ArcGisMapService.defaultAccessToken = arcGisApiKey;
Ion.defaultAccessToken = cesiumAccessToken;
ArcGisMapService.defaultAccessToken = arcGisApiKey;
const [vfrImagery, setVfrImagery] = useState<ImageryLayer | undefined>(undefined);
useEffect(() => {
async function loadImagery() {
try {
const vfrImageryProvider = await ArcGisMapServerImageryProvider.fromUrl(
"https://tiles.arcgis.com/tiles/ssFJjBXIUyZDrSYZ/arcgis/rest/services/VFR_Sectional/MapServer"
);
const vfrImageryLayer = new ImageryLayer(vfrImageryProvider);
setVfrImagery(vfrImageryLayer);
} catch (error) {
console.error("Error loading imagery providers:", error);
}
}
loadImagery();
}, [arcGisApiKey]);
return (
<Viewer
baseLayer={vfrImagery}
timeline={false}
animation={false}
geocoder={false}
>
</Viewer>
);
}
export default App;