Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated: (i) Map, (ii) onClick, (iii) Grammar #111

Open
wants to merge 1 commit into
base: mern-travel-app
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "./app.css";
import ReactMapGL, { Marker, Popup } from "react-map-gl";
import "mapbox-gl/dist/mapbox-gl.css";
import Map, { Marker, Popup } from "react-map-gl";
import { useEffect, useState } from "react";
import { Room, Star, StarBorder } from "@material-ui/icons";
import axios from "axios";
Expand Down Expand Up @@ -30,7 +31,7 @@ function App() {
};

const handleAddClick = (e) => {
const [longitude, latitude] = e.lngLat;
const {lng: longitude, lat: latitude} = e.lngLat;
setNewPlace({
lat: latitude,
long: longitude,
Expand Down Expand Up @@ -75,12 +76,11 @@ function App() {
};

return (
<div style={{ height: "100vh", width: "100%" }}>
<ReactMapGL
{...viewport}
mapboxApiAccessToken=""
width="100%"
height="100%"
<div>
<Map
initialViewState={{ ...viewport }}
mapboxAccessToken=""
style={{ width: "100vw", height: "100vh" }}
transitionDuration="200"
mapStyle="mapbox://styles/safak/cknndpyfq268f17p53nmpwira"
onViewportChange={(viewport) => setViewport(viewport)}
Expand Down Expand Up @@ -167,7 +167,7 @@ function App() {
/>
<label>Description</label>
<textarea
placeholder="Say us something about this place."
placeholder="Tell us something about this place."
onChange={(e) => setDesc(e.target.value)}
/>
<label>Rating</label>
Expand Down Expand Up @@ -211,7 +211,7 @@ function App() {
myStorage={myStorage}
/>
)}
</ReactMapGL>
</Map>
</div>
);
}
Expand Down