it was working, a few months or a year ago.. but now, recently found out it wont work... just a white screen..
it seems to be loading fine in IE11 or firefox.. but wen loaded inside neobook, that's where the problem starts..
Code: Select all
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBL1leGu9wHdlfZMmR5NCHZfFtVC8dYBpw "></script>
<script type="text/javascript">
var GetLocMarker = [
{
"title": 'VendorLocation',
"lat": '8.48466024214509',
"lng": '124.652717216301',
"description": '',
"iconicon": 'http://maps.google.com/intl/en_us/mapfiles/ms/micons/green.png'
}
];
var HQmarkers = [
{
"title": 'VEPCO HQ',
"lat": '8.484371081025191',
"lng": '124.65269575862885',
"description": 'VEPCO HQ',
"iconicon": 'https://vepcocommand.000webhostapp.com/VCicons/VEPCOHQ.png'
}
,
{
"title": 'DAVE',
"lat": '8.48451168233085',
"lng": '124.652900947618',
"description": 'DAVE',
"iconicon": 'https://vepcocommand.000webhostapp.com/VCicons/Icon_Depot 1.png'
}
];
window.onload = function () {
var mapOptions = {
zoom: 10,
center: new google.maps.LatLng(HQmarkers[0].lat, HQmarkers[0].lng),
mapTypeId: google.maps.MapTypeId.HYBRID
};
var infoWindow = new google.maps.InfoWindow();
var latlngbounds = new google.maps.LatLngBounds();
var geocoder = geocoder = new google.maps.Geocoder();
var map = new google.maps.Map(document.getElementById("dvMap"), mapOptions);
//var iconHQ = 'https://vepcocommand.000webhostapp.com/VCicons/VEPCOHQ.png';
//var icongreen = 'http://maps.google.com/intl/en_us/mapfiles/ms/micons/green.png';
//GetLocMarker
for (var i = 0; i < GetLocMarker.length; i++) { //loops array of markers
var data = GetLocMarker[i]
var myLatlng = new google.maps.LatLng(data.lat, data.lng);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: data.title,
draggable: true,
icon: data.iconicon,
animation: google.maps.Animation.DROP
});
(function (marker, data) {
//google.maps.event.addListener(marker, "click", function (e) {
//infoWindow.setContent(data.description);
//infoWindow.open(map, marker);
//});
google.maps.event.addListener(marker, "dragend", function (e) {
var lat, lng, address;
geocoder.geocode({ 'latLng': marker.getPosition() }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
lat = marker.getPosition().lat();
lng = marker.getPosition().lng();
address = results[0].formatted_address;
//alert("Latitude: " + lat + "\nLongitude: " + lng + "\nAddress: " + address);
window.external.nbSetVar( '[mapsLAT]', lat );
window.external.nbSetVar( '[mapsLONG]', lng );
}
});
});
})(marker, data);
latlngbounds.extend(marker.position);
}
//HQ markers
for (var i = 0; i < HQmarkers.length; i++) { //loops array of HQmarkers
var data = HQmarkers[i]
var myLatlng = new google.maps.LatLng(data.lat, data.lng);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: data.title,
draggable: false,
icon: data.iconicon, //(this sets all icons of variable markers to iconHQ)
animation: google.maps.Animation.DROP
});
// this function sets the markers to display infowindow when clicked
//(function (marker, data) {
// google.maps.event.addListener(marker, "click", function () {
// infoWindow.setContent(data.description);
// infoWindow.open(map,marker);
// });
//})
//this function sets all markers to display their infowindow automatically
var infowindow = new google.maps.InfoWindow({
content: (HQmarkers[i].description),
//content: data.description[i][0],
//maxWidth: 200
//infoWindow.setContent(data.description)
});
infowindow.open(map, marker, data);
(marker, data);
latlngbounds.extend(marker.position);
}
var bounds = new google.maps.LatLngBounds();
map.setCenter(latlngbounds.getCenter());
map.fitBounds(latlngbounds);
}
</script>
<div id="dvMap" style="width: 750px; height: 630">
</div>