Search code examples
javascriptgoogle-maps-api-3drawing

How to change for drawing Manager selection option by default?


I use google.maps.drawing.DrawingManager that seems like:

drawingManager = new google.maps.drawing.DrawingManager({
    drawingMode: google.maps.drawing.OverlayType.MARKER,
    markerOptions: {
        draggable: true,
        optimized: false,
        icon: new google.maps.MarkerImage('uxt/images/ap_gif.gif')
    },
    drawingControlOptions: {
        position: google.maps.ControlPosition.TOP_CENTER,
        drawingModes: [
        google.maps.drawing.OverlayType.MARKER,
        google.maps.drawing.OverlayType.POLYGON
        ]
    },

    polygonOptions: {
        fillColor: '#1E90FF',
        strokeWeight: 0,
        fillOpacity: 0.3,
        editable: true
    },
    map: mapA
});

so my toolbar looks like: enter image description here

As you see by default (after page reload) Marker is selected but i need "the hand" ('Stop drawing') to be selected. enter image description here

How can I configure drawingManager to make this?

Thank you.


Solution

  • Just set drawingMode in options to null:

    drawingManager = new google.maps.drawing.DrawingManager({
        drawingMode: null,
        ...