UNPKG

react-google-maps

Version:
80 lines (72 loc) 1.92 kB
### Usage ```jsx static import { compose, withProps } from "recompose"; import { withScriptjs, withGoogleMap, GoogleMap, FusionTablesLayer, } from "react-google-maps"; const MapWithAFusionTablesLayer = compose( withProps({ googleMapURL: "https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=geometry,drawing,places", loadingElement: <div style={{ height: `100%` }} />, containerElement: <div style={{ height: `400px` }} />, mapElement: <div style={{ height: `100%` }} />, }), withScriptjs, withGoogleMap )(props => <GoogleMap defaultZoom={11} defaultCenter={{ lat: 41.850033, lng: -87.6500523 }} > <FusionTablesLayer url="http://googlemaps.github.io/js-v2-samples/ggeoxml/cta.kml" options={{ query: { select: `Geocodable address`, from: `1mZ53Z70NsChnBMm-qEYmSDOvLXgrreLTkQUvvg` } }} /> </GoogleMap> ); <MapWithAFusionTablesLayer /> ``` ### Map with a FusionTablesLayer ```jsx const { compose, withProps } = require("recompose"); const { withScriptjs, withGoogleMap, GoogleMap, FusionTablesLayer, } = require("../index"); const MapWithAFusionTablesLayer = compose( withProps({ googleMapURL: "https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=geometry,drawing,places", loadingElement: <div style={{ height: `100%` }} />, containerElement: <div style={{ height: `400px` }} />, mapElement: <div style={{ height: `100%` }} />, }), withScriptjs, withGoogleMap )(props => <GoogleMap defaultZoom={11} defaultCenter={{ lat: 41.850033, lng: -87.6500523 }} > <FusionTablesLayer url="http://googlemaps.github.io/js-v2-samples/ggeoxml/cta.kml" options={{ query: { select: `Geocodable address`, from: `1mZ53Z70NsChnBMm-qEYmSDOvLXgrreLTkQUvvg` } }} /> </GoogleMap> ); <MapWithAFusionTablesLayer /> ```