If you want to put a marker on your map with the default look, it’s easily achieved with only a few lines of code.
To create a marker, you need to use the google.maps.Marker object. It takes only one parameter, which is an object of type google.maps.MarkerOptions. MarkerOptions has several properties that you can use to make the marker look and behave in different ways. For now, let’s settle on the only two required properties: position and map.
• position
This property defines the coordinates where the marker will be placed. It takes an argument in the form of a google.maps.LatLng object.
• map
The map property is a reference to the map to which you want to add your marker.
OK, so now that you know how to create a marker, let’s put that knowledge to good use. Add the code in Listing 5-2 right after the code that creates the map.