Make map responsive?

  • Pleppo
  • Pleppo's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
11 months 2 days ago #12605 by Pleppo
Make map responsive? was created by Pleppo
Hi,

how can I make the maps responsive?
I have tried it with some styles but without success.
The maps do not adapt.

Best regards
F.

Please Log in or Create an account to join the conversation.

More
11 months 2 days ago #12606 by Dima
Replied by Dima on topic Make map responsive?
Hi.
I wrote many times on forum.

You can easy set width to 0, it means 100% width and map will occupy its div
As for height - the same, but if you have modern templates with many nested divs - it can collapse and you'll not see map. You should set some fixed size for div

Don't forget support my developments: post review in JED , donate , help with thanslation ;)

Please Log in or Create an account to join the conversation.

More
9 months 1 week ago #12828 by sanax
Replied by sanax on topic Make map responsive?
Hi Dima

I'm using the default Protostar template and if I set the map size to 0, it still collapse. I'm not sure if this default template has many nested divs

Please Log in or Create an account to join the conversation.

More
9 months 1 week ago - 9 months 1 week ago #12830 by Dima
Replied by Dima on topic Make map responsive?
If your template have at least 2 nested divs - you'll get it collapsed.

You can set height not 100%.
Open map details, on "Advanced options" tab you can find item "CSS Class"
It is CSS class name for map div. By default I set my default class ("zhom-map-default"). You can override it in template, or you can enter your class name into this field. For example I enter MyMap

After that in template CSS define overide height like
.MyMap {
    height: 50vh !important;
}
In this case map div will be responsive for 50% of visible height

Don't forget support my developments: post review in JED , donate , help with thanslation ;)
Last edit: 9 months 1 week ago by Dima.

Please Log in or Create an account to join the conversation.

  • Pleppo
  • Pleppo's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
8 months 4 weeks ago #12847 by Pleppo
Replied by Pleppo on topic Make map responsive?
so it doesn't work for me...

Please Log in or Create an account to join the conversation.

More
8 months 3 weeks ago #12872 by sanax
Replied by sanax on topic Make map responsive?
On your map - Set the height to whatever you want and set the width to "0"

Please Log in or Create an account to join the conversation.

Time to create page: 0.062 seconds

Donate


Go to top