LarsWiegers / laravel-maps

Your laravel maps libary.
https://github.com/LarsWiegers/laravel-maps
MIT License
254 stars 35 forks source link

#defaultMapId has height of 100vh #7

Closed RobertCordes closed 3 years ago

RobertCordes commented 3 years ago

When using the blade components there is some CSS making the map take up the entire height of the viewport. I have placed the following bit of CSS in my app.css:

#defaultMapId {
    height: 100% !important;
}

This obviously fixes the issue but I was wondering if there's a better way of configuring this? Maybe (probably) I'm missing something. 🧐

PS: I can already see this package saving me a bunch of time in the future!

LarsWiegers commented 3 years ago

Hi, yeah for now it did have that css in there. Do you think that we should use the class attributes? https://laravel.com/docs/8.x/blade#component-attributes

Seems like that would be the right solution for this, with the default still being that it takes up the whole screen.

Thx for the compliment on the package. Im also really happy with it 😃

RobertCordes commented 3 years ago

Yeah, that was my initial instinct as well.

LarsWiegers commented 3 years ago

@RobertCordes I added a pull request, can you take a look at and let me know if it looks good to you?

RobertCordes commented 3 years ago

Hi @LarsWiegers I would've done it exactly the same way. I haven't tested it myself, but it looks as one (or at least I) would expect. :-)

LarsWiegers commented 3 years ago

@RobertCordes published a new release with the new code.

sotirislp commented 3 years ago

is there a possibility to do the same but with google maps? I think the id of the div is changing in every reload.

LarsWiegers commented 3 years ago

@sotirislp you should be able to pass style attributes to the component, the id does change but the style will always be applied