<commit_before>function HomeControl(controlDiv, map, loc)
{
  // Set CSS styles for the DIV containing the control
  // Setting padding to 5 px will offset the control
  // from the edge of the map.
  controlDiv.style.padding = '5px';

  // Set CSS for the control border.
  var controlUI = document.createElement('div');
  controlUI.style.backgroundColor = 'white';
  controlUI.style.borderStyle = 'solid';
  controlUI.style.borderWidth = '2px';
  controlUI.style.cursor = 'pointer';
  controlUI.style.textAlign = 'center';
  controlUI.title = 'Click to set the map to Home';
  controlDiv.appendChild(controlUI);

  // Set CSS for the control interior.
  var controlText = document.createElement('div');
  controlText.style.fontFamily = 'Arial,sans-serif';
  controlText.style.fontSize = '12px';
  controlText.style.paddingLeft = '4px';
  controlText.style.paddingRight = '4px';
  controlText.innerHTML = 'Home';
  controlUI.appendChild(controlText);

  // Setup the click event listeners: simply set the map to homeLocation.
  google.maps.event.addDomListener(controlUI, 'click', function() {
    map.setCenter(loc)
  });
}

function addHomeButton( map, loc )
{
    var homeControlDiv = document.createElement('div');
    var homeControl = new HomeControl(homeControlDiv, map, loc);

    homeControlDiv.index = 1;
    map.controls[google.maps.ControlPosition.TOP_RIGHT].push(homeControlDiv);
}

function addMarker( map )
{
    var marker = new google.maps.Marker({
        position: {lat: 38.7517496, lng: -9.2334604},
        map: map,
        title: 'Aqui!'
    });
}

function initialize()
{
    var homeLocation = new google.maps.LatLng(38.7717496,-9.2534604)
    var mapOptions = {
        center: homeLocation,
        zoom: 13,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        panControl: false,
        scaleControl: true,
        streetViewControl: false
    };
    var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
    
    addMarker( map ) ;
    addHomeButton( map, homeLocation ) ;
}

function loadGoogleMapsScript()
{<commit_msg>ADD: add polygon<commit_after>function addPolygon( map )
{
    // Define the LatLng coordinates for the polygon.
    var shapeCoords = [
        new google.maps.LatLng(38.7717496, -9.2534604),
        new google.maps.LatLng(38.7917496, -9.2534604),
        new google.maps.LatLng(38.8017496, -9.2834604),
        new google.maps.LatLng(38.7817496, -9.2734604),
        new google.maps.LatLng(38.7717496, -9.2634604),
    ];    
    
    // Construct the polygon.
    var shape = new google.maps.Polygon({
        paths: shapeCoords,
        strokeColor: '#FF0000',
        strokeOpacity: 0.8,
        strokeWeight: 3,
        fillColor: '#FF0000',
        fillOpacity: 0.35
    });

    shape.setMap(map);
}

function HomeControl(controlDiv, map, loc)
{
  // Set CSS styles for the DIV containing the control
  // Setting padding to 5 px will offset the control
  // from the edge of the map.
  controlDiv.style.padding = '5px';

  // Set CSS for the control border.
  var controlUI = document.createElement('div');
  controlUI.style.backgroundColor = 'white';
  controlUI.style.borderStyle = 'solid';
  controlUI.style.borderWidth = '2px';
  controlUI.style.cursor = 'pointer';
  controlUI.style.textAlign = 'center';
  controlUI.title = 'Click to set the map to Home';
  controlDiv.appendChild(controlUI);

  // Set CSS for the control interior.
  var controlText = document.createElement('div');
  controlText.style.fontFamily = 'Arial,sans-serif';
  controlText.style.fontSize = '12px';
  controlText.style.paddingLeft = '4px';
  controlText.style.paddingRight = '4px';
  controlText.innerHTML = 'Home';
  controlUI.appendChild(controlText);

  // Setup the click event listeners: simply set the map to homeLocation.
  google.maps.event.addDomListener(controlUI, 'click', function() {
    map.setCenter(loc)
  });
}

function addHomeButton( map, loc )
{
    var homeControlDiv = document.createElement('div');
    var homeControl = new HomeControl(homeControlDiv, map, loc);

    homeControlDiv.index = 1;
    map.controls[google.maps.ControlPosition.TOP_RIGHT].push(homeControlDiv);
}

function addMarker( map )
{
    var marker = new google.maps.Marker({
        position: {lat: 38.7517496, lng: -9.2334604},
        map: map,
        title: 'Aqui!'
    });
}

function initialize()
{
    var homeLocation = new google.maps.LatLng(38.7717496,-9.2534604)
    var mapOptions = {
        center: homeLocation,
        zoom: 13,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        panControl: false,
        scaleControl: true,
        streetViewControl: false
    };
    var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
    
    addMarker( map ) ;
    addHomeButton( map, homeLocation ) ;
    addPolygon( map ) ;
}

function loadGoogleMapsScript()
{
{'fraction_non_alphanumeric': 0.1214109926168991, 'fraction_numerical': 0.038351107465135356, 'mean_word_length': 3.2519616390584134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3758161', 'n_tokens_mistral': 1644, 'n_tokens_neox': 1524, 'n_words': 365}