Maps & schedules - Space Coast Area Transit (2024)

' + place.name + '
' + address }); infoWindow.open(map2, t_marker); }); markers.push(t_marker); google.maps.event.addListener(map2, 'click', function (event) { DeleteMarkers(markers); placeMarker1(event.latLng, "end", pincolor); }); var address = ''; if (place.address_components) { address = [ (place.address_components[0] && place.address_components[0].short_name || ''), (place.address_components[1] && place.address_components[1].short_name || ''), (place.address_components[2] && place.address_components[2].short_name || '') ].join(' '); } infowindow.setContent('

' + place.name + '
' + address); infowindow.open(map2, t_marker); } }); } function buildTripPlanner() { } function buildAdditionalInfo() { if (showAdditionalInfo) { var publicURL = window.location.origin; var Link1URL = ''; var Graphic1 = ''; var Link2URL = ''; var Graphic2 = ''; var Link3URL = ''; var Graphic3 = ''; var Link4URL = ''; var Graphic4 = ''; additionalInfoContent = additionalInfoContent + '

'; if (Link1URL != "" && Graphic1 != "") { if (Graphic1.indexOf(publicURL) == -1) Graphic1 = publicURL + "\/" + Graphic1; var sponsorElem = '

' + '

'; additionalInfoContent += sponsorElem; } if (Link2URL != "" && Graphic2 != "") { if (Graphic2.indexOf(publicURL) == -1) Graphic2 = publicURL + "\/" + Graphic2; var sponsorElem = '

'; additionalInfoContent += sponsorElem; } if (Link3URL != "" && Graphic3 != "") { if (Graphic3.indexOf(publicURL) == -1) Graphic3 = publicURL + "\/" + Graphic3; var sponsorElem = '

' + '

'; additionalInfoContent += sponsorElem; } if (Link4URL != "" && Graphic4 != "") { if (Graphic4.indexOf(publicURL) == -1) Graphic4 = publicURL + "\/" + Graphic4; var sponsorElem = '

' + '

'; additionalInfoContent += sponsorElem; } additionalInfoContent += '

'; console.log(additionalInfoContent); if (1 == 0) { if (jQuery(window).width() <= viewportmoblesize) { jQuery("#add_info").html(""); jQuery("#addinfo").append(additionalInfoContent); } else { jQuery("#addinfo").html(""); jQuery("#add_info").append(additionalInfoContent); } jQuery("#s-addinfo").css('display', 'block'); } } } function buildRoutePolygons() { var sw = jQuery(window).width(); //console.log('buildRoutePolygons'); setTimeout(processPatternMetrics.bind(null, patternData.get_patterns), 0); var tempLineColor; var tempArrowColor; var tempRouteID; var routePatterns; var tempDecodedPath; var tempPolyline; var showPatterns = '1'; var routeLabelPositions = {}; var userRouteLabelPositions = {}; var uselog = 0; if (fullScreen) { try { routeLabelPositions = JSON.parse(''); userRouteLabelPositions = JSON.parse(''); } catch (e) { } } //console.log('routeData.get_routes'); //console.log(routeData.get_routes); for (routeIdx in routeData.get_routes) { tempRouteID = routeData.get_routes[routeIdx].id; if (jQuery.inArray(tempRouteID, arrroutenotuses) == -1) { if (userRouteLabelPositions && userRouteLabelPositions[tempRouteID]) { var latLng = userRouteLabelPositions[tempRouteID].split(','); // function exists in custom template if (showRouteLabels) { showRouteLabels(latLng, routeData.get_routes[routeIdx].name); } } else if (routeLabelPositions && routeLabelPositions[tempRouteID]) { var latLng = routeLabelPositions[tempRouteID].split(','); // function exists in custom template if (showRouteLabels) { showRouteLabels(latLng, routeData.get_routes[routeIdx].name); } } // initialize array routeMapData[tempRouteID] = []; routeMapData[tempRouteID]['color'] = routeData.get_routes[routeIdx].color; tempLineColor = routeData.get_routes[routeIdx].color; tempArrowColor = getLightDark(routeData.get_routes[routeIdx].color); routeMapData[tempRouteID]['polygons'] = []; if (showPatterns) { var ispass = 1; routePatterns = getRoutePatterns(tempRouteID); //console.log('routePatterns=' + tempRouteID); //console.log(routePatterns); //ispass = 0; if (ispass) { //console.log('tempRouteID='+tempRouteID); var logline = ''; for (var i = 0; i < routePatterns.length; i++) { if (routePatterns[i].hasOwnProperty('encLine') && routePatterns[i].encLine != null) { tempDecodedPath = google.maps.geometry.encoding.decodePath(routePatterns[i].encLine); //console.log(routePatterns[i].name+'|'+tempDecodedPath); //console.log(tempDecodedPath); if (tempDecodedPath.toString() != '') { if (logline != '') { logline += ','; } logline += tempDecodedPath.toString(); } tempPolyline = new google.maps.Polyline({ path: tempDecodedPath, strokeColor: tempLineColor, strokeOpacity: .8, strokeWeight: 8, icons: [{ icon: { path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW, strokeColor: tempLineColor, strokeOpacity: .8, strokeWeight: 1.0, fillColor: tempArrowColor, fillOpacity: .8, scale: 3 }, repeat: '5%', offset: '1%' }] }); tempPolyline = new google.maps.Polyline({ path: tempDecodedPath, strokeColor: tempLineColor, strokeOpacity: .4, strokeWeight: 4 }); routeMapData[tempRouteID]['polygons'].push(tempPolyline); routeMapData[tempRouteID]['selected'] = false; } } } } else { tempDecodedPath = google.maps.geometry.encoding.decodePath(routeData.get_routes[routeIdx].encLine); tempPolyline = new google.maps.Polyline({ path: tempDecodedPath, strokeColor: tempLineColor, strokeOpacity: .8, strokeWeight: 8, icons: [{ icon: { path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW, strokeColor: tempLineColor, strokeOpacity: .8, strokeWeight: 1.0, fillColor: tempArrowColor, fillOpacity: .8, scale: 3 }, repeat: '5%', offset: '1%' }] }); routeMapData[tempRouteID]['polygons'].push(tempPolyline); routeMapData[tempRouteID]['selected'] = false; } } } //console.log('routeMapData'); //console.log(routeMapData); } function getStopEtas(sid, callback) { //console.log('getStopEtas'); var paramsObject = {}; //for the ETA's for Custom sites need all eta's data for every rotute has it is limited to 3 passing noLimit to get all data if (custUpdateArrivalCall) { paramsObject.noLimit = 1; } paramsObject.stopID = sid; paramsObject.statusData = 1; var urlSubmit = ajax_site_temp + '/ajaxfunction.php'; var serviceName = 'get_stop_etas'; var somedata = {action: 'get_eta_api', 'serviceName': serviceName}; //console.log(paramsObject); jQuery.each(paramsObject, function (key, val) { //console.log('key=' + key + '|val=' + val); //somedata.push({key : val}); somedata[key] = val; }); //console.log(somedata); jQuery.post(urlSubmit, somedata).done(function (data) { //console.log(data); var res = jQuery.parseJSON(data); //console.log(res); //console.log(res.dataeta); var dataeta = res.dataeta; callback(dataeta); }); } function getStopInfoWindowContent(marker, amount, bor_color, m_color, auto) { var data; stopMarkerObj = [marker, amount, bor_color, m_color, auto]; getStopEtas(marker.dataObject.stop.id, function (data) { if (data.hasOwnProperty("get_stop_etas") && data['get_stop_etas'].length > 0 && data['get_stop_etas'][0].hasOwnProperty("enRoute")) { var stopData = data.get_stop_etas[0]['enRoute']; } if (stopData && stopData.length > 0) { stationMin = stopData[0]['minutes']; } else { stationMin = null; } if (!auto) { populateStopInfoWindowContent(data, marker, amount, bor_color, m_color); } if (stationMin != stationPopup.min && stationPopup.id == marker.dataObject.stop.id && stationPopup.open) { populateStopInfoWindowContent(data, marker, amount, bor_color, m_color, true); } stationPopup.id = marker.dataObject.stop.id; stationPopup.open = true; stationPopup.min = stationMin; marqueeGo(jQuery('.StopInfo .eta-marquee')); if (stationInterval) { clearTimeout(stationInterval); } stationInterval = setTimeout(function () { // consumes more data as it gets data frequently if (stationPopup.open && marker.dataObject.stop.id == stationPopup.id) { getStopInfoWindowContent(marker, amount, bor_color, m_color, true) } }, 8000); if (jQuery(window).width() <= viewportmoblesize) { jQuery(document).on('click', function () { if (stationInterval) { clearTimeout(stationInterval); } stationPopup.open = false; stationPopup.id = null; }); } }); } function getRouteDataByID(routeID) { for (var route = 0; route < routeData.get_routes.length; route++) { if (routeData.get_routes[route].id == routeID) { return routeData.get_routes[route]; } } return false; } function getVehicleDataByID(vehicleID) { if (vehicleData[vehicleID] instanceof Object) { return vehicleData[vehicleID]; } return false; } function getStopDataByID(stopID) { for (var stop = 0; stop < stopData.get_stops.length; stop++) { if (stopData.get_stops[stop].id == stopID) { return stopData.get_stops[stop]; } } return false; } function getStopDataWithId(stopdata, favarray) { for (var i = 0; i < favarray.length; i++) { data = favarray[i]; if (stopdata.get_stop_etas[0].id == data.get_stop_etas[0].id) return true; } return false; } function populateStopInfoWindowContent(stopData, marker, amount, bor_color, m_color, update, nextSchedule) { var fullContent = ""; //getfavorites cookies and checkboxstatus var favstops; favstops = getCookie('favorite_stations'); var currentstop = marker.dataObject.stop.id; if (favstops == '' || favstops == null) { // do cookie doesn't exist stuff; } else { var favarray = JSON.parse(favstops); var i = getStopDataWithId(stopData, favarray); if (!i) { checkboxstatus = ""; } else { checkboxstatus = "checked"; } } //if (marker.dataObject.route.type == "Loop" || marker.dataObject.route.type == "Linear") { //CHANGE fullContent = uniqueStopMenu ? buildUniqueStopPopupContent(stopData, marker, amount, bor_color, m_color, nextSchedule) : buildLoopStopPopupContent(stopData, marker, amount, bor_color, m_color); // } // else { //if (marker.dataObject.route.type == "Inbound") { // fullContent = buildScheduledStopStatusPopupContent(stopData, marker, amount); //CHANGE // } //console.log('fullContent=' + fullContent); if (fullContent == null) { return; } if (jQuery(window).width() <= viewportmoblesize) { closeStopMarker(); if (jQuery('#myModal').length > 0) { jQuery("#marker_modal").html(fullContent); jQuery('#myModal').modal('show'); }else{ if (jQuery('#myMoreReal').length > 0) { jQuery('#myMoreRealTime').html(fullContent); jQuery('#myMoreReal').modal('show'); } } jQuery('.modal-backdrop').css('z-index', '1'); google.maps.event.addListener(marker, 'click', function () { map.panTo(this.getPosition()); jQuery('.modal-backdrop').css('z-index', '1'); }); } else { if (jQuery('#myMoreRealTime').length > 0) { jQuery('#myMoreRealTime').html(fullContent); } if (!update) { marker.dataObject['InfoWindow'].setContent(fullContent); marker.dataObject['InfoWindow'].open(map, marker); openedStopInfoMarker = marker; } else { jQuery('[class^=StopInfo].r' + marker.dataObject.stop.id).replaceWith(fullContent); } //placing the info window bottom of the map var divHeightOfTheMap = document.getElementById('map').clientHeight; var offSetFromBottom = divHeightOfTheMap / 10; map.setCenter(marker.getPosition()); var yh = -(divHeightOfTheMap / 2 - offSetFromBottom); yh = -((divHeightOfTheMap - 771) / 2); yh = - 225; //console.log('divHeightOfTheMap='+divHeightOfTheMap+'|offSetFromBottom='+offSetFromBottom+'|yh='+yh); map.panBy(0, yh); google.maps.event.addDomListener(openedStopInfoMarker.dataObject['InfoWindow'].bubble_, 'click', function () { // closeStopMarker(); resetValues(); }); } } function resetValues() { stopMarkerObj = []; vehicleMarkerObj = []; } function buildUniqueStopPopupContent(stopData, marker, amount, b_color, bg_color, nextSchedule) { var hasContent = false; var textColor; var routeContent = ''; var fullContent = ''; var count; var stopContent = []; var tempRouteData; var origRouteData = marker.dataObject.route; var tempStopData = marker.dataObject.stop; var tempVehicleData; var vehicleIdentifier = ''; var vehicleTrack = ''; var vehicleDir = ''; var route_tooltip = 'Route :'; //route_id = marker.dataObject.route.id; //route_type = marker.dataObject.route.type; //route_name = marker.dataObject.route.name; stop_Data = stopData; stop_name = marker.dataObject.stop.name; schedule_stop_id = marker.dataObject.stop.id; schedule_stop_color = b_color; schedule_stop_color_light = bg_color; stop_marker = marker; var comments = "&nbsp"; var type = ""; var stop_desc = ""; stop_images = []; var amenities = ''; var amenitiesString = ''; var showDirection = false; // origRouteData.showDirection; var showPlatform = false; //origRouteData.showPlatform; var stop_type = "Stop"; if (stop_type == "Station") { type = "Station"; } else { type = "Basic"; } var stopInRoutes = []; for (var routeIndex = 0; routeIndex < routeData.get_routes.length; routeIndex++) { var stops_array = []; stops_array = routeData.get_routes[routeIndex]['stops']; for (var index = 0; index < stops_array.length; index++) { if (schedule_stop_id == stops_array[index]) { //instead of using colors, using route id's to validate stop exists in respective route if (stopInRoutes.indexOf(routeData.get_routes[routeIndex]['id']) == -1) { stopInRoutes.push(routeData.get_routes[routeIndex]['id']); route_tooltip = route_tooltip + ''; } if (routeData.get_routes[routeIndex]['showDirection']) { showDirection = true; } if (routeData.get_routes[routeIndex]['showPlatform']) { showPlatform = true; } } } } if (StopDetails) { for (var i = 0; i < stopdetailsData.get_stopimages.length; i++) { if (stopdetailsData.get_stopimages[i].stopid == schedule_stop_id) { comments = stopdetailsData.get_stopimages[i].comments ? stopdetailsData.get_stopimages[i].comments : '-'; type = stopdetailsData.get_stopimages[i].type ? stopdetailsData.get_stopimages[i].type : 'Basic'; stop_desc = stopdetailsData.get_stopimages[i].stoplocdesc ? stopdetailsData.get_stopimages[i].stoplocdesc : ''; stop_images = stopdetailsData.get_stopimages[i].images; stop_images = stop_images.filter(function (v) { return v !== '' }); if (stopdetailsData.get_stopimages[i].amenities) { amenities = stopdetailsData.get_stopimages[i].amenities; } } } if (amenities != "") { var stop_amenities = amenities.split(","); var stopPropertiesColor = getLightDark("#ffffff"); stop_amenities = stop_amenities.filter(function (e) { return e === 0 || e }); for (i = 0; i < stop_amenities.length; i++) { if (stopPropertiesColor == "#454545") { var src = "http://321transit.etaspot.net/Content/images/Amenities/" + stop_amenities[i].replace(/\//g, '').replace(/ /g, '').replace(/-|\s/g, "").replace(/\(|\)/g, "").trim() + ".png"; } else { var src = "http://321transit.etaspot.net/Content/images/AmenitiesWhite/" + stop_amenities[i].replace(/\//g, '').replace(/ /g, '').replace(/-|\s/g, "").replace(/\(|\)/g, "").trim() + ".png"; } amenitiesString = amenitiesString + 'Maps & schedules - Space Coast Area Transit (5)'; } } } var stopTypeColor = getLightDark("#ffffff"); if (stopTypeColor == "#454545") { var stopTypeImagesrc = "http://321transit.etaspot.net/Content/images/Amenities/" + type.replace(/\//g, '').replace(/ /g, '').replace(/-|\s/g, "").replace(/\(|\)/g, "").trim() + ".png"; } else { var stopTypeImagesrc = "http://321transit.etaspot.net/Content/images/AmenitiesWhite/" + type.replace(/\//g, '').replace(/ /g, '').replace(/-|\s/g, "").replace(/\(|\)/g, "").trim() + ".png"; } var stopTypeImage = 'Maps & schedules - Space Coast Area Transit (6)'; if (scheduleMenu) { var scheduleParamsObject = {}; scheduleParamsObject.service = 'get_schedules'; scheduleParamsObject.stopID = schedule_stop_id; scheduleParamsObject.includeETAData = 1; scheduleParamsObject.orderedETAArray = 1; scheduleParamsObject.token = serviceTOK; var serviceName = 'get_vehicles'; var urlSubmit = ajax_site_temp + '/ajaxfunction.php'; var somedata = {action: 'get_eta_api', 'serviceName': serviceName}; jQuery.each(scheduleParamsObject, function (key, val) { //console.log('key=' + key + '|val=' + val); //somedata.push({key : val}); somedata[key] = val; }); jQuery.post(urlSubmit, somedata).done(function (data) { //console.log(data); var res = jQuery.parseJSON(data); //console.log(res); console.log('buildUniqueStopPopupContent'); console.log(res.dataeta); var dataeta = res.dataeta; handleConsoleDataSchedule(dataeta); }); } var configuredRouteData = false; var vehicleRouteData; console.log('stopData='); console.log(stopData); if (stopData.hasOwnProperty("get_stop_etas") && stopData['get_stop_etas'].length > 0 && stopData['get_stop_etas'][0].hasOwnProperty("enRoute")) { for (var stopIndex = 0; stopIndex < stopData.get_stop_etas[0]['enRoute'].length; stopIndex++) { var enRoute = stopData.get_stop_etas[0]['enRoute'][stopIndex]; tempVehicleData = getVehicleDataByID(stopData.get_stop_etas[0]['enRoute'][stopIndex]['equipmentID']); var routeID = stopData.get_stop_etas[0]['enRoute'][stopIndex]['routeID']; if (tempVehicleData && tempVehicleData.routeID != noRouteID) { // when combining sites we need the ETAs in order in the stop popup // since the different sites will have different routeIDs, use the first routeData we encounter for indexing // and create a vehicle specific route data object that will be used for the display. if ((!combineURLData) || (combineURLData && !configuredRouteData)) { configuredRouteData = true; //tempRouteData = getRouteDataByID(tempVehicleData.routeID); tempRouteData = getRouteDataByID(routeID); } //vehicleRouteData = getRouteDataByID(tempVehicleData.routeID); vehicleRouteData = getRouteDataByID(routeID); if (!(stopContent[tempRouteData.id] instanceof Array)) { stopContent[tempRouteData.id] = []; stopContent[tempRouteData.id]['count'] = 0; stopContent[tempRouteData.id]['vehicles'] = ''; routeContent = '

'; stopContent[tempRouteData.id]['route'] = routeContent; } if (!hasContent) { hasContent = true; textColor = routeMapData[origRouteData.id]['color']['text']; etaTextColor = routeMapData[origRouteData.id]['color']['etaText']; } if (stopContent[tempRouteData.id]['count'] < amount) { if (tempVehicleData.vehicleType.toLowerCase() == 'bus') { vehicleIdentifier = tempVehicleData['equipmentID']; } else { vehicleIdentifier = tempVehicleData['equipmentID']; } if (vehicleRouteData.showPlatform) { vehicleTrack = enRoute.track; } else { vehicleTrack = ''; } if (vehicleRouteData.showDirection) { vehicleDir = enRoute.directionAbbr; } else { vehicleDir = ''; } var stopHeaderContent = ''; if (vehicleRouteData.name && vehicleRouteData.name.length > 15) { stopHeaderContent = '

' + vehicleRouteData.name + '

'; } else { stopHeaderContent = vehicleRouteData.name; } stopHeaderContent = '

' + vehicleRouteData.name + '

'; var directionAbbr = ''; var colspan = 2; if (showDirection) { colspan++; directionAbbr = ''; } if (showPlatform) { colspan++; } stopContent[tempRouteData.id]['vehicles'] = stopContent[tempRouteData.id]['vehicles'] + ''; stopContent[tempRouteData.id]['vehicles'] += directionAbbr; if (1 == 0) { stopContent[tempRouteData.id]['vehicles'] += ''; } if (showPlatform) { stopContent[tempRouteData.id]['vehicles'] += ''; } stopContent[tempRouteData.id]['vehicles'] += ''; stopContent[tempRouteData.id]['count']++; } } } } var textColor = getLightDark("#0a4e9e"); var StopName = ''; var stopNameLength = tempStopData.name.length; if (stopNameLength <= 30) { StopName = '' + tempStopData.name + ''; } else { StopName = '' + tempStopData.name + ''; } if (1 == 1) { var StopName1 = tempStopData.name; var ppw = 480; if (jQuery(window).width() < ppw) { ppw = 320; } //console.log(marker.dataObject); //console.log('ppw=' + ppw); //console.log(tempStopData); //console.log(marker.dataObject); var dataroute = marker.dataObject.route; var rid = tempStopData.rid; var iconpath = site_url + '/wp-content/themes/strida/img/sbus' + rid + '.png'; var img = 'Maps & schedules - Space Coast Area Transit (7)'; img = ''; var bgurl = 'https://maps.googleapis.com/maps/api/staticmap?key=AIzaSyCPWFM03sxJk_HoJq00WOxjvs7otZb2ZCA&center=' + tempStopData.lat + ',' + tempStopData.lng + '&zoom=16&size=480x240&format=png&maptype=roadmap&scale=2'; fullContent = '

'; fullContent += "

"; fullContent += '

' + vehicleDir + '
' + stopHeaderContent + '' + vehicleIdentifier + '' + vehicleTrack + '' + this.getETAString(stopData.get_stop_etas[0]['enRoute'][stopIndex]['minutes']) + '
' + img + '

' + StopName1 + '

'; if (1 == 0) { fullContent += "

"; fullContent += ""; if (scheduleMenu) { fullContent += ''; } fullContent += ""; fullContent += ""; fullContent += "
" + stopTypeImage + "Stop Type:" + type + "Maps & schedules - Space Coast Area Transit (8)
" + route_tooltip + "

"; } fullContent += "

" + img + "

"; var btnFavorites = ' '; var btnDirections = ''; if (showTripPlanner) { btnDirections = ''; btnDirections += ''; btnDirections += ""; btnDirections += ''; } var haftw = parseInt(ppw / 2) - 1; fullContent += "

" + btnFavorites + "" + btnDirections + "

"; fullContent += '

'; fullContent += '

'; fullContent += '

'; fullContent += '

'; fullContent += ' UPCOMING ARRIVALS '; fullContent += '

'; fullContent += '

'; fullContent += '

'; fullContent += '

'; var colspan = 2; if (showDirection) { colspan++; } if (showPlatform) { colspan++; } fullContent += ''; var etaHeader = 'ETA'; //nextSchedule?'TIME':'ETA'; if (showDirection) { fullContent += ''; } if (1 == 0) { fullContent += ''; colspan++; } if (showPlatform) { fullContent += ''; } fullContent += ''; if (!hasContent) { if (scheduleMenu) { fullContent += ''; } else { fullContent += ''; } } else { for (var routeIndex in stopContent) { if (routeIndex != 'header') { fullContent += stopContent[routeIndex]['route']; fullContent += stopContent[routeIndex]['vehicles']; fullContent += '
RouteDirBus#Track' + etaHeader + '
View Schedules
No Buses In Service To This Stop.

'; } } } var stop = "text_input" + tempStopData.id; currentImageIndex = 0; fullContent += '

'; fullContent += '

Maps & schedules - Space Coast Area Transit (2024)
Top Articles
Latest Posts
Article information

Author: Saturnina Altenwerth DVM

Last Updated:

Views: 5718

Rating: 4.3 / 5 (44 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Saturnina Altenwerth DVM

Birthday: 1992-08-21

Address: Apt. 237 662 Haag Mills, East Verenaport, MO 57071-5493

Phone: +331850833384

Job: District Real-Estate Architect

Hobby: Skateboarding, Taxidermy, Air sports, Painting, Knife making, Letterboxing, Inline skating

Introduction: My name is Saturnina Altenwerth DVM, I am a witty, perfect, combative, beautiful, determined, fancy, determined person who loves writing and wants to share my knowledge and understanding with you.