RED.Skull
RED.Skull

Reputation: 1736

Zoom and Panning effect without support of Control tools

I need to include pan effect and zoom effect without the help of control tools. The implementation in mobile and tablet so i dont need that tool bars instead of that touch zoom and drag panning effects are needed. Is it possible to implement ? Looking for suggestions

var myLatlng = new google.maps.LatLng(Lat, Long);
      var myOptions = {
    zoom: 10,
    maxZoom : 24,
    center: myLatlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
       draggable: false
      }

Upvotes: 1

Views: 326

Answers (1)

Omar
Omar

Reputation: 31732

Here is the code:

Just add disableDefaultUI: true

function initialize() {
 var mapOptions = {
 zoom: 10,
 center: new google.maps.LatLng(-33, 151),

 disableDefaultUI: true, // <- this

 mapTypeId: google.maps.MapTypeId.ROADMAP
 }
 var map = new google.maps.Map(document.getElementById("map-canvas"),
 mapOptions);
}

Example

Upvotes: 2

Related Questions