web/js/googlemap.js
// write javascript for polygon with hole
write javascript for polygon with hole
write javascript for polygon with hole
function logCode5() {
    if (notext === true) return;
    var hstring = "";
    gob('coords1').value = 'var outerPoints = [\n';
    for(var i=0; i<outerArray.length; i++){
        if(i == outerArray.length-1){
            gob('coords1').value += 'new google.maps.LatLng('+outerArray[i] + ')\n'; 
        }else{
            gob('coords1').value += 'new google.maps.LatLng('+outerArray[i] + '),\n';
        }
    }
    gob('coords1').value += '];\n';
    for(var m=0; m<innerArrays.length; m++){
        gob('coords1').value += 'var innerPoints'+m+' = [\n';
        var holestring = 'innerPoints'+m;
        if(m<innerArrays.length-1) holestring += ',';
        hstring += holestring;
        for(i=0; i<innerArrays[m].length; i++){
            if(i == innerArrays[m].length-1){
                gob('coords1').value += 'new google.maps.LatLng('+innerArrays[m][i] + ')\n';
            }else{
                gob('coords1').value += 'new google.maps.LatLng('+innerArrays[m][i] + '),\n';
            }
        }
        gob('coords1').value += '];\n';
    }
    gob('coords1').value += 'var myCoordinates = [outerPoints,'+hstring+'];\n';
    gob('coords1').value += 'var polyOptions = {\n'
    +'paths: myCoordinates,\n'
    +'strokeColor: "'+polygonstyles[pcur].color+'",\n'
    +'strokeOpacity: '+polygonstyles[pcur].lineopac+',\n'
    +'strokeWeight: '+polygonstyles[pcur].width+',\n'
    +'fillColor: "'+polygonstyles[pcur].fill+'",\n'
    +'fillOpacity: '+polygonstyles[pcur].fillopac+'\n'
    +'};\n'
    +'var it = new google.maps.Polygon(polyOptions);\n'
    +'it.setMap(map);\n';
    placemarks[plmcur].poly = "pgh";
    javacode = gob('coords1').value;
}
function logCode5 ( ) { if ( notext === true ) return ; var hstring = "" ; gob ( 'coords1' ) . value = 'var outerPoints = [\n' ; for ( var i = 0 ; i < outerArray . length ; i ++ ) { if ( i == outerArray . length - 1 ) { gob ( 'coords1' ) . value += 'new google.maps.LatLng(' + outerArray [ i ] + ')\n' ; } else { gob ( 'coords1' ) . value += 'new google.maps.LatLng(' + outerArray [ i ] + '),\n' ; } } gob ( 'coords1' ) . value += '];\n' ; for ( var m = 0 ; m < innerArrays . length ; m ++ ) { gob ( 'coords1' ) . value += 'var innerPoints' + m + ' = [\n' ; var holestring = 'innerPoints' + m ; if ( m < innerArrays . length - 1 ) holestring += ',' ; hstring += holestring ; for ( i = 0 ; i < innerArrays [ m ] . length ; i ++ ) { if ( i == innerArrays [ m ] . length - 1 ) { gob ( 'coords1' ) . value += 'new google.maps.LatLng(' + innerArrays [ m ] [ i ] + ')\n' ; } else { gob ( 'coords1' ) . value += 'new google.maps.LatLng(' + innerArrays [ m ] [ i ] + '),\n' ; } } gob ( 'coords1' ) . value += '];\n' ; } gob ( 'coords1' ) . value += 'var myCoordinates = [outerPoints,' + hstring + '];\n' ; gob ( 'coords1' ) . value += 'var polyOptions = {\n' + 'paths: myCoordinates,\n' + 'strokeColor: "' + polygonstyles [ pcur ] . color + '",\n' + 'strokeOpacity: ' + polygonstyles [ pcur ] . lineopac + ',\n' + 'strokeWeight: ' + polygonstyles [ pcur ] . width + ',\n' + 'fillColor: "' + polygonstyles [ pcur ] . fill + '",\n' + 'fillOpacity: ' + polygonstyles [ pcur ] . fillopac + '\n' + '};\n' + 'var it = new google.maps.Polygon(polyOptions);\n' + 'it.setMap(map);\n' ; placemarks [ plmcur ] . poly = "pgh" ; javacode = gob ( 'coords1' ) . value ; }
write javascript for polygon with hole
write javascript for polygon with hole
// without trailing comma