function myc($loc, $pos) { return ord(substr($loc, $pos, 1)); } $A = ord('A'); $Z = ord('0'); function lon($square) { global $A, $Z; return (myc($square, 0) - $A) * 20 + (myc($square, 2) - $Z) * 2 + (myc($square, 4) - $A + 0.5) / 12 - 180; } function lat($square) { global $A, $Z; return (myc($square, 1) - $A) * 10 + (myc($square, 3) - $Z) + (myc($square, 5) - $A + 0.5) / 24 - 90; } $nazef=$kat_naz[0]["nazev"]; ?> Leaflet Map with Markers and Popups