<a class="location_map" onclick='javascript:window.open("https://maps.google.com/maps?q=10.804404555920602,78.72114462280274&hl=es;z=14&output=embed","_blank","toolbar=yes,width=800,height=500,resizable=1,scrollbars=1,top=250,left=200");' id="mal1">Click To View Map</a><br>
你好朋友我在上面的代码行及其在地址气球中的显示纬度和经度值。
但是下面的代码在气球中显示它很好,但没有准确显示地图上的纬度,经度位置。
<a class="location_map" onclick='javascript:window.open("http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=Periyar+Nagar+1st+Street,+Malayappa+Nagar,+Tiruchirappalli,+Tamil+Nadu+620004,+India&aq=&sll=10.804404555920602,78.72116608047486&sspn=0.012057,0.021136&ie=UTF8&hq=&hnear=Periyar+Nagar+1st+Street,+Malayappa+Nagar,+Tiruchirappalli,+Tamil+Nadu+620004,+India&t=m&z=14&ll=&output=embed","_blank","toolbar=yes,width=800,height=500,resizable=1,scrollbars=1,top=250,left=200");' id="mal1">Click To View Map</a>
我的需要是显示由用户标记的正确位置,在气球上使用正确的地址..
答案 0 :(得分:0)
将其放在HTML的主题部分
<script src="https://maps.googleapis.com/maps/api/js"></script>
<script>
function initialize() {
var map_canvas = document.getElementById('map_canvas');
var map_options = {
center: new google.maps.LatLng(30.479084, -97.823937),
zoom: 10,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(map_canvas, map_options)
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
这在Body Section中 - div id =&#34; map_canvas&#34;
这将显示地图,其中包含您提供的纬度和经度值作为地图的中心。