UNPKG

react-google-maps-jimmy

Version:
37 lines (33 loc) 1.06 kB
### Map with a MarkerWithLabel ```jsx const { compose } = require("recompose"); const { withScriptjs, withGoogleMap, GoogleMap, } = require("react-google-maps-jimmy"); const { MarkerWithLabel } = require("react-google-maps-jimmy/lib/components/addons/MarkerWithLabel"); const MapWithAMarkerWithLabel = compose( withScriptjs, withGoogleMap )(props => <GoogleMap defaultZoom={8} defaultCenter={{ lat: -34.397, lng: 150.644 }} > <MarkerWithLabel position={{ lat: -34.397, lng: 150.644 }} labelAnchor={new google.maps.Point(0, 0)} labelStyle={{backgroundColor: "yellow", fontSize: "32px", padding: "16px"}} > <div>Hello There!</div> </MarkerWithLabel> </GoogleMap> ); <MapWithAMarkerWithLabel googleMapURL="https://maps.googleapis.com/maps/api/js?key=AIzaSyC4R6AN7SmujjPUIGKdyao2Kqitzr1kiRg&v=3.exp&libraries=geometry,drawing,places" loadingElement={<div style={{ height: `100%` }} />} containerElement={<div style={{ height: `400px` }} />} mapElement={<div style={{ height: `100%` }} />} /> ```