是否有可能在PHP后端进行转换:
<?php
$Address = "Street 1, City, Country"; // just normal address
?>
<?php
$LatLng = "10.0,20.0"; // latitude & lonitude
?>
我目前使用的代码是默认的:
<script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false'></script>
<script>
function initialize() {
var myLatlng = new google.maps.LatLng(10.0,20.0);
var mapOptions = {
zoom: 16,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('map'), mapOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'This is a caption'
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<div id="map"></div>
我已经阅读了一段时间的https://developers.google.com/maps/documentation/geocoding,但我想我还不够有经验。
谢谢。