更新 geojson 数据可视化逻辑

This commit is contained in:
hym 2026-04-02 14:30:45 +08:00
parent bc32b1aaae
commit b885a919ad
1 changed files with 2 additions and 4 deletions

View File

@ -464,9 +464,7 @@ export async function loadJsonLineFeature(layerId, color, geojson, mapId) {
} }
} }
export async function loadJsonPointFeature(layerId, color, geojson, mapId) { export async function loadJsonPointFeature(layerId, color, geojson,text_field, mapId) {
// console.log("layerId: ",layerId);
let source = Vue.config.maps[mapId].getSource(layerId); let source = Vue.config.maps[mapId].getSource(layerId);
if (!source) { if (!source) {
Vue.config.maps[mapId].addSource(layerId, { Vue.config.maps[mapId].addSource(layerId, {
@ -490,7 +488,7 @@ export async function loadJsonPointFeature(layerId, color, geojson, mapId) {
'icon-image': 'dot.png', 'icon-image': 'dot.png',
'icon-size': 0.5, 'icon-size': 0.5,
// get the title name from the source's "title" property // get the title name from the source's "title" property
'text-field': ['get', 'sample_name'], 'text-field': ['get', text_field],
'text-font': [ 'text-font': [
'Open Sans Semibold', 'Open Sans Semibold',
'Arial Unicode MS Bold' 'Arial Unicode MS Bold'