Make map responsive?

  • Pleppo
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 1 month 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
5 years 1 month 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 translation ;)

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

More
4 years 11 months 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
4 years 11 months ago - 4 years 11 months 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
Code:
.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 translation ;)
Last edit: 4 years 11 months ago by Dima.

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

  • Pleppo
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 11 months 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
4 years 10 months 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.194 seconds
Powered by Kunena Forum