Jump to content

Recommended Posts

Posted

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");

?>

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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.

  • Like 1
Posted

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 :lol:

Posted

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);

Posted

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.

Posted

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

Posted

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

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...