This sample demonstrates how the geometries of client side features, whether added as graphics to the MapView or as a GeoJSONLayer, are automatically projected using the client-side projection module.
The MapView's spatialReference 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("change", () => {
view.spatialReference = {
wkid: wkidSelect.value
};
centerPoint.spatialReference = {
wkid: wkidSelect.value
};
view.center = centerPoint;
});