code I have does not work, there is an example on the site?
<script type="text/javascript">
var myMarkers = new Array();
var lines = new Array();
$.getJSON( "<?php echo actionurl("Destinations/getAirports"); ?>", function( data ) {
var items = [];
$.each( data, function( key, val ) {
var icontype = "default";
if(val.hub == 1){
var icontype = "hub";
$("#info_icao").html(val.icao);
$("#info_name").html(val.name);
$("#info_country").html(val.country);
}
addMarker(val.lat, val.lng,icontype, val);
});
});
function addMarker(lat, lng, icontype, info){
if(icontype == "default"){
var image = "<?php echo fileurl('lib/images/mapassets/airport_icon.png'); ?>";
}else if(icontype == "hub"){
var image = "<?php echo fileurl('lib/images/mapassets/hub_icon.png'); ?>";
}
var marker = new google.maps.Marker({
position: CreateLatLngObject(lat, lng),
map: map,
icon: image
});
// Polyline
google.maps.event.addListener(marker, 'click', function() {
for (i=0; i<lines.length; i++)
{
lines[i].setMap(null); //or line[i].setVisible(false);
}
$.getJSON("<?php echo actionurl("Destinations/getAirportsByArpt"); ?>/" + info.icao, function (data) {
$.each( data, function( key, val ) {
var line = new google.maps.Polyline({
path: [CreateLatLngObject(lat, lng), new google.maps.LatLng(val.lat, val.lng)],
geodesic: true,
strokeColor: '#7CFC00',
strokeOpacity: 0.6,
strokeWeight: 1
});
line.setMap(map);
lines.push(line);
});
});
});
// Polyline
google.maps.event.addListener(marker, 'mouseover', function() {
$("#info_icao").html(info.icao);
$("#info_name").html(info.name);
$("#info_country").html(info.country);
});
myMarkers.push(marker);
}
function CreateLatLngObject(Latitude, Longitude) {
var latlng = new google.maps.LatLng(parseFloat(Latitude), parseFloat(Longitude));
return latlng;
}
var styles = [
{
"featureType": "landscape",
"stylers": [
{
"color": "#01356a"
}
]
}, {
"featureType": "administrative",
"stylers": [
{
"visibility": "off"
}
]
} , {
"featureType": "transit",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "road",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "water",
"stylers": [
{
"color": "#0b508e"
}
]
},
{
"featureType": "poi",
"stylers": [
{
"visibility": "off"
}
]
},{ featureType: "all", elementType: "labels", stylers: [{ visibility: "off" }] }
];
var acars_map_defaults = {
mapTypeControl: false,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
position: google.maps.ControlPosition.BOTTOM_CENTER
},
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL,
position: google.maps.ControlPosition.TOP_RIGHT
},
scaleControl: false,
streetViewControl: false,
autozoom: true,
zoom: 2,
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,
styles:_styles
};
</script>
http://www.skydream-airlines.com/index.php/destinations