2012-02-13 47 views
0

我已經在我的項目中實施谷歌地圖。我已經設置了所有必需的東西。我想知道控制圖標不像平移,縮放等。但我仍然可以縮放,點擊模糊的形狀而不是圖片按鈕。任何人都可以解決這個問題? .Serry for my bad english我的谷歌地圖平移變焦控制按鈕沒有出現

<script src="//maps.google.com/maps?file=api&amp;v=2&amp;key=key" 
      type="text/javascript"></script> 
    <script type="text/javascript"> 

    function initialize() { 
     if (GBrowserIsCompatible()) { 
     var map = new GMap2(document.getElementById("map_canvas")); 
     var latlng = new GLatLng(<?php echo $lattitude?>, <?php echo $longitude?>); 
     map.setCenter(latlng, 13); 


     var iconRed = new GIcon(); 
     iconRed.image = 'http://labs.google.com/ridefinder/images/mm_20_red.png'; 
     iconRed.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png'; 
     iconRed.iconSize = new GSize(12, 20); 
     iconRed.shadowSize = new GSize(22, 20); 
     iconRed.iconAnchor = new GPoint(6, 20); 
     iconRed.infoWindowAnchor = new GPoint(5, 1); 





      map.addControl(new GSmallMapControl()); 
      map.addControl(new GMapTypeControl()); 
      map.addOverlay(new GMarker(latlng)); 

      var name = "name"; 
      var address = "address"; 
      var type = "bar"; 
      var point = latlng; 
      var marker = createMarker(point, name, address, iconRed); 
      map.addOverlay(marker); 

     } 
    } 
    function createMarker(point, name, address, iconRed) { 
     var marker = new GMarker(point, iconRed); 
     var html = "<b>" + name + "</b> <br/>" + address; 
     GEvent.addListener(marker, 'click', function() { 
     marker.openInfoWindowHtml(html); 
     }); 
     return marker; 
    } 
+0

什麼是你的代碼? – hakre 2012-02-13 11:49:40

+0

是的,請發佈您的代碼..也是哪個版本的API和哪個實現.. js,php? – gorelative 2012-02-13 13:08:31

+0

截圖也會有所幫助 – 2012-02-13 13:11:54

回答

1

您不應該將V2的Google Maps API用於您的應用。該版本的API已被棄用。

相反,你shoule使用V3:

http://goo.gl/YVKfp

+0

無論如何,我將v改爲3。現在看起來工作正常。謝謝大家 – 2012-02-14 04:45:51