|
@@ -62,8 +62,8 @@ onMounted(() => {
|
|
|
return '#cccccc';
|
|
return '#cccccc';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 只加载乡镇级GeoJSON,并根据所属区县着色
|
|
|
|
|
- fetch('http://localhost:8000/api/vector/export/all?table_name=town&format=geojson')
|
|
|
|
|
|
|
+ // 只加载乡镇级GeoJSON,并根据所属区县着色http://localhost:8000/api/vector/export/all?table_name=town&format=geojson
|
|
|
|
|
+ fetch('./data/韶关市乡镇划分图5.geojson')
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
if (!res.ok) throw new Error(`乡镇划分图加载失败:${res.status}`);
|
|
if (!res.ok) throw new Error(`乡镇划分图加载失败:${res.status}`);
|
|
|
return res.json();
|
|
return res.json();
|
|
@@ -71,7 +71,7 @@ onMounted(() => {
|
|
|
.then(townshipGeojson => {
|
|
.then(townshipGeojson => {
|
|
|
L.geoJSON(townshipGeojson, {
|
|
L.geoJSON(townshipGeojson, {
|
|
|
style: (feature) => {
|
|
style: (feature) => {
|
|
|
- const countyName = feature.properties.county_name || '';
|
|
|
|
|
|
|
+ const countyName = feature.properties.FXZQMC || '';
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
|
fillColor: getDistrictColor(countyName), // 使用所属区县的颜色
|
|
fillColor: getDistrictColor(countyName), // 使用所属区县的颜色
|