function centerPlot(plot) {
    let center = {
        lat: null,
        lng: null
    };
    let totalLat = 0;
    let totalLng = 0;
    for (let i = 0; i < plot.length; i = i + 2) {
        totalLat = totalLat + plot[i].lat;
        totalLng = totalLng + plot[i].lng;
    }

    center.lat = totalLat / plot.length;
    center.lng = totalLng / plot.length;

    let lati = parseFloat(center.lat);
    let long = parseFloat(center.lng);

    let options = {
        center: { lat: lati, lng: long }, // Map center coordinates
        zoom: 18,
        tilt: 0,
        mapTypeId: 'satellite',
        styles: [
            // Hide museums, monuments, etc.
            {
                featureType: 'poi',
                stylers: [{ visibility: 'off' }]
            },

            // Hide stations, bus stops, etc.
            {
                featureType: 'transit',
                stylers: [{ visibility: 'off' }]
            }
        ],
        rotateControl: false,
        mapTypeControl: false,
        streetViewControl: false
    };
    let map = new google.maps.Map(document.getElementById(mapId), options);
    addPlots(map);
    addProbes(map);
}
// This function centers the map in the plot
This function centers the map in the plot
This function centers the map in the plot
function centerPlot(plot) {
    let center = {
        lat: null,
        lng: null
    };
    let totalLat = 0;
    let totalLng = 0;
    for (let i = 0; i < plot.length; i = i + 2) {
        totalLat = totalLat + plot[i].lat;
        totalLng = totalLng + plot[i].lng;
    }
    center.lat = totalLat / plot.length;
    center.lng = totalLng / plot.length;
    let lati = parseFloat(center.lat);
    let long = parseFloat(center.lng);
    let options = {
        center: { lat: lati, lng: long }, 
        zoom: 18,
        tilt: 0,
        mapTypeId: 'satellite',
        styles: [
            {
                featureType: 'poi',
                stylers: [{ visibility: 'off' }]
            },
            {
                featureType: 'transit',
                stylers: [{ visibility: 'off' }]
            }
        ],
        rotateControl: false,
        mapTypeControl: false,
        streetViewControl: false
    };
    let map = new google.maps.Map(document.getElementById(mapId), options);
    addPlots(map);
    addProbes(map);
}
function centerPlot ( plot ) { let center = { lat : null , lng : null } ; let totalLat = 0 ; let totalLng = 0 ; for ( let i = 0 ; i < plot . length ; i = i + 2 ) { totalLat = totalLat + plot [ i ] . lat ; totalLng = totalLng + plot [ i ] . lng ; } center . lat = totalLat / plot . length ; center . lng = totalLng / plot . length ; let lati = parseFloat ( center . lat ) ; let long = parseFloat ( center . lng ) ; let options = { center : { lat : lati , lng : long } , zoom : 18 , tilt : 0 , mapTypeId : 'satellite' , styles : [ { featureType : 'poi' , stylers : [ { visibility : 'off' } ] } , { featureType : 'transit' , stylers : [ { visibility : 'off' } ] } ] , rotateControl : false , mapTypeControl : false , streetViewControl : false } ; let map = new google . maps . Map ( document . getElementById ( mapId ) , options ) ; addPlots ( map ) ; addProbes ( map ) ; }
This function centers the map in the plot
This function centers the map in the plot
// Map center coordinates // Hide museums, monuments, etc. // Hide stations, bus stops, etc.