纬度经度不在加载但工作按钮单击

时间:2013-08-30 13:52:30

标签: jquery asp.net google-maps

嘿我使用谷歌地图api v2并且无法获得加载事件的纬度和经度但是当我点击按钮它正在工作所以问题是什么

<html>
<head>
<title>test</title>
<script src="Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
<script type="text/javascript" src="//maps.google.com/maps?file=api&amp;v=2.x&amp;key=AIzaSyBaxOkCmvfVS_Old-4uMQCgWMXSVgRJmCw"></script>
<script type="text/javascript" src="https://maps.gstatic.com/intl/en_ALL/mapfiles/450c/maps2.api/main.js"></script>
<script type="text/javascript" charset="UTF-8" src="https://maps.gstatic.com/cat_js/intl/en_ALL/mapfiles/450c/maps2.api/%7Bmod_drag,mod_ctrapi,mod_api_gc%7D.js"></script>
<script type="text/javascript" src="Scripts/scripts/CascadingDropdown.js"></script>
<script type="text/javascript">
 var map = null;
 var geocoder = null;

function initialize() {
        if (GBrowserIsCompatible()) {
            map = new GMap2(document.getElementById("map_canvas"));
            map.setCenter(new GLatLng(37.4419, -122.1419), 13);
            geocoder = new GClientGeocoder();

            var address = "indore";
            addMarkerAtGeocode(address);
            function addMarkerAtGeocode(address) {
                geocoder.getLatLng(address, function (point) {
                    if (!point) {
                        alert(address + " not found");
                    } else {
                        alert('2:' + address);
                        var marker = createMarker(point, address);
                        map.addOverlay(marker);
                    }
                });
            }


            function createMarker(point, address) {
                var marker = new GMarker(point);
                return marker;
            }               





  }


</script>

0 个答案:

没有答案