Comments (15)
Related ticket: 3567 due to 3531
NOTE: I have not tried to reproduce the problem described here.
from ol2.
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.
@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.
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.
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.
Most importantly any help on how to solve the problem is very much welcome!
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.
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:
from ol2.
I have temporarily solved the problem by setting the maxWidth propery of the popup, but it's clearly just a work-around.
from ol2.
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.
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.
@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.
See pull request #505
from ol2.
@ksnabb Please try #505, now is fixed on 2.12 branch.
from ol2.
Thanks it works!
from ol2.
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)
- Maps do not pan in Chrome 55 or Microsoft Edge HOT 2
- implement openlayers with bing offline server
- Featureclick eventListeners randomly not work on chrome 51 HOT 1
- Get OpenLayers from packagist
- Clojure Compiler Link is dead
- Scroll bar does not show in Popup.FramedCloud in mobile devices (OL 2.13.1) HOT 3
- Need to add set style feature to Google Layer HOT 1
- OpenStreetMap newly redirecting tile URLs. Problem on safari HOT 1
- Incorrect Web Mercator transforms with newest versions of proj4js
- Map extent is increased after setting base layer
- How to Convert Circle Polygon Geometry to Line in openlayers 2 HOT 1
- Snapping another layer point with Create Circle Polygon in Openlayers 2
- how to show a arrow feature by some longitude
- Ping (ICMP) send during Layer/Map request
- Image getting stretched in Image layer
- How to Change style of point feature to polygon?
- Open source License obligations of openlayers-2.13.1 HOT 3
- Responsible disclosure policy
- Dev.openlayers.org is gone HOT 10
- Google Map Layers not rendering anymore HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ol2.