Getting Started With JavaScript and Google Maps API
{Intro to what I did and how this blog post will mostly be code with comments & examples of what it looks like from codepen that you can then fork and play with it yourself.}
Centering a Map
The first thing you’re going to want to do is create a map object and set the center of the map and zoom level. The Google Maps API provides a nice code sample for making a simple map, which isn’t too difficult to figure out even if you’re a JS noob like me, but to really understand what everything was doing I commented out what each line of HTML & JS is doing.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
Dropping a Pen the Map
1 2 3 4 5 |
|