Hi I am new to React and ArcGIS. I tried to write some simple React web application to show the map. However the map is show so small inside the canvas. You can see the below code and attache screenshot
MY Screenshot
css
Solved! Go to Solution.
Your map is actually taking up the entire page, but it is very zoomed out. Try specifying a center and a zoom level, something like this:
mapRef.current = new MapView({
map: webmap,
container: "mapViewId",
center: [-118.805, 34.027], // Longitude, latitude
zoom: 13 // Zoom level
});
https://developers.arcgis.com/javascript/latest/tutorials/display-a-map/#create-a-map-view
Try using
.mapDiv {
height:400px;
width:800px;
}
tried and it make is much small on my screen.
Your map is actually taking up the entire page, but it is very zoomed out. Try specifying a center and a zoom level, something like this:
mapRef.current = new MapView({
map: webmap,
container: "mapViewId",
center: [-118.805, 34.027], // Longitude, latitude
zoom: 13 // Zoom level
});
https://developers.arcgis.com/javascript/latest/tutorials/display-a-map/#create-a-map-view
Thank. after changing the zoom level, and it is looking good now.