Google maps TypeScript error: Cannot find name 'google' - discussion

I solved this, here is what you have to do:

  1. npm install @types/googlemaps --save-dev

  2. <script src="http://maps.google.com/maps/api/js?key=XXXXX"></script> in index.html

  3. declare module 'googlemaps'; into declarations.d.ts

  4. import {googlemaps} from 'googlemaps'; in class where you using maps

8 Likes