phpgoogle-maps

My google maps pan zoom control buttons not appearing


I have implemented google map in my project . I've set all the required things . I was wondering the control icons not appearing like pan,zoom etc. But still I can zoom ,pan with clicking on a blurred shape instead of the picture buttons . Anybody can address the issue ? .Sorry 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;
    }

Solution

  • You should not be using V2 of the Google Maps API for your app. That version of the API has been deprecated.

    Instead you shoule be using V3:

    http://code.google.com/apis/maps/documentation/javascript/?utm_source=welovemapsdevelopers&utm_campaign=mdr-general