0

I looked in the positioning docs and googled and don't see anything about it. This looks ridiculous tho even when their own controls are vertical. Is this possible?

enter image description here

Oscar Godson
  • 31,662
  • 41
  • 121
  • 201
  • Have you read this? http://stackoverflow.com/questions/2934269/google-maps-api-v3-custom-controls-position – Roko C. Buljan Dec 22 '15 at 20:47
  • Yea, and that might work but it's extremely brittle: `$('div.gmnoprint').last()` assumes what I want will _always_ be last. `.gmnoprint`is used for all the controls + things like the terms of use link, etc. So if the DOM is ever changed and what I'm looking for is moved it'll all break. – Oscar Godson Dec 22 '15 at 20:58

1 Answers1

0

So far, and this isn't pretty, but the only way to get it aligned correctly and vertical was doing this hackage:

$('[title="Draw a rectangle"], [title="Stop drawing"]')
.last().css({marginBottom: '20px', marginLeft: '1px'})
.end().parent().css({
    float: 'none',
    marginLeft: '5px'
});

You'd need to add the title for each button you add to your controls too

UPDATE

The above worked fine for a bit but as I needed to add more buttons and have more control it became super hard. I ended up just building a "toolbar component" that didn't use any Google Maps code except to trigger the tool changes on click (just drawingManagerInstance.setDrawingMode('whatever')). This ended up taking me less time then figuring out how to alter theirs and it's so much easier to work with.

Oscar Godson
  • 31,662
  • 41
  • 121
  • 201