Skip to content

Marker onClick method not working #52

Closed Answered by giorgiabosello
flaviobvds asked this question in Help
Discussion options

You must be logged in to vote

Here's my full code for the GoogleMap and Marker components. How should I add the the onClick property to it? PS: I'm using typescript.

const Marker = ({ isClicked }: any) => {
    return (
        <div className={styles.pinContainer}>
            <MdLocationPin
                color={isClicked ? "white" : "rgb(7, 64, 9)"}
                size="50"
            />
        </div>
    )
}

interface MapProps {
    apiKey: string
}

export default function Map({apiKey}: MapProps) {
    const [isClicked, setIsClicked] = useState(false)

    const defaultProps = {
        center: {
            lat: 2.84246001583857,
            lng: -60.714896175459955
        },
        zoom: 13
    };

    c…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by giorgiabosello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
not a bug This is not a bug
2 participants
Converted from issue

This discussion was converted from issue #51 on May 02, 2023 11:19.