I have got KMZ file and I don't know how to show it from drupal. So, I research and found those codes.
function CoverageMap() {
var map = new google.maps.Map(document.getElementById('coverageMap'), {
zoom: 15,
center: {lat: 16.800915763233845, lng: 96.1567211141123}
});
var kmzLayer = new google.maps.KmlLayer('http://test.dev/sites/all/themes/bootstrap_business/coverage/ygn_mdy.kmz');
kmzLayer.setMap(map);
}
I put this code and save the file Coverage.js.
But, the file location is static location and I would like to change dynamic because the location will not be like this when I upload the file in server.
Can I put this code <?php echo base_path().path_to_theme() ?>
/coverage/ygn_mdy.kmz
Should KMZ file put like this as an offline or is there other ways?
Please help me to solve this problem. I've been trying to find this since 2wks ago.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…