Charmatzis / react-leaflet-google

GoogleMaps layer as React component for Leaflet | This repo is obsolete. Plz, use https://github.com/TA-Geoforce/react-leaflet-google
https://github.com/TA-Geoforce/react-leaflet-google
MIT License
29 stars 60 forks source link

Google Maps JavaScript API warning: RetiredVersion #38

Open blacksmoke26 opened 5 years ago

blacksmoke26 commented 5 years ago

Google Maps JavaScript API warning: RetiredVersion

import React from 'react';
import { Consumer } from './../base/Provider';
import { Map } from 'react-leaflet';
import { GoogleLayer } from 'react-leaflet-google';

/**
 * Google Map area component
 */
class MapArea extends React.Component {
    state = {
        lat: 42.09618442380296,
        lng: -71.5045166015625,
        zoom: 13,
    };

    render () {
        const position = [this.state.lat, this.state.lng];

        // noinspection RequiredAttributes
        return (
            <Map center={position} zoom={this.state.zoom} zoomControl={true}>
                <GoogleLayer  googlekey={'@googleApiKey'} maptype="road" />
            </Map>
        );
    }
}

MapArea.contextType = Consumer;

export default MapArea;

Above code produces following warning:

Google Maps JavaScript API warning: RetiredVersion https://developers.google.com/maps/documentation/javascript/error-messages#retired-version
mw.m                    util.js:221
(anonymous function)    js:122
Async call from Promise.then
(anonymous function)    js:122
Async call from setTimeout
Bh                      js:122
google.maps.Load        js:21
(anonymous function)    js:211
(anonymous function)    js:211
kalanda commented 5 years ago

This issue is already reported here: https://github.com/Charmatzis/react-leaflet-google/issues/32

Fiorello commented 5 years ago

39 I created a pull request that should solve this problem