react-google-maps icon indicating copy to clipboard operation
react-google-maps copied to clipboard

Using fontawesome 5 icons for markers

Open reft opened this issue 5 years ago • 2 comments

How do you use fontawesome 5 icons for markers?

import React from 'react'
import { Marker as GoogleMarker, InfoWindow } from 'react-google-maps'

const Marker = (props: any) => {
    return (
        <GoogleMarker position={props.location} onClick={props.toggleInfo.bind(props, props.index)}>
            {props.showInfo === true && (
                <InfoWindow onCloseClick={props.toggleInfo.bind(props, props.index)}>
                    <div className="marker-text">{props.info}</div>
                </InfoWindow>
            )}
        </GoogleMarker>
    )
}

export default Marker

reft avatar Oct 04 '18 12:10 reft

I would love to know the answer for this! I would guess that you could use the defaultIcon prop for this...

becky-intelletive avatar Jun 15 '20 20:06 becky-intelletive

@becky-intelletive The repo of this project is unmaintained more than a year, and we had build new version https://www.npmjs.com/package/@react-google-maps/api

We had rewrite it to TypeScript, and updating it frequently: https://github.com/JustFly1984/react-google-maps-api/tree/master/packages/react-google-maps-api You can enjoy autocomplete.

You can see our docs: https://react-google-maps-api-docs.netlify.app

Also a lot of examples: https://react-google-maps-api-gatsby-demo.netlify.app/ https://github.com/JustFly1984/react-google-maps-api/tree/master/packages/react-google-maps-api-gatsby-example/src/examples

The bundle size is much smaller: https://bundlephobia.com/result?p=@react-google-maps/api

Our Spectrum community: https://spectrum.chat/react-google-maps
Our Slack channel: https://join.slack.com/t/react-google-maps-api/shared_invite/enQtODc5ODU1NTY5MzQ4LTBiNTYzZmY1YmVjYzJhZThkMGU0YzUwZjJkNGJmYjk4YjQyYjZhMDk2YThlZGEzNDc0M2RhNjBmMWE4ZTJiMjQ

Enjoy!

we have released version 1.9.6 just yesterday.

JustFly1984 avatar Jun 15 '20 23:06 JustFly1984