2

I am using this code to let user draw circles or images

enter image description here

drawingManager = new google.maps.drawing.DrawingManager({
                drawingMode: null,
                drawingControlOptions: {
                    drawingModes: [google.maps.drawing.OverlayType.CIRCLE,          google.maps.drawing.OverlayType.RECTANGLE]
                },
                rectangleOptions: shapeOptions,
                circleOptions: shapeOptions,
                Options: shapeOptions,
                map: map
            });

the thing is I need to style those buttons,

How Can I Do so? I looked here but there are not mentions

I found this but this makes reference for adding new buttons, I want to style current ones

Toni Michel Caubet
  • 19,333
  • 56
  • 202
  • 378
  • 1
    Although there may be ways, these ways would be more complicated than implementing own(custom) controls and possibly not stable(because the markup used for the built-in controls is not guaranteed to be stable) – Dr.Molle Sep 15 '15 at 10:24
  • 1
    You can do it by changing the CSS. Please refer to the SO post answer http://stackoverflow.com/questions/12474604/is-it-possible-to-change-the-google-maps-drawing-manager-icons – AniV Sep 15 '15 at 23:42

3 Answers3

0
       **You can add css styles for that particular button as below.** 
<style>
            div[title="Stop drawing"] {
                    content: url(https://cdn4.iconfinder.com/data/icons/whsr-january-flaticon-set/128/compass.png) !important;       
                    height: 28px;
                    width: 28px;
                    cursor: pointer;
                }

                div[title="Draw a circle"] {
                    content: url(http://www.pngmart.com/files/4/Moon-PNG-Transparent.png) !important;
                    height: 28px;
                    width: 28px;
                    cursor: pointer;
                }

                  div[title="Draw a rectangle"] {
                    content: url(https://www.shareicon.net/data/32x32/2015/07/04/64183_rectangle_256x256.png) !important;
                    height: 28px;
                    width: 28px;
                    cursor: pointer;
                }
</style>
xoxo
  • 1,248
  • 14
  • 19
  • 1
    Thanks, I forgot about this question. I ended up creating custom buttons. But I don't think this is a very reliable solution because you'll need to add the rule for every language. And the texts might change in the future :O But thanks :) – Toni Michel Caubet Aug 30 '17 at 11:20
0

I know it's an old question but another aproach may be using a selector nth-child() based on the div wrapper which has a class 'gmnoprint'.

Title attributes on divs is not reliable because it changes by language.

Example:

div.gmnoprint div:nth-child(1)  {     
  height: 48px;
  width: 48px;
  cursor: pointer;
}

div.gmnoprint div:nth-child(2) {
  height: 48px;
  width: 48px;
  cursor: pointer;
}

div.gmnoprint div:nth-child(3) {
  height: 48px;
  width: 48px;
  cursor: pointer;
}
Pablo García
  • 359
  • 3
  • 9
0

Need to use button instead of div in the latest google maps api.

button[title="Stop drawing"] { 
  display: none !important; 
}