${escapeHTML(node.name)}${escapeHTML(label)}
${node.kind === 'vehicle' ? `
${dict.onlineText} ${node.online}
` : ''}
`;
+ const marker = new AMap.Marker({ position: node.lnglat, content: markerContent, offset: new AMap.Pixel(-30, -12), title: node.name });
const infoWindow = new AMap.InfoWindow({
isCustom: true,
- content: `
- ${escapeHTML(node.name)}${escapeHTML(node.detail || '')}
${node.kind === 'vehicle' ? `
${dict.onlineText}: ${node.online}/${node.count} · ${formatNumber(node.dist, 1)} km
` : ''}
`,
offset: new AMap.Pixel(0, -32)
});
-
marker.on('mouseover', () => infoWindow.open(map, node.lnglat));
marker.on('mouseout', () => infoWindow.close());
- marker.on('click', () => filterByProvince(node.name));
-
- marker.setMap(map);
- markerList.push(marker);
- });
-}
-
-// ==========================================
-// RIGHT PANEL INTERACTION & RANKING LIST
-// ==========================================
-function switchRankTab(type) {
- currentRankType = type;
- document.querySelectorAll('.gtab').forEach(b => b.classList.remove('active'));
- event.target.classList.add('active');
- renderRankingList(type);
+ if (node.kind === 'stationCluster') marker.on('click', () => map.setZoomAndCenter(7.2, node.lnglat));
+ marker.setMap(map); markerList.push(marker);
+ }
}
function renderRankingList(type) {
const box = document.getElementById('rankingListBox');
- if (!box) return;
+ if (!box || !dashboard) return;
box.innerHTML = '';
-
- let list = [...vehicleGeoNodes];
- if (type === 'fleet') {
- list.sort((a, b) => b.count - a.count);
- } else {
- list.sort((a, b) => b.dist - a.dist);
- }
-
- const dict = i18n[currentLang];
-
- list.forEach((item, idx) => {
- const div = document.createElement('div');
- div.className = 'rank-glass-row';
- const topClass = idx === 0 ? 'r-top1' : (idx === 1 ? 'r-top2' : (idx === 2 ? 'r-top3' : ''));
- const displayName = getLocalizedProv(item.name);
- const valText = type === 'fleet' ? `${item.count} ${dict.unitVehicles}` : `${(item.dist / 1000).toFixed(1)}k km`;
-
- div.innerHTML = `
-