H
HacKeRr
Гость
Здравствуйте, суть вопроса:Как добавить маркеры из БД на карту Google Maps?Уже 3-й день парюсь(Вот что есть но не работает<!DOCTYPE html><html> <head> <title>Simple Map</title> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <style> html, body, #map-canvas { margin: 0; padding: 0; height: 90%; } </style> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script>var map;function initialize() { var myLatlng = new google.maps.LatLng(-34.397, 150.644); var mapOptions = { zoom: 8, center: new google.maps.LatLng(-34.397, 150.644), mapTypeId: google.maps.MapTypeId.ROADMAP };var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); }function setMarkers(map,coordfirst,coordsec,text,title) { var coordf = coordfirst; var coordt = coordsec; var myLatLng = new google.maps.LatLng(coordf, coordt); var marker = new google.maps.Marker({ position: myLatLng, map: map, title: title, }); }function setMarker() { var myLatLng = new google.maps.LatLng(-34.397, 150.644); var marker = new google.maps.Marker({ position: myLatLng, map: map, title: "TITLE" }); }google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body><?php$dblocation = "mysql.hostinger.com.ua";$dbname = "u611677371_udk";$dbuser = "u611677371_udk";$dbpasswd = "123321";$dbcnx = @mysql_connect($dblocation,$dbuser,$dbpasswd);mysql_select_db("u611677371_udk", $dbcnx);$ath = mysql_query("select * from coords;");if($ath){ while($author = mysql_fetch_array($ath)) { $coordone = $author["coord1"]; $coordtwo = $author["coord2"]; $text = $author["text"]; $title = $author["title"]; print '<script>setMarker()</script>';}}?> <div id="map-canvas"></div> </body></html>