IM STUCK >:(. Cannot figure anything out
This commit is contained in:
@ -38,18 +38,9 @@
|
||||
|
||||
// Function to handle form submission
|
||||
document.getElementById('search-form').addEventListener('submit', function(event) {
|
||||
//event.preventDefault(); // Prevent the form from submitting normally
|
||||
var tak = document.getElementById('bus-id').value.trim();
|
||||
socket.emit('takSearch', tak);
|
||||
});
|
||||
socket.on('takSearch', function(data) {
|
||||
// Process the received data and update the map accordingly
|
||||
// For example:
|
||||
data.forEach(function(item) {
|
||||
var marker = L.marker([item.latitude, item.longitude]).addTo(map);
|
||||
marker.bindPopup(`Transport Type: ${item.transportType}<br>Line Number: ${item.lineNumber}<br>TAK: ${item.tak}`);
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user