Affix Posted January 28, 2013 Report Share Posted January 28, 2013 Add the following to lib/js/acarsmap.js var weatherLayer = new google.maps.weather.WeatherLayer({ temperatureUnits: google.maps.weather.TemperatureUnit.FAHRENHEIT }); weatherLayer.setMap(map); var cloudLayer = new google.maps.weather.CloudLayer(); cloudLayer.setMap(map); Quote Link to comment Share on other sites More sharing options...
AlessandroCuba Posted January 28, 2013 Report Share Posted January 28, 2013 You could put the entire code of your website?. Thank Quote Link to comment Share on other sites More sharing options...
mattia Posted January 28, 2013 Report Share Posted January 28, 2013 Hi Affix you can help me with this http://forum.phpvms.net/topic/8530-acars-map-update/ Quote Link to comment Share on other sites More sharing options...
Strider Posted January 29, 2013 Report Share Posted January 29, 2013 Need more info of where to put this. What line, or does it matter. Quote Link to comment Share on other sites More sharing options...
Colin Posted February 17, 2013 Report Share Posted February 17, 2013 Any ideas where this code goes as I've tried pretty much everywhere in the acarsmap.js and can't seem to get it to work Quote Link to comment Share on other sites More sharing options...
flyalaska Posted February 18, 2013 Report Share Posted February 18, 2013 Any ideas where this code goes as I've tried pretty much everywhere in the acarsmap.js and can't seem to get it to work The code doesn't work for me either. Im sure it has to go in the right spot. http://www.globalvirtualair.com/index.php/acars Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted February 18, 2013 Moderators Report Share Posted February 18, 2013 I can see that it works fine... Quote Link to comment Share on other sites More sharing options...
flyalaska Posted February 18, 2013 Report Share Posted February 18, 2013 I can see that it works fine... That was from the posters site. Quote Link to comment Share on other sites More sharing options...
Atcarrillo Posted February 18, 2013 Report Share Posted February 18, 2013 /** * phpVMS - Virtual Airline Administration Software * Copyright (c) 2008 Nabeel Shahzad * For more information, visit www.phpvms.net * Forums: http://www.phpvms.net/forum * Documentation: http://www.phpvms.net/docs * * phpVMS is licenced under the following license: * Creative Commons Attribution Non-commercial Share Alike (by-nc-sa) * View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/3.0/ * * @author Nabeel Shahzad * @copyright Copyright (c) 2008, Nabeel Shahzad * @link http://www.phpvms.net * @license http://creativecommons.org/licenses/by-nc-sa/3.0/ * * Rewritten for Google Maps v3 */ var flightMarkers = []; var routeMarkers = []; var flightPath = null; var depMarker = null, arrMarker = null; var info_window= null; var run_once = false; var defaultOptions = { autozoom: true, zoom: 4, center: new google.maps.LatLng(-25.363882,131.044922), mapTypeId: google.maps.MapTypeId.TERRAIN, refreshTime: 12000, autorefresh: true }; var options = $.extend({}, defaultOptions, acars_map_defaults); var map = new google.maps.Map(document.getElementById("acarsmap"), options); var weatherLayer = new google.maps.weather.WeatherLayer({ temperatureUnits: google.maps.weather.TemperatureUnit.FAHRENHEIT }); weatherLayer.setMap(map); var cloudLayer = new google.maps.weather.CloudLayer(); cloudLayer.setMap(map); // They clicked the map google.maps.event.addListener(map, 'click', function() { //clearPreviousMarkers(); }); liveRefresh(); if(options.autorefresh == true) { setInterval(function () { liveRefresh(); }, options.refreshTime); } function liveRefresh() { $.ajax({ type: "GET", url: url + "/action.php/acars/data", dataType: "json", cache: false, success: function(data) { populateMap(data); } }); }; function populateMap(data) { clearMap(); $("#pilotlist").html(""); if (data.length == 0) { return false; } var lat, lng; var details, row, pilotlink; var bounds = new google.maps.LatLngBounds(); for (var i = 0; i < data.length; i++) { if(data[i] == null || data[i].lat == null || data[i].lng == null || data[i].lat == "" || data[i].lng == "") { continue; } lat = data[i].lat; lng = data[i].lng; if(i%2 == 0) data[i].trclass = "even"; else data[i].trclass = "odd"; // Pull ze templates! var map_row = tmpl("acars_map_row", {flight: data[i]}); var detailed_bubble = tmpl("acars_map_bubble", {flight: data[i]}); $('#pilotlist').append(map_row); var pos = new google.maps.LatLng(lat, lng); flightMarkers[flightMarkers.length] = new google.maps.Marker({ position: pos, map: map, icon: url+"/lib/images/inair/"+data[i].heading+".png", flightdetails: data[i], infowindow_content: detailed_bubble }); bounds.extend(pos); google.maps.event.addListener(flightMarkers[flightMarkers.length - 1], 'click', function() { clearPreviousMarkers(); var focus_bounds = new google.maps.LatLngBounds(); // Flight details info window info_window = new google.maps.InfoWindow({ content: this.infowindow_content, position: this.position }); info_window.open(map, this); // Add polyline, and start/end points var dep_location = new google.maps.LatLng(this.flightdetails.deplat, this.flightdetails.deplng); var arr_location = new google.maps.LatLng(this.flightdetails.arrlat, this.flightdetails.arrlng); depMarker = new google.maps.Marker({ position: dep_location, map: map, icon: depicon, title: this.flightdetails.depname, zIndex: 100 }); arrMarker = new google.maps.Marker({ position: arr_location, map: map, icon: arricon, title: this.flightdetails.arrname, zIndex: 100 }); // Now the flight path, if it exists var path = new Array(); path[path.length] = dep_location; focus_bounds.extend(dep_location); if(this.flightdetails.route_details.length > 0) { $.each(this.flightdetails.route_details, function(i, nav) { var loc = new google.maps.LatLng(nav.lat, nav.lng); if(nav.type == 3) icon = "icon_vor.png"; else icon = "icon_fix.png"; var navpoint_info = tmpl("navpoint_bubble", {nav: nav}); routeMarkers[routeMarkers.length] = new google.maps.Marker({ position: loc, map: map, icon: url + "/lib/images/"+icon, title: nav.title, zIndex: 100, infowindow_content: navpoint_info }); google.maps.event.addListener(routeMarkers[routeMarkers.length - 1], 'click', function() { info_window = new google.maps.InfoWindow({ content: this.infowindow_content, position: this.position }); info_window.open(map, this); }); path[path.length] = loc; focus_bounds.extend(loc); }); } path[path.length] = arr_location; focus_bounds.extend(this.position); focus_bounds.extend(arr_location); flightPath = new google.maps.Polyline({ path: path, strokeColor: "#FF0000", strokeOpacity: 1.0, strokeWeight: 2 }); map.fitBounds(focus_bounds); flightPath.setMap(map); }); } // If they selected autozoom, only do the zoom first time if(options.autozoom == true && run_once == false) { map.fitBounds(bounds); run_once = true; } } function clearPreviousMarkers() { if(info_window) { info_window.close(); info_window = null; } if(depMarker != null) { depMarker.setMap(null); depMarker = null; } if(arrMarker != null) { arrMarker.setMap(null); arrMarker = null; } if(routeMarkers.length > 0) { for(var i = 0; i < routeMarkers.length; i++) { routeMarkers[i].setMap(null); } } routeMarkers.length = 0; if(flightPath != null) { flightPath.setMap(null); flightPath = null; } } function clearMap() { if(flightMarkers.length > 0) { for(var i = 0; i < flightMarkers.length; i++) { flightMarkers[i].setMap(null); } } flightMarkers.length = 0; if(routeMarkers.length > 0) { for(var i = 0; i < routeMarkers.length; i++) { routeMarkers[i].setMap(null); } } routeMarkers.length = 0; } and you must put this: <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=weather&sensor=false"> </script> in your acarsmap.tpl header Quote Link to comment Share on other sites More sharing options...
flyalaska Posted February 18, 2013 Report Share Posted February 18, 2013 Works perfect. Thank you! http://www.flyaka.com/index.php/acars Quote Link to comment Share on other sites More sharing options...
Mike Posted February 22, 2013 Report Share Posted February 22, 2013 This looks great - just trying to figure out where this goes in acarsmap.tpl - does something have to be removed and then put the line below in? <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=weather&sensor=false"> </script> Quote Link to comment Share on other sites More sharing options...
Mike Posted February 26, 2013 Report Share Posted February 26, 2013 Arr... not to worry... got it sorted. Looks awesome - Thanks Quote Link to comment Share on other sites More sharing options...
Kapitan Posted March 25, 2013 Report Share Posted March 25, 2013 Arr... not to worry... got it sorted. Looks awesome - Thanks Where you put that code Quote Link to comment Share on other sites More sharing options...
Kapitan Posted March 28, 2013 Report Share Posted March 28, 2013 Arr... not to worry... got it sorted. Looks awesome - Thanks Can you share how ? Quote Link to comment Share on other sites More sharing options...
Gantcho Posted April 1, 2013 Report Share Posted April 1, 2013 I steel have this problem http://www.bgairva.com/index.php/acars Quote Link to comment Share on other sites More sharing options...
Gantcho Posted April 9, 2013 Report Share Posted April 9, 2013 Ok I am ok now Thanks Quote Link to comment Share on other sites More sharing options...
CptLiam Posted April 30, 2013 Report Share Posted April 30, 2013 I cant seem to get this going :S , where do i put the <script type="text/javascript" src="https://maps.googlea...r&sensor=false"> </script> ? Thanks Quote Link to comment Share on other sites More sharing options...
FSX30HD Posted May 1, 2013 Report Share Posted May 1, 2013 Hello, Look at my source code here http://www.skydream-airlines.com/index.php/acars everything work fine also the function "Toggle icons" An other working exemple https://gmaps-samples-v3.googlecode.com/svn-history/r287/trunk/weather/weather_layer.html Quote Link to comment Share on other sites More sharing options...
simonecatalano Posted August 17, 2013 Report Share Posted August 17, 2013 (edited) DELETED BY ME Edited February 24, 2014 by simonecatalano Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.