ADD вывод описания фрагмента трека на карте

This commit is contained in:
Krivchikov Dmitry 2016-05-30 00:17:06 +03:00
parent d599374442
commit b7184ad02b
2 changed files with 2 additions and 1 deletions

View File

@ -637,6 +637,7 @@ class JsonController extends Controller
$resTracks[] = array( $resTracks[] = array(
'name' => (string) $track->name, 'name' => (string) $track->name,
'description' => $track->description,
'length' => 0, 'length' => 0,
'latlngs' => $resLatlngs, 'latlngs' => $resLatlngs,
); );

View File

@ -55,7 +55,7 @@ function loadTrack(id)
colorIndex = (colorIndex == colors.length-1) ? 0 : colorIndex+1; colorIndex = (colorIndex == colors.length-1) ? 0 : colorIndex+1;
tracks[i] = L.polyline(data.tracks[i].latlngs, {color: color, width: 4, opacity: 0.8}); tracks[i] = L.polyline(data.tracks[i].latlngs, {color: color, width: 4, opacity: 0.8});
tracks[i].bindPopup(data.tracks[i].name); tracks[i].bindPopup('<b>' + data.tracks[i].name + '</b><br/>' + data.tracks[i].description);
trips[id].addLayer(tracks[i]) trips[id].addLayer(tracks[i])
} }
} }