How to use react-google-maps - 10 common examples

To help you get started, we’ve selected a few react-google-maps examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github focallocal / fl-maps / imports / client / ui / pages / Map / index.js View on Github external
Meteor.call('Events.getFutureEvents', data, (err, res) => {
          if (!err) {
            this.setState({
              events: res,
              filteredEvents: res
            })
            this.memoizeLocations = {} // reset caching
          }

          this.setState({ isFetching: false })
        })
      }
    }
  }
}
const MapComponent = withScriptjs(withGoogleMap(MapComponent_))

class Map_ extends Component {
  render () {
    const { key } = Meteor.settings.public.gm
    const url = 'https://maps.googleapis.com/maps/api/js?key=' + key + '&v=3.exp&libraries=places'

    return (
      }
        containerElement={<div id="map-container">}
        mapElement={<div id="map">}
        history={this.props.history}
      /&gt;
    )
  }</div></div>
github tubackkhoa / tkframework / client / ui / backend / containers / ServicePoint / Form / edit.jsx View on Github external
import { getServicePoint, updateServicePoint, replaceServicePoint } from 'store/actions/service-point'

import * as authSelectors from 'store/selectors/auth'
import * as servicePointSelectors from 'store/selectors/service-point'

import { GOOGLE_API_KEY } from 'store/constants/api'


import { 
  renderTextField, 
  renderDropzoneImage, 
  renderAutoComplete,
} from 'ui/backend/shared/utils'


const ServicePointGoogleMap = withGoogleMap(({position}) =&gt; (
      
    
))

const validate = (values) =&gt; {
  const errors = {}
  // first time it is empty
  if(!values) return errors
  if (!values.name) {
github benawad / fullstack-graphql-airbnb-clone / packages / web / src / modules / shared / LocationField.tsx View on Github external
import * as React from "react";
import { FieldProps } from "formik";
import Geosuggest, { Suggest } from "react-geosuggest";
import { withGoogleMap, GoogleMap, Marker } from "react-google-maps";

import "./geo.css";

interface DefaultCenter {
  lat: number;
  lng: number;
}

// -34.397, lng: 150.644
const MapWithAMarker = withGoogleMap&lt;{
  defaultCenter: DefaultCenter;
  lat: number;
  lng: number;
  onClick: (e: google.maps.KmlMouseEvent | google.maps.MouseEvent) =&gt; void;
}&gt;(props =&gt; (
  
    
));

interface State {
  defaultCenter: DefaultCenter | null;
github flatlogic / react-material-admin / src / pages / maps / Maps.js View on Github external
import React from "react";
import {
  withGoogleMap,
  withScriptjs,
  GoogleMap,
  Marker,
} from "react-google-maps";

// styles
import useStyles from "./styles";

const BasicMap = withScriptjs(
  withGoogleMap(() =&gt; (
    
      
  )),
);

export default function Maps() {
  var classes = useStyles();

  return (
github ninjadotorg / handshake-app / src / pages / Discover / Components / Map.jsx View on Github external
);
  }
}

const mapState = state =&gt; ({
  ipInfo: state.app.ipInfo,
  offerStores: state.exchange.offerStores,
});

const mapDispatch = dispatch =&gt; ({
  // rfChange: bindActionCreators(change, dispatch),
});

export default injectIntl(
  connect(mapState, mapDispatch)(withScriptjs(withGoogleMap(Map))),
);
github imranhsayed / google-maps-in-react / client / src / components / Map.js View on Github external
render(){
		const AsyncMap = withScriptjs(
			withGoogleMap(
				props =&gt; (
					
						{/* InfoWindow on top of marker */}
						
							<div>
								<span style="{{">{ this.state.address }</span>
							</div>
						
						{/*Marker*/}
github maximevaillancourt / trace / src / pages / View.js View on Github external
// used to display a line between the various versions' position markers
    const polylineJSX = (
github bahmutov / cypress-react-unit-test / cypress / component / component tests / advanced / mocking-component / map.js View on Github external
import React from 'react'

import { GoogleMap, withGoogleMap, withScriptjs } from 'react-google-maps'

const GMap = withScriptjs(
  withGoogleMap(props =&gt; ),
)

export default function Map(props) {
  return (
    }
      containerElement={<div style="{{">}
      mapElement={<div style="{{">}
    /&gt;
  )
}
</div></div>
github ninjadotorg / handshake-app / src / components / handshakes / exchange / Create / components / RelocationMap / index.js View on Github external
render() {
    const Map = withScriptjs(withGoogleMap(RelocationMap));
    return (
      <div>
        <map style="{{">}
          containerElement={<div style="{{">}
          mapElement={<div style="{{">}
          {...this.props}
        /&gt;
        <img alt="marker" height="{30}" width="{30}" src="{currentLocationIndicator}">
      </div>
    );
  }
}</div></map></div>

react-google-maps

React.js Google Maps integration component

MIT
Latest version published 6 years ago

Package Health Score

55 / 100
Full package analysis