-
Zh OpenStreetMap
-
Component
-
Make map responsive?
Make map responsive?
-
Pleppo
-
Topic Author
-
Offline
-
Senior Member
-
Less
More
-
Posts: 41
-
Thank you received: 0
-
-
-
-
4 years 6 months ago #12605
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.
Less
More
-
Posts: 4609
-
Thank you received: 460
-
-
-
-
-
4 years 6 months ago #12606
by Dima
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
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 77
-
Thank you received: 0
-
-
4 years 4 months ago #12828
by sanax
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.
Less
More
-
Posts: 4609
-
Thank you received: 460
-
-
-
-
-
4 years 4 months ago - 4 years 4 months ago #12830
by Dima
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
Last edit: 4 years 4 months ago by Dima.
Please Log in or Create an account to join the conversation.
-
Pleppo
-
Topic Author
-
Offline
-
Senior Member
-
Less
More
-
Posts: 41
-
Thank you received: 0
-
-
-
-
Less
More
-
Posts: 77
-
Thank you received: 0
-
-
4 years 3 months ago #12872
by sanax
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.
-
Zh OpenStreetMap
-
Component
-
Make map responsive?
Time to create page: 0.163 seconds