var VARNAME = CACHE_PERIOD){ if(!is_dir(CACHE_DIR.'/MAP_ID_VALUE')){ mkdir(CACHE_DIR.'/MAP_ID_VALUE'); } $fin = fopen(GS_URL, 'r'); $fout = fopen($js_file, 'w'); while(($contents = fread($fin, 4096))){ fwrite($fout, $contents); } fclose($fin); fclose($fout); } readfile($js_file); } ?> ; { let qc_id = 0; VARNAME.features.forEach(function (feat) { feat.properties["qc_id"] = qc_id; qc_id = qc_id + 1;}); if(VARNAME.features[0].properties["gid"] === undefined){ let gid = 0; VARNAME.features.forEach(function (feat) { feat.properties["gid"] = gid; gid = gid + 1;}); } }