Определение координат Google Maps и высоту обзора
Всем привет! Подскажите пжл как на основе этого сделать следующее:
Полученные координаты выводились в форме вместе с zoom для дальнейшей отправки в бд? С Js мне сложно как то сдружиться... Кто поможет 200 рублей на мобилку кину 100%. <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> var geocoder = new google.maps.Geocoder(); function geocodePosition(pos) { geocoder.geocode({ latLng: pos }, function(responses) { if (responses && responses.length > 0) { updateMarkerAddress(responses[0].formatted_address); } else { updateMarkerAddress('Cannot determine address at this location.'); } }); } function updateMarkerStatus(str) { document.getElementById('markerStatus').innerHTML = str; } function updateMarkerPosition(latLng) { document.getElementById('info').innerHTML = [ latLng.lat(), latLng.lng() ].join(', '); } function initialize() { var latLng = new google.maps.LatLng(54.21058872915175, 49.572539382957075); var map = new google.maps.Map(document.getElementById('mapCanvas'), { zoom: 11, center: latLng, mapTypeId: google.maps.MapTypeId.ROADMAP }); var marker = new google.maps.Marker({ position: latLng, title: 'Hello World!', map: map, animation: google.maps.Animation.DROP, draggable: true }); // Update current position info. updateMarkerPosition(latLng); geocodePosition(latLng); // Add dragging event listeners. google.maps.event.addListener(marker, 'drag', function() { updateMarkerPosition(marker.getPosition()); }); google.maps.event.addListener(marker, 'dragend', function() { geocodePosition(marker.getPosition()); }); } // Onload handler to fire off the app. google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body> <style> #mapCanvas { width: 500px; height: 400px; float: left; } #infoPanel { float: left; margin-left: 10px; } #infoPanel div { margin-bottom: 5px; } </style> <div id="mapCanvas"></div> <div id="infoPanel"> <b>Current position:</b> <div id="info"></div> </div> </body> </html> |
Часовой пояс GMT +3, время: 16:11. |