Virtualei Posted July 31, 2012 Report Posted July 31, 2012 Hi all, Was trying to change my Acars map to the weather version. All I can see in the local_config is # Valid types are G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP, G_PHYSICAL_MAP I tried changing my map to G_WEATHER_MAP but it doesnt work. Would anyone have an idea of how to do this please. Thanks in advance I have just tried adding this API key to to the local_config but still no joy <?php $xml = simplexml_load_file('http://www.google.co...a,croatia&hl=hr'); $information = $xml->xpath("/xml_api_reply/weather/forecast_information"); $current = $xml->xpath("/xml_api_reply/weather/current_conditions"); $forecast_list = $xml->xpath("/xml_api_reply/weather/forecast_conditions"); ?> Quote
James142 Posted August 3, 2012 Report Posted August 3, 2012 Is the google maps javascript version your using API v3? I believe that the weather option is only available in V3 Quote
Virtualei Posted August 3, 2012 Author Report Posted August 3, 2012 Thanks for the reply. yes it is V3 Quote
Virtualei Posted August 4, 2012 Author Report Posted August 4, 2012 This is what I would like my ACARS map to look like can anyone help please Quote
Virtualei Posted August 8, 2012 Author Report Posted August 8, 2012 I have tried everything is there anyone that can help please Quote
magicflyer Posted August 8, 2012 Report Posted August 8, 2012 Hello, You dont change your map display from the local.config. You would need to change it from the ACARS page(lib/skins/[yourskin here]/acarsmap.php). Look for the following line: var acars_map_defaults = { autozoom: true, zoom: 4, center: new google.maps.LatLng("<?php echo Config::Get('MAP_CENTER_LAT'); ?>", "<?php echo Config::Get('MAP_CENTER_LNG'); ?>"), mapTypeId: google.maps.MapTypeId.SATTELITE, refreshTime: 10000 }; mapTypeId: google.maps.MapTypeId.SATTELITE, You can change the Sattelite part to any of the following: MapTypeId.ROADMAP displays the default road map view MapTypeId.SATELLITE displays Google Earth satellite images MapTypeId.HYBRID displays a mixture of normal and satellite views MapTypeId.TERRAIN displays a physical map based on terrain information. This are the only supported by the google API. You will not be able to change it to weather map. I hope it helps Quote
Virtualei Posted August 8, 2012 Author Report Posted August 8, 2012 Thank you so much for your reply. I understand what you are saying but I have read on the google API V3 that you can add the weather Layer to the MapID using var mapOptions = { zoom: 6, center: new google.maps.LatLng(49.265984, -123.127491), mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); 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); I tried to put it in the acars js file but it didnt work Quote
James142 Posted August 8, 2012 Report Posted August 8, 2012 You need to replace <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> with <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&libraries=weather"></script> in your core_htmlhead.tpl file. I'm not sure if it will work with phpVMS but that's how I do it with my website. Kindest Regards, James Quote
Virtualei Posted August 8, 2012 Author Report Posted August 8, 2012 Thanks for your help James . I changed what you suggested but still no joy. I must need to change something else in PHPVMS also. I will get there. Any other suggestions Quote
mseiwald Posted August 8, 2012 Report Posted August 8, 2012 that works...put what James said in the core_htmlhead.tpl and in the acarsmap.js make it like that: var mapOptions = { zoom: 4, center: new google.maps.LatLng(38.065392, 23.642578), mapTypeId: google.maps.MapTypeId.SATELLITE }; var map = new google.maps.Map(document.getElementById("acarsmap"), mapOptions); var weatherLayer = new google.maps.weather.WeatherLayer({ temperatureUnits: google.maps.weather.TemperatureUnit.CELSIUS }); weatherLayer.setMap(map); var cloudLayer = new google.maps.weather.CloudLayer(); cloudLayer.setMap(map) var defaultOptions = { autozoom: false, refreshTime: 12000, autorefresh: true }; that works on my site. 1 Quote
Virtualei Posted August 8, 2012 Author Report Posted August 8, 2012 Yes at last guys thank you all. I can now relax that was really doing my head in lol Quote
Virtualei Posted August 8, 2012 Author Report Posted August 8, 2012 I spoke too soon. I am getting 1 map on top of the other. I think I need to disable the old one . When I try i am loosing the live flight info grrrrrrrrrrr Quote
James142 Posted August 8, 2012 Report Posted August 8, 2012 that works...put what James said in the core_htmlhead.tpl and in the acarsmap.js make it like that: var mapOptions = { zoom: 4, center: new google.maps.LatLng(38.065392, 23.642578), mapTypeId: google.maps.MapTypeId.SATELLITE }; var map = new google.maps.Map(document.getElementById("acarsmap"), mapOptions); var weatherLayer = new google.maps.weather.WeatherLayer({ temperatureUnits: google.maps.weather.TemperatureUnit.CELSIUS }); weatherLayer.setMap(map); var cloudLayer = new google.maps.weather.CloudLayer(); cloudLayer.setMap(map) var defaultOptions = { autozoom: false, refreshTime: 12000, autorefresh: true }; that works on my site. That part slipped my mind Quote
mseiwald Posted August 8, 2012 Report Posted August 8, 2012 hmm it works on my site...I just checked that again. That`s the whole top part of my acarsmap.js /** * 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 mapOptions = { zoom: 4, center: new google.maps.LatLng(38.065392, 23.642578), mapTypeId: google.maps.MapTypeId.SATELLITE }; var map = new google.maps.Map(document.getElementById("acarsmap"), mapOptions); var weatherLayer = new google.maps.weather.WeatherLayer({ temperatureUnits: google.maps.weather.TemperatureUnit.CELSIUS }); weatherLayer.setMap(map); var cloudLayer = new google.maps.weather.CloudLayer(); cloudLayer.setMap(map) var defaultOptions = { autozoom: false, refreshTime: 12000, autorefresh: true }; var options = $.extend({}, defaultOptions, acars_map_defaults); //var map = new google.maps.Map(document.getElementById("acarsmap"), options); Quote
mseiwald Posted August 8, 2012 Report Posted August 8, 2012 i see your problem hmm try remove the map type on the acarsmap.tpl and local_config.php Quote
CPC900 Posted August 9, 2012 Report Posted August 9, 2012 Manuel, I used your code for acarsmap.js and it worked fine for me. The one line I noticed that was different was, the coded out line: //var map = new google.maps.Map(document.getElementById("acarsmap"), options); That seemed to fix it. Quote
CPC900 Posted August 9, 2012 Report Posted August 9, 2012 Now, there no option to turn off the weather icons. is there?! Would be nice if pilots could turn on/off that. Quote
Virtualei Posted August 9, 2012 Author Report Posted August 9, 2012 Got it working had to take "default " out of acars_map.tpl on line 38. It now reads var acars_map = { Thanks everyone for your help Quote
mseiwald Posted August 9, 2012 Report Posted August 9, 2012 hmm yeah that would be nice. sorry don`t know how to make that option to turn it on and off. maybe someone else could help with this? Quote
Virtualei Posted August 9, 2012 Author Report Posted August 9, 2012 Got it working had to take "default " out of acars_map.tpl on line 38. It now reads var acars_map = { Thanks everyone for your help Thought I had it . Still showing 2 maps but The weather map is now on top argghhhhhhhhhhhhhhhh Quote
mseiwald Posted August 9, 2012 Report Posted August 9, 2012 that`s strange as it works on my and bruce`s sites. Have you commented out the line bruce mentioned in a previous post? Quote
Virtualei Posted August 9, 2012 Author Report Posted August 9, 2012 Hi Manuel that`s strange as it works on my and bruce`s sites. Have you commented out the line bruce mentioned in a previous post? When i take away map from mapOptions like bruce said i loose my weather map Quote
mseiwald Posted August 9, 2012 Report Posted August 9, 2012 no like i had posted it before.... you have map in mapoptions but comment it out in var_options Quote
CPC900 Posted August 10, 2012 Report Posted August 10, 2012 I just did the two things that Manuel and James said for the core_htmlhead.tpl and acarsmap.js, and it works fine. I just changed the Lat and Long values, so it showed the map where I wanted it. Quote
Jeff Posted August 10, 2012 Report Posted August 10, 2012 That's cool. Got it working with no problems what-so-ever. Thanks guys. Quote
Virtualei Posted August 10, 2012 Author Report Posted August 10, 2012 Thanks guys it is now working. Great work from you all much appreciated Quote
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.