Graph behaves weird when select info recovered box
sohailshams opened this issue · comments
hey can you help me My map isnot zooming to the countries when I select the puticular coutry from menu
change your Map.js to following code;
function ChangeMapView({ coords, zoom }) {
const map = useMap();
map.setView([coords.lat, coords.lng], zoom);
return null;
}
function Map({ countries, casesType, center, zoom }) {
return (
{showDataOnMap(countries, casesType)}
);
}
export default Map;
and in App.js in onCountryChange add following code.
const {
countryInfo: { lat, long },
} = data;
setMapCenter({ lat, lng: long });
setMapZoom(4);
Were you able to solve this issue? I am also facing the same problem.