Path: C:\
<?php
$placa = $_GET['placa'];
$lat = $_GET['lat'];
$lon = $_GET['lon'];
$ico = $_GET['ico'];
$png[0]='icon0.png';
$png[1]='icon1.png';
$png[2]='icon2.png';
$png[3]='icon3.png';
$png[4]='icon4.png';
?>
<!DOCTYPE html >
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps</title>
<link rel="icon" type="image/png" href="imagens/favicon.ico">
<style>
#map { height: 100%; width: 100%;}
html, body { height: 100%; margin: 0; padding: 0;}
</style>
</head>
<body>
<div id="map"></div>
<script>
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
center: new google.maps.LatLng('<?php echo $lat;?>','<?php echo $lon;?>'),
zoom: 15
});
var infoWindow = new google.maps.InfoWindow;
downloadUrl('', function(data) {
var name = '<?php echo $placa;?>'
var icoPng = '<?php echo $png[$ico];?>'
var point = new google.maps.LatLng(
parseFloat('<?php echo $lat;?>'),
parseFloat('<?php echo $lon;?>')
);
var infowincontent = document.createElement('div');
var strong = document.createElement('strong');
strong.textContent = name
infowincontent.appendChild(strong);
infowincontent.appendChild(document.createElement('br'));
var icon = 'imagens/'+icoPng;
var marker = new google.maps.Marker({
map: map,
position: point,
icon: icon
});
infoWindow.setContent(infowincontent);
infoWindow.open(map, marker);
marker.addListener('click', function() {
infoWindow.setContent(infowincontent);
infoWindow.open(map, marker);
});
});
}
function downloadUrl(url, callback) {
var request = window.ActiveXObject ?
new ActiveXObject('Microsoft.XMLHTTP') :
new XMLHttpRequest;
request.onreadystatechange = function() {
if (request.readyState == 4) {
request.onreadystatechange = doNothing;
callback(request, request.status);
}
};
request.open('GET', url, true);
request.send(null);
}
function doNothing() {}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBZXfwcCRAGAyFDHbyNTUf3xJ8ksWmeiAs&callback=initMap">
</script>
</body>
</html>