How to use the google-map-react.defaultProps function in google-map-react

To help you get started, we’ve selected a few google-map-react 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 robeio / robe-react-ui / src / googlemap / GoogleMap.jsx View on Github external
import PropTypes from "prop-types";
import { ShallowComponent, Application } from "robe-react-commons";
import Googlemap from "google-map-react";
import SearchBox from "./SearchBox";
import Col from "react-bootstrap/lib/Col";
import "./GoogleMap.css";

export default class GoogleMap extends ShallowComponent {

    static propTypes: Map = {
        ...Googlemap.PropTypes,
        searchBox: PropTypes.object
    };

    static defaultProps = {
        ...Googlemap.defaultProps,
        language: Application.i18n(GoogleMap, "googlemap.GoogleMap", "language")
    };

    render(): Object {
        let newProps = { ...this.props };
        if (!newProps.bootstrapURLKeys.language) {
            newProps.bootstrapURLKeys.language = this.props.language;
        }
        return (<span>
            {this.__renderSearchBox()}
            
        </span>);
    }

    __renderSearchBox(): Object {
        if (this.props.searchBox &amp;&amp; this.props.searchBox.apiParams &amp;&amp; this.props.bootstrapURLKeys.libraries) {

google-map-react

Isomorphic component that allows rendering react components on a google map

MIT
Latest version published 12 months ago

Package Health Score

75 / 100
Full package analysis