Loading app/src/components/container/MapContainer.jsx +10 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ export default class MapContainer extends Component { } componentDidUpdate() { // remove old map container and append new container to its parent let oldContainer = document.getElementById("map-container"); let parent = oldContainer.parentNode; let newContainer = document.createElement("div"); Loading @@ -31,13 +32,21 @@ export default class MapContainer extends Component { newContainer.setAttribute("id", "map-container"); parent.appendChild(newContainer); // remove disabled classes from projection buttons so that the css is reset to default document.getElementById("projectionNorthPole").classList.remove("disabled"); document .getElementById("projectionCylindrical") .classList.remove("disabled"); document.getElementById("projectionSouthPole").classList.remove("disabled"); // create new map with updated target let map = new AstroMap("map-container", this.props.target, {}); new Projection().addTo(map); new MousePosition({ numDigits: 2, targetPlanet: this.props.target }).addTo(map); new L.Control.Scale({ imperial: false }).addTo(map); map.on("fullscreenchange", this.handleFullScreenChange()); } Loading Loading
app/src/components/container/MapContainer.jsx +10 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ export default class MapContainer extends Component { } componentDidUpdate() { // remove old map container and append new container to its parent let oldContainer = document.getElementById("map-container"); let parent = oldContainer.parentNode; let newContainer = document.createElement("div"); Loading @@ -31,13 +32,21 @@ export default class MapContainer extends Component { newContainer.setAttribute("id", "map-container"); parent.appendChild(newContainer); // remove disabled classes from projection buttons so that the css is reset to default document.getElementById("projectionNorthPole").classList.remove("disabled"); document .getElementById("projectionCylindrical") .classList.remove("disabled"); document.getElementById("projectionSouthPole").classList.remove("disabled"); // create new map with updated target let map = new AstroMap("map-container", this.props.target, {}); new Projection().addTo(map); new MousePosition({ numDigits: 2, targetPlanet: this.props.target }).addTo(map); new L.Control.Scale({ imperial: false }).addTo(map); map.on("fullscreenchange", this.handleFullScreenChange()); } Loading