var VARNAME_data_lg = L.layerGroup(null, { color: "STYLE_COLOR", fillColor: "STYLE_FILL_COLOR", opacity: STYLE_OPACITY, fillOpacity: STYLE_FILL_OPACITY, weight: 2 }); var VARNAME_data_lg_ids = []; const VARNAME_data = $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); } } fn_VARNAME(); ?>; var VARNAME = L.geoJson(VARNAME_data, { style: { color: "STYLE_COLOR", fillColor: "STYLE_FILL_COLOR", opacity: STYLE_OPACITY, fillOpacity: STYLE_FILL_OPACITY, weight: 2 }, onEachFeature(feature, layer) { VARNAME_data_lg.addLayer(layer); VARNAME_data_lg_ids.push(layer._leaflet_id); var on_event = 'click'; layer.on(on_event, function(e) { var properties = feature.properties; var html = ''; for (const key in properties) { html += '"; } html += '
'+ key +" "+ properties[key] + "
'; $('.sidebar .table-container').html(html); $('.sidebar').show(); }); }, pointToLayer(feature, latlng) { return L.circleMarker(latlng, { radius: 6, color: "STYLE_COLOR", fillColor: "STYLE_FILL_COLOR", opacity: STYLE_OPACITY, fillOpacity: STYLE_FILL_OPACITY, weight: 2 }); } });