Last active
August 2, 2019 20:56
-
-
Save david-mart/ddd6bfe71b22f75205aad6b3a51ca65c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ReactDOMServer from 'react-dom/server'; | |
import MarkerSvg from './marker-svg'; | |
const encodeSvg = reactElement => | |
'data:image/svg+xml;charset=utf-8,' + | |
encodeURIComponent(ReactDOMServer.renderToStaticMarkup(reactElement)) | |
const marker = { | |
position: { | |
lat: "34.1683776" | |
lng: "-118.3826831" | |
}, | |
icon: { | |
url: encodeSvg( | |
<MarkerSvg | |
fillColor="#C0FFEE" | |
strokeColor="#B00B1E" | |
/> | |
), | |
anchor: { x: 14, y: 14 } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment