This sample demonstrates how the geometries of client side features, whether added as graphics to the Map component or as a GeoJSONLayer, are automatically projected using the client-side projection module.
The map component's spatial
is switched on the fly to a projected spatial reference selected by the user.
// Reproject the data to the projection selected by the user
const wkidSelect = document.getElementById("projectWKID");
wkidSelect.addEventListener("calciteSelectChange", (event) => {
arcgisMap.closePopup();
arcgisMap.spatialReference = new SpatialReference({
wkid: Number(wkidSelect.value)
});
document.getElementById("mapSRDiv").innerHTML = `SpatialReference.wkid = <b>${arcgisMap.spatialReference.wkid}</b>`;
});