You are not logged in.
Pages: 1
Could someone with more experience here tell me what on earth am I doing wrong that the KML Layer is not showing? I see the map but the polyline of the layer is just not showing.
Here is the script code:
var centerGeo = new google.maps.LatLng(9.157103, -79.264761);
var centerMarker = new google.maps.LatLng(9.157103, -79.264761);
$().ready(function() {
$('#testMap').gmap3(
{ action: 'init',
options: {
center: centerGeo,
zoom: 10,
mapTypeId: google.maps.MapTypeId.TERRAIN,
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControl: true,
scrollwheel: true,
streetViewControl: false,
icon:
{
image: "/img/maps/iconEmit.png",
shadow: "/img/maps/iconEmitShadow.png",
iconsize: [32, 37],
shadowsize: [32, 37],
iconanchor: [4, 19],
infowindowanchor: [8, 2]
}
}
},
{ action: 'addKmlLayer',
url: '[url]http://www.panamavibes.com/MapIt/Kml/Tocumen_ElLlano_Carti.kml[/url]',
options: {
suppressInfoWindows: false,
preserveViewport: true
},
tag: 'Tocumen_ElLlano_Carti'
}
);
$('.tools input[type=checkbox]').change(function () {
var map = $('#testMap').gmap3('get'),
kml = $('#testMap').gmap3({
action: 'get',
name: 'kmllayer',
tag: $(this).attr('id')
});
kml.setMap($(this).is(':checked') ? map : null);
});
});I checked the KML Layer URL and it downloads a KML file. I also used kmlvalidator.com to validate that same file and it not only shows me the KML file contents but also tells me it validates Okay. So why is it not showing on the map?
Offline
what happens when checkbox code removed?
Offline
Same result when I remove the cbox. I tried this code on your JSFiddle page as well and still the map shows no KML regardless of whether the "checkbox" tools code is there or not.
Offline
Pages: 1