I just updated to the latest dev version and also updated to the 2.12 library. Now, all my mapquest maps look like the following image (squished and missing parts)...any help?

CommentFileSizeAuthor
mapquestosm.png152.08 KBRob_Feature

Comments

ishadakota’s picture

I'm having the same problem - I recreated an OpenLayers Data Overlay view and the OpenLayers Map view and the problem persisted. I can resolve by downgrading the library to 2.11 (but retaining the latest dev of the module).

The previews in both the OpenLayers Map admin and in the Views admin display in correct proportion, it's only in the final rendered view (page or block) that the issue occurs.

ishadakota’s picture

Thanks to #1818436: CSS crashes the img tags, I realized that in my case this is caused by using in responsive theme (Zen Responsive) where all images are set to max-width:auto.

In my case, implementing the following css resolves the issue:

.openlayers-container img {
    max-width: none;
}

Of course, this only allows a non-distorted, but also non-responsive, map within a responsive layout.

@Rob_Feature, if this fixes your issue, I suggest that we change this to a feature request with a title like "Support Responsive Maps in OpenLayers." It was suggested in the roadmap for 3.x in #1353122: 3.x Goals

Rob_Feature’s picture

Title: Mapquest OSM Map Distorted/Broken » Support Responsive Maps in OpenLayers
Category: bug » feature

Yup, I'm using a responsive theme with max-width: 100% as well. So this appears to be the issue...

pol’s picture

Status: Active » Needs work

Hello,

I'm not against including the CSS bit fix, but I don't want to loose the responsive feature.

Any idea on how to fix this in a elegant way ?

dasjo’s picture

Title: Support Responsive Maps in OpenLayers » Make responsive themes work with OpenLayers

in my opinion this issue isn't about making openlayers maps responsive, but fixing their appearance when using a responsive theme that declares

img { 
  max-width: 100%; 
}

responsive maps are a separate topic in my opinion, as just setting images to scale won't work for slippy maps that are compound of a grid of images.

thus i recommend:
- create a separate issue if you want responsive maps
- fix this issue by adding the following code to openlayers.css or add a note that for responsive base themes you need to declare this in your theme manually:

.openlayers-container img {
    max-width: none;
}

hope this helps

ifrik’s picture

In any case, it would be usefull to add some documentation on this - if only to point out why there is a problem with responsive themes.

pol’s picture

Status: Needs work » Fixed

Fixed.

dasjo’s picture

cool.

just a note: i saw from your commit that you are using 4 spaces for css indentation. would be better to keep with 2 spaces, as coding standards recommend.

pol’s picture

Fixed again :) Thanks !

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.