In order, to set a fixed marker on our map we must first get the position/location in lat/long.
var tribeca = {lat: 40.719526, lng: -74.0089934};Now that we have saved our location in a variable called
tribeca
, let's create our marker.var marker = new google.maps.Marker({ position: tribeca, map: map, title: 'My Marker!' });Now if we run our html file on our browser, we see our newly placed marker.
To view the full code, please visit here.
Stay tuned for the next lesson: Marker Infowindows
No comments:
Post a Comment