text: function initialize() {
  
      $('form').on('keyup keypress', function(e) {
          var keyCode = e.keyCode || e.which;
          if (keyCode === 13) {
              e.preventDefault();
              return false;
          }
      });
      const locationInputs = document.getElementsByClassName("map-input");
  
      const autocompletes = [];
      const geocoder = new google.maps.Geocoder;
      for (let i = 0; i < locationInputs.length; i++) {
  
          const input = locationInputs[i];
          const fieldKey = input.id.replace("-input", "");
          const isEdit = document.getElementById(fieldKey + "-latitude").value != '' && document.getElementById(fieldKey + "-longitude").value != '';
  
          const latitude = parseFloat(document.getElementById("latitude").value) || 33.3152;
          const longitude = parseFloat(document.getElementById("longitude").value) || 44.3661;
  
          const map = new google.maps.Map(document.getElementById(fieldKey + '-map'), {
              center: {lat: latitude, lng: longitude},
              zoom: 13
          });
          const marker = new google.maps.Marker({
              map: map,
              position: {lat: latitude, lng: longitude},
              draggable: true,
          });
          google.maps.event.addListener(marker, 'dragend', function(a) {
              console.log(a);
              // var div = document.createElement('div');
              // div.innerHTML = a.latLng.lat().toFixed(4) + ', ' + a.latLng.lng().toFixed(4);
              // document.getElementsByTagName('body')[0].appendChild(div);
              const lat = a.latLng.lat().toFixed(4);
              const lng = a.latLng.lng().toFixed(4);
              setLocationCoordinates(autocomplete.key, lat, lng);
  
  
          });
  
          marker.setVisible(isEdit);
  
          const autocomplete = new google.maps.places.Autocomplete(input);
          autocomplete.key = fieldKey;
          autocompletes.push({input: input, map: map, marker: marker, autocomplete: autocomplete});
      }
  
      for (let i = 0; i < autocompletes.length; i++) {
          const input = autocompletes[i].input;
          const autocomplete = autocompletes[i].autocomplete;
          const map = autocompletes[i].map;
          const marker = autocompletes[i].marker;
  
          google.maps.event.addListener(autocomplete, 'place_changed', function () {
              marker.setVisible(false);
              const place = autocomplete.getPlace();
  
              geocoder.geocode({'placeId': place.place_id}, function (results, status) {
                  if (status === google.maps.GeocoderStatus.OK) {
                      const lat = results[0].geometry.location.lat();
                      const lng = results[0].geometry.location.lng();
                      setLocationCoordinates(autocomplete.key, lat, lng);
                  }
              });
  
              if (!place.geometry) {
                  window.alert("No details available for input: '" + place.name + "'");
                  input.value = "";
                  return;
              }
  
              if (place.geometry.viewport) {
                  map.fitBounds(place.geometry.viewport);
              } else {
                  map.setCenter(place.geometry.location);
                  map.setZoom(17);
              }
              marker.setPosition(place.geometry.location);
              marker.setVisible(true);
  
          });
      }
  }
  
  function setLocationCoordinates(key, lat, lng) {
      const latitudeField = document.getElementById("latitude");
      const longitudeField = document.getElementById("longitude");
      latitudeField.value = lat;
      longitudeField.value = lng;
  }
  