Forum
Google Map RWD
I have a Google map on my site and it works fine. If I change it to be responsive it momentarily appears then disappears.
The map template
<div class="cmsmap">
<perch:content id="map" type="map" label="Address" zoom="15" />
</div>
The CSS
.cmsmap{
width: 400;
height: 300;
}
The config file
define('PERCH_RWD', true);
If I inspect the (invisible) map I see the css has been removed
Any pointers appreciated.
Have you read the "Maps and Responsive layouts" section in the docs?
https://docs.grabaperch.com/docs/templates/attributes/type/map/
Yes Drew, I did, that's why I showed the template, css and config above. I'm missing something basic, I just don't know what Here is a link to let you see what I'm getting
I can see the defaults that I added to the cmsmap are being removed by the inline styles
Your CSS is missing units. I think you want:
Hi Drew, I had tried it with units previously, when I tried it with
a map was displayed, but it did not resize. It took up 400x300 on the page. However eventually I found that if I removed the width attribute then it resized to fit the container. So
works, with the sizes coming from perch / google maps at 100%=300px and the width at 100%=container size.
So everything's resolved?
Well I thought it was last night at midnight when I tested in on my laptop, the map was resizing fine to fill the containing div. However, when I checked on my phone this morning the map was not resizing properly. So I've not had time to check it properly yet.
Ok, let me know if you think it comes down to something Perch is doing.