This is a solution to the IP address tracker challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for each page depending on their device's screen size
- See hover states for all interactive elements on the page
- See their own IP address on the map on the initial page load
- Search for any IP addresses or domains and see the key information and location
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- React - JS library
- leaflet.js - interactive maps framework
- react-leaflet.js - React components for Leaflet
- How to use Leaflet (easy to use/ great performance)
<MapContainer
style={{ height: "100vh" }}
center={props.positionNum} zoom={13}>
<ChangeView center={props.positionNum} />
<TileLayer
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<Marker position={props.positionNum}>
<Popup>
Your Approximate location
</Popup>
</Marker>
</MapContainer>- Leaflet Quick Start Guide - This simple step-by-step guide helped me with the basics of leaflet.
- react-Leaflet - This guided me through how to use leaflet in react.