Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add Google Maps documentation for code completion in PhpStorm

I am developing a web application using PhpStorm and I use the Google Maps JavaScript API v3. PhpStorm offers a code completion feature but only if it knows about the library used, of course. So I would like to include the Google Maps library to PhpStorm in order to be able to use code completion but I do not know where to get the .js file from. Does anybody know how to accomplish this task or know the URL for the js library?

like image 615
thomas.s Avatar asked Jul 23 '12 09:07

thomas.s


People also ask

Is Google Maps API free for developers?

The API is available for developers that have a free Google Maps API key. Usage of the API is not strictly free, but they do offer $200 of free monthly usage for most users. The pricing scales to fit your particular needs and you are only charged for your API usage.


1 Answers

Here is what you have to do in PhpStorm (I was using 7.1, but the idea is the same).

Go here and copy a file (I was selecting the latest version) to any directory you want (it will be used only by PhpStorm, not your app, so it does not really matter where will you save it).

After this go to Files -> Settings -> JavaScript -> Libraries. Then click Add and write the name, version and provide a link to your file (in a similar method as in my screenshot).

PHPStorm's "New Library" dialog, filled in with the answerer's values. Name: googleMaps. Framework type: Custom. Version: 3.15. File name: googlemap_for_stormCompletion.js. Type: Debug.

After clicking Ok and Apply everything should start to work.

like image 139
Salvador Dali Avatar answered Oct 04 '22 14:10

Salvador Dali