react-leaflet-google icon indicating copy to clipboard operation
react-leaflet-google copied to clipboard

Google Maps JavaScript API warning: RetiredVersion

Open blacksmoke26 opened this issue 6 years ago • 2 comments

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

blacksmoke26 avatar Mar 04 '19 21:03 blacksmoke26

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

kalanda avatar Mar 12 '19 16:03 kalanda

#39 I created a pull request that should solve this problem

Fiorello avatar May 31 '19 09:05 Fiorello