apneadiving / Google-Maps-for-Rails

Enables easy Google map + overlays creation in Ruby apps
https://apneadiving.github.io/
MIT License
2.27k stars 382 forks source link

Setting width of InfoWindow #458

Closed patrickgordon closed 9 years ago

patrickgordon commented 10 years ago

I'm aware that you can create an extension of the InfoWindow which is an InfoBox but all I really want to do is set the minWidth of the InfoWindow.

marker.infowindow({
    "content" => event.name,
   "maxWidth" => 200
})

This does not work as it seems marker.infowindow can only take a string. Is there a way to extend the InfoWindow (without making an InfoBox)?

apneadiving commented 10 years ago

Its not part of the options, see https://developers.google.com/maps/documentation/javascript/reference?hl=FR#InfoWindow

But since you can put html inside, I guess you can play with css here.

I always use InfoBox so I've no additional feedback, sorry

patrickgordon commented 10 years ago

maxWidth is specified as a property two below content. Am I missing something?

apneadiving commented 10 years ago

but all I really want to do is set the minWidth of the InfoWindow. you want max or min? :)

patrickgordon commented 10 years ago

Well boy is my face red. That said, maxWidth doesn't work either.

I guess I'm OK with using an infobox but I cant get the arrow to display at all

apneadiving commented 10 years ago

to sum up:

I dont know what arrow you're talking about with infobox

patrickgordon commented 10 years ago

I'll post a screenshot when I get home. On 24 Sep 2014 18:45, "Benjamin Roth" notifications@github.com wrote:

to sum up:

  • maxWidth could easily be patched
  • minWidth does not exist

I dont know what arrow you're talking about with infobox

— Reply to this email directly or view it on GitHub https://github.com/apneadiving/Google-Maps-for-Rails/issues/458#issuecomment-56641350 .

patrickgordon commented 10 years ago

OK so screenshot time.. If I use an infobox I am unable to render an arrow. I'm not sure if I'm doing something wrong... no_arrow

What I want is something like: arrow

Here's the infobox code:

    infobox: (boxText)->
        content: boxText
        pixelOffset: new google.maps.Size(-60, -80)
        boxStyle:
            padding: "10px"
            borderRadius: "5px"
            borderWidth: "1px"
            borderColor: "#ccc"
            backgroundColor: "#fff"
            minWidth: "50px"
            maxWidth: "300px"
            minHeight: "20px"
            arrowSize: "10px"
            arrowPosition: "50%"
            arrowStyle: "2"
apneadiving commented 10 years ago

still, where does this arrow come from?