Jump to content

map errors


Angello

Recommended Posts

This works...

# Google Map Options
Config::Set('MAP_WIDTH', '875px');
Config::Set('MAP_HEIGHT', '650px');
# Valid types are G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP, G_PHYSICAL_MAP
Config::Set('MAP_TYPE', 'G_SATELLITE_MAP');
Config::Set('MAP_LINE_COLOR', '#ff0000');
Config::Set('MAP_CENTER_LAT', '52.308053');
Config::Set('MAP_CENTER_LNG', '4.764167');
Config::Set('MAP_ZOOM_LEVEL', 10);

Link to comment
Share on other sites

core/app.config.php

# Google Map Options

Config::Set('MAP_WIDTH', '875px');

Config::Set('MAP_HEIGHT', '650px');

# Valid types are G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP, G_PHYSICAL_MAP

Config::Set('MAP_TYPE', 'G_SATELLITE_MAP');

Config::Set('MAP_LINE_COLOR', '#ff0000');

Config::Set('MAP_CENTER_LAT', '52.308053');

Config::Set('MAP_CENTER_LNG', '4.764167');

Config::Set('MAP_ZOOM_LEVEL', 10);

post-9851-0-71888600-1425122077_thumb.png

not working

Link to comment
Share on other sites

/**
* These are some options for the ACARS map, you can change here
*
* By default, the zoom level and center are ignored, and the map
* will try to fit the all the flights in. If you want to manually set
* the zoom level and center, set "autozoom" to false.
*
* You can use these MapTypeId's:
* http://code.google.com/apis/maps/documentation/v3/reference.html#MapTypeId
*
* Change the "TERRAIN" to the "Constant" listed there - they are case-sensitive
*
* Also, how to style the acars pilot list table. You can use these style selectors:
*
* table.acarsmap { }
* table.acarsmap thead { }
* table.acarsmap tbody { }
* table.acarsmap tbody tr.even { }
* table.acarsmap tbody tr.odd { }
*/
?>
<script type="text/javascript">
<?php
/* These are the settings for the Google map. You can see the
Google API reference if you want to add more options.

There's two options I've added:

autozoom: This will automatically center in on/zoom
so all your current flights are visible. If false,
then the zoom and center you specify will be used instead

refreshTime: Time, in seconds * 1000 to refresh the map.
The default is 10000 (10 seconds)
*/
?>
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.HYBRID,
refreshTime: 10000
};
</script>
<div class="mapcenter" align="center">
<div id="acarsmap" style="width:<?php echo Config::Get('MAP_WIDTH');?>; height: <?php echo Config::Get('MAP_HEIGHT')?>"></div>
</div>
<?php

Link to comment
Share on other sites

Change autozoom to false. This is how it would look like -

var acars_map_defaults = {
autozoom: false,
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.HYBRID,
refreshTime: 10000
};

Link to comment
Share on other sites

The autozoom was an alternate solution to your issue. You definitely have something else going on in your phpVMS but it seems to me that It may be nearly impossible to locate without comparing each file to the original.

The plane is off screen, and that's because autozoom was set to false which means that google maps will not change the center coordinates so that your aircraft is visible. If you were to click, hold and drag the map around you'll find the plane. My best suggestion is to Zoom out by setting the zoom parameter in the code above to a lower value(Or greater, not sure...whichever lets you zoom out - experiment.)

Another Alternative is the following code -

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.ROADMAP,
refreshTime: 10000
};

The code above would reset to the normal autozoom, but those black images would disappear. They would instead be replaced with a roadmap of the region.

Link to comment
Share on other sites

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...