portfolio/src/main/webapp/script.js
/** Creates a map (with some hard-coded markers) and adds it to the page. */
Creates a map (with some hard-coded markers) and adds it to the page.
Creates a map ( with some hard - coded markers ) and adds it to the page .
function createMap() {
  map = new google.maps.Map(
      document.getElementById('map'),
      {center: {lat: -33.888385, lng: 151.244747}, zoom: 12, 
      mapId: 'c41864c7bb66540a'});
  const uniInfoWindow = 
    '<h3>University of Sydney</h3>' +
    '<p>This is where I go to university</p>'
  const highSchoolInfoWindow =
    '<h3>Kincoppal Rose Bay</h3>' +
    '<p>This is where I went to high school</p>'
  const japaneseInfoWindow = 
    '<h3>Sushi Den Vaucluse</h3>' +
    '<p>This is my favourite local Japanese restaurant'
  addLandmark(
      map, -33.888813, 151.188131, 'University of Sydney', uniInfoWindow, 'A'
  )
  addLandmark(
      map, -33.863366, 151.271159, 'Kincoppal Rose Bay', highSchoolInfoWindow, 'B'
  )
  addLandmark(
      map, -33.859159, 151.278378, 'Sushi Den Vaucluse', japaneseInfoWindow, 'C'
  )
  map.addListener('click', (event) => {
    createMarkerForEdit(event.latLng.lat(), event.latLng.lng());
  });
  fetchMarkers();
}
function createMap ( ) { map = new google . maps . Map ( document . getElementById ( 'map' ) , { center : { lat : - 33.888385 , lng : 151.244747 } , zoom : 12 , mapId : 'c41864c7bb66540a' } ) ; const uniInfoWindow = '<h3>University of Sydney</h3>' + '<p>This is where I go to university</p>' const highSchoolInfoWindow = '<h3>Kincoppal Rose Bay</h3>' + '<p>This is where I went to high school</p>' const japaneseInfoWindow = '<h3>Sushi Den Vaucluse</h3>' + '<p>This is my favourite local Japanese restaurant' addLandmark ( map , - 33.888813 , 151.188131 , 'University of Sydney' , uniInfoWindow , 'A' ) addLandmark ( map , - 33.863366 , 151.271159 , 'Kincoppal Rose Bay' , highSchoolInfoWindow , 'B' ) addLandmark ( map , - 33.859159 , 151.278378 , 'Sushi Den Vaucluse' , japaneseInfoWindow , 'C' ) map . addListener ( 'click' , ( event ) => { createMarkerForEdit ( event . latLng . lat ( ) , event . latLng . lng ( ) ) ; } ) ; fetchMarkers ( ) ; }
Creates a map (with some hard-coded markers) and adds it to the page.
Creates a map ( with some hard - coded markers ) and adds it to the page .
// When the user clicks in the map, show a marker with a text box the user can // edit.