Disable dragging Google Maps in drawing mode

I'm trying to create a page where people can draw a line over a fixed area, so I want the map not to be colored, dragged, zoomed in or moved. I've set everything I can find to false and it works fine in normal view, but when the user starts painting with the Paint Manager, scrolling back to zoom as well as drag-and-drop. My first thought is that this is a bug / oversight in google code, but I hope someone else has a job.

var myOptions = {
  center: new google.maps.LatLng(-25,177.5),
  zoom: 3,
  mapTypeId: google.maps.MapTypeId.SATELLITE,
  streetViewControl : false,
  zoomControl: false,
  disableDoubleClickZoom: true,
  draggable: false,
  keyboardShortcuts : false,
  navigationControl : false,
  scaleControl : false,
  scrollwheel : false,
  streetViewControl : false
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

      

update: this is the drawing manager code

var drawingManager = new google.maps.drawing.DrawingManager({
      drawingMode: google.maps.drawing.OverlayType.POLYLINE,
      drawingControl: true,
      drawingControlOptions: {
        position: google.maps.ControlPosition.TOP_CENTER,
        drawingModes: [google.maps.drawing.OverlayType.POLYLINE]
      },
      polylineOptions: {
        strokeWeight: 2,
        strokeColor: '#ee9900',
        clickable: false,
        zIndex: 1,
        editable: true
      }
    });
drawingManager.setMap(map);

      

+3


source to share


1 answer


I suggest you add this to Tracker for Google Maps API

http://code.google.com/p/gmaps-api-issues/

It really looks like a problem with the API - basically something that Google hasn't considered.



BUT, I highly recommend that you install the page as a demo and include the link in the issue report.

I take you at your word that this is happening, but the problem carries x100 times more weight if there is a very easy way to test others (i.e. see it with your own eyes).

(yes, people can try and take your code to reproduce it, but 1. its a lot of work, and 2. there is a high chance of unintentionally doing something different and thereby fixing the problem)

+2


source







All Articles