An interactive map of Oregon created with React and Mapbox, featuring animated markers, popups with images, and responsive design for both desktop and mobile views.
This is add on Map for my Oregon Hikes Project.
- Mapbox Integration: Displays a detailed map with satellite imagery.
- Animated Markers: Markers pulse to draw attention to points of interest.
- Popups with Images: Each marker opens a popup with information and an image of the location. Click the image to view more information. Click on the 3d terrain elevation link to preview the trail.
- Embedding Support: Can be embedded in other websites using an
<iframe>
.
- Clone the repository:
git clone
- Install dependencies:
npm install
- Create a
.env
file in the root directory with the following content:
REACT_APP_MAPBOX_ACCESS_TOKEN=your_mapbox_access_token
- Start the development server:
npm start
- Open
http://localhost:3000
in your browser.
- Open OregonMap.js.
- Add a new entry ib the oregonPlaces array:
const oregonPlaces = [
{
id: 4,
name: "New Location",
latitude: 45.1234,
longitude: -121.1234,
imageUrl: "/new-location.jpg"
},
// More locations
];
- Add the image to the
public
folder.
- Build the project:
npm run build
- Deploy the contents of the
build
folder to your platform of choice.
You can embed this app on other websites using an <iframe>
. After deployment, use the following HTML to embed the map:
<iframe
src="https://your-deployed-url.com"
width="100%"
height="600px"
style="border:none;"
allowfullscreen
></iframe>
- React: JavaScript library for building user interfaces.
- Mapbox GL JS: Interactive maps and spatial data visualization
- React Map GL: React components for Mapbox GL JS
- CSS: Styling and responsive design