PHP jquery google map init

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP jquery google map init相关的知识,希望对你有一定的参考价值。

<script src="http://maps.google.com/maps?file=api&v=2&key=ApiKeyinizBurayaYazılacak&sensor=true"
        type="text/javascript"></script>
       
    <script type="text/javascript">
 var geocoder;
 var map; 
 function initialize() {
 var geocoder = new GClientGeocoder();
 var map = new GMap2(document.getElementById("map_canvas"));
   geocoder.getLocations("Istanbul , TURKEY", function(result){
          if (result.Status.code != 200) {
            alert('Could not geocode "' + result.name + '"');
            return;
        }
          place = result.Placemark[0];
          point = new GLatLng(place.Point.coordinates[1],
                              place.Point.coordinates[0]);
          map.setMapType(G_HYBRID_MAP);
          map.setCenter(point, 8);
          marker = new GMarker(point);
         map.addOverlay(marker);
         alert("OK");
          marker.openInfoWindowHtml(place.address);
    
   });
 
 }
  
    $(document).ready(function(){
     initialize(); 
    });

以上是关于PHP jquery google map init的主要内容,如果未能解决你的问题,请参考以下文章