简体   繁体   中英

How geocoder.geocode() works?

My only question is, if browser does not support cross domain AJAX request than How google map api works to get the data.

How following code works ?

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
geocoder = new google.maps.Geocoder();
geocoder.geocode( { 'address': address}, function(results, status) {
   if (status == google.maps.GeocoderStatus.OK) {
   }
});
</script>

what geocoder.geocode does internally ?

EDIT: Ok they are including http://maps.gstatic.com/intl/en_us/mapfiles/api-3/9/8/main.js

can anyone tell me where they are using JSONP in their JS Code ?

它最有可能使用JSONp,即它包含来自google服务器的脚本,该脚本调用回调函数并将响应传递给该函数。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM