Marker API can't display inside the Map #2022
Unanswered
MartinYeung5
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i have used Marker API in my project, however Marker API can't display inside the Map.
The pin image has been displayed outside the Map.
my coding:
import ReactMapGL, { Marker,Popup } from 'react-map-gl';
import { useState } from "react";
import { getCenter } from 'geolib';
function Map({searchResults}) {
const [selectedLocation, setSelectedLocation] = useState({});
return (
<ReactMapGL
mapStyle="mapbox://styles/yeung2022/cl9mngj5g006114me7fet3hr7"
mapboxAccessToken={process.env.mapbox_key}
{...viewState}
onMove={evt => setViewState(evt.viewState)} //moving Map
>
);
}
export default Map;
Beta Was this translation helpful? Give feedback.
All reactions