Search the Community
Showing results for tags 'Vai varbūt pasaules gals..??'.
-
Sveicināti kolēģi! Šeit jau bez pamatojuma nelienu un nebļauju, bet nu, šoreiz kārtējā, laikam jau iesācēju, problēma :D Man ir 3 faili, kuri veido google maps marķierus. index.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script src="http://maps.google.com/maps?file=api&v=2" type="text/javascript"></script> <script src="map_data.php" type="text/javascript"></script> <script src="map_functions.js" type="text/javascript"></script> </head> <body> <div id="map" style="width: 700px; height: 700px;"></div> </body> </html> map_functions.js var map; var centerLatitude = 37.818361; var centerLongitude = -122.478032; var startZoom = 13; function addMarker(longitude, latitude, description) { var marker = new GMarker(new GLatLng(latitude, longitude)); GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml(description); } ); map.addOverlay(marker); } function init() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map")); map.addControl(new GSmallMapControl()); map.setCenter(new GLatLng(centerLatitude, centerLongitude), startZoom); for(id in markers) { addMarker(markers[id].latitude, markers[id].longitude, markers[id].name); } } } window.onload = init; window.onunload = GUnload; un map_data.php var markers = [ { 'latitude': 37.818361, 'longitude': -122.478032, 'name': 'Zelta vārtu tilts' }, { 'latitude': 40.6897, 'longitude': -74.0446, 'name': 'Brīvības statuja' }, { 'latitude': 38.889166, 'longitude': -77.035307, 'name': 'Vašingtona monuments' } ]; Piesaistot map_data.php un map_functions.php pie index.php rodas kosmisks rezultāts - šie objekti atrodas kaut kur Antarktīdā. Vai tiešām pamazām notiek pasaules gals, ka šie objekti kaut kur pārvietojušies? :D Vai arī esmu kaut kur ielaidis kārtējo kļūdu..