Хотел написать решение но не успел
Правда не много по другому но тоже работает
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>FSX SERVER</title>
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>
function initialize() {
var mapOptions = {
zoom: 4,
center: new google.maps.LatLng(55.408790,37.906310)
}
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
setMarkers(map, beaches);
}
var beaches = [
<?php
$file = file_get_contents('whazzup.txt');
preg_match('#\!CLIENTS(.*)\!SERVERS#usU', $file, $match);
$res = explode(PHP_EOL, $match[1]);
foreach($res as $str){
if(strlen($str)>0){
$temp = explode(':', $str);
$data = "['".$temp[0]."',".$temp[5].",".$temp[6]."],";
echo "$data";
}
}
?>
];
function setMarkers(map, locations, text, title) {
var image = {
url: '1.png',
size: new google.maps.Size(32, 32),
origin: new google.maps.Point(0,0),
anchor: new google.maps.Point(0, 32)
};
var shape = {
coord: [1, 1, 1, 20, 18, 20, 18 , 1],
type: 'poly'
};
for (var i = 0; i < locations.length; i++) {
var beach = locations[i];
var myLatLng = new google.maps.LatLng(beach[1], beach[2]);
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
icon: image,
shape: shape,
title: beach[0],
zIndex: beach[3]
});
}
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>