Giter Club home page Giter Club logo

Comments (15)

jorix avatar jorix commented on July 2, 2024

Related ticket: 3567 due to 3531

NOTE: I have not tried to reproduce the problem described here.

from ol2.

ksnabb avatar ksnabb commented on July 2, 2024

Both related tickets posted seems to be fixed. But the bug still with FramedCloud and autoSize is not fixed in the development version.

I have the following code:


new OpenLayers.Popup.FramedCloud(
                        evt.id,
                        evt.lonlat,
                        null,
                        evt.data.contentHTML,
                        null,
                        false);


Where evt object contains the id lonlat and html content. The HTML content is visible and popup height is good but the width seems to be set to a little bit narrower then the map.

from ol2.

jorix avatar jorix commented on July 2, 2024

@ksnabb: What you say is a different bug is I have seen several cases but I had not reported...

is not related to the scroll bar? in some browsers height is a bit more than necessary? And using IE9 compatibly mode the height is correct? I think All of this is a bug!

From my point of view deserves a new issue or more.

NOTE: I have no authority to close this issue, but AFAIK it is solved.

from ol2.

pratikhublikar avatar pratikhublikar commented on July 2, 2024

I guess the Popup autoSize calculates the size with respect to the map instead of the content.The problem is definitely there and needs to be fixed.Its kind of annoying.

from ol2.

ksnabb avatar ksnabb commented on July 2, 2024

This commit:

openlayers/openlayers@ded64c0#diff-8

Broke the autoSize in some cases? This issue was reported in trac ticket #3567. The fix for this ticket breaks the autoSize of the popup in other cases. I am not sure in which cases but we use ArcGISCache layer with the the following options where layer is the information retrieved from the server:

mapOptions = {
maxExtent: layer.maxExtent,
units: layer.units,
resolutions: layer.resolutions,
numZoomLevels: layer.lods.length,
tileSize: layer.tileSize,
projection: layer.projection,
restrictedExtent: layer.maxExtent
};

I tried to restrict the popup content width with css, programmatically etc. Only changing the map.div to map.layerContainerDiv fixed the autoSize issue. I wonder why the fix for #3531 sets the width and height to 100px and how this could be done in a better way without breaking popup autoSize?

openlayers/openlayers@ded64c0#diff-8

There might also be other better functioning options on how to fix issue #3531 which is the root of the problem? I am not sure of how the OpenLayer community deals with bug fixes and testing but to me it does not seem that the solutions for #3531 and #3567 are complete and this issue is related but not fixed. I also base this on that the fixes was done 7 months ago but this issue reported 6 months ago.

Most importantly any help on how to solve the problem is very much welcome!

from ol2.

jorix avatar jorix commented on July 2, 2024

Most importantly any help on how to solve the problem is very much welcome!

@ksnabb

Try: dd1eababa92f3a118b3bbd72562a938a51bddea3 + 67bb86a

This is to fix: When a scroll bar, the popup width is narrower than necessary (in some circumstances). I'm still working on it.

See also #485

from ol2.

ksnabb avatar ksnabb commented on July 2, 2024

The problem arrises at least on Chrome 19 and Firefox 12. I am not sure it is in anyway related to the scrollbar though. The popup just always gets the width of the map. I added an image that shows the problem:

Popup width problem

from ol2.

fanenji avatar fanenji commented on July 2, 2024

I have temporarily solved the problem by setting the maxWidth propery of the popup, but it's clearly just a work-around.

from ol2.

jorix avatar jorix commented on July 2, 2024

@ksnabb

I am not sure it is in anyway related to the scrollbar though

Not seem.

To analyze this would need the html of the popup, as it is created, any change in CSS classes .olPopupxxxx on "style.css"?... (or better a URL to reproduce) ... need to see it.

It seems that the solution may come from any adjustment in html (eg remove some width:100%) or use a maximum width setting html = '<div style="max-width:xxxpx">...html...</div>'; ...

from ol2.

ksnabb avatar ksnabb commented on July 2, 2024

The content of the popup is normal HTML and checking the css there is no styles other then OpenLayers styles affecting the popup. It also does not matter if I just write something in the popup like "hello world" it will still get the width of the map.

And maybe but I feel a far fetched maybe it is about how I positioned the map:


#map {
    position: absolute;
    top: 0px;
    bottom: 0px;
    left: 0px;
    right: 0px;
}

I wonder if this a problem which is hard to reproduce? I do not think I did anything special just created a FramedCloudPopup added it to the map with some HTML content.

I did solve the problem with setting maxSize and setting width to something that still looks ok:


OpenLayers.Popup.FramedCloud.prototype.maxSize = new OpenLayers.Size(370, 1024); 

from ol2.

jorix avatar jorix commented on July 2, 2024

@ksnabb Yes! Yes! Is just due to #map {position: absolute;}, I reproduced the problem ;-)

After publishing the patches above I will investigate this (problem is in OpenLayers.Util.getRenderedDimensions +- 99%).

Have you tried to use a scheme like in http://www.openlayers.org/dev/examples/fullScreen.html, so html, body, #map {margin: 0; width: 100%; height: 100%;}?

from ol2.

jorix avatar jorix commented on July 2, 2024

See pull request #505

from ol2.

jorix avatar jorix commented on July 2, 2024

@ksnabb Please try #505, now is fixed on 2.12 branch.

from ol2.

ksnabb avatar ksnabb commented on July 2, 2024

Thanks it works!

from ol2.

jorix avatar jorix commented on July 2, 2024

Thanks it works!

Ok, then this issue can be closed. I have no authority to close it, @fanenji anyone can do?

Apologies for the delay in finding the problem and its solution.

from ol2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.