Closed (outdated)
Project:
Openlayers
Version:
6.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 Aug 2010 at 13:22 UTC
Updated:
25 Nov 2021 at 00:04 UTC
Jump to comment: Most recent
Comments
Comment #1
tmcw commentedThe popup behavior packaged with OpenLayers currently passes
nullfor the size parameter when it creates FramedCloud popups. Why this is baked into HTML is a combination of 1) bad design on the OpenLayers library side, which they've been working to correct since it was implemented 2) sometimes this width is automatically adjusted with javascript.So, you can customize it in that behavior, clone the behavior, or use openlayers_plus for popups.
Comment #2
garbo commentedThanks tmcw for your quick response!
I have to confess that I'm yet very green to OpenLayers so I still have to dive deep into the docs and investigate the workings of this library. I will check out the openlayers_plus module and see if I can do what I want with it.
One more question though: When you say that i need to customize "that behaviour" do you mean that I need to write an additional javascript that overwrites the default settings?
Comment #3
davidhk commentedsubscribe
Comment #4
zzolo commentedHi @garbo, you can technically override the original popup behavior by redefining the function, or you can clone it and make a new one.
Also, the popup behavior can be expanded to include parameters for the FramedCloud, like width.
http://dev.openlayers.org/releases/OpenLayers-2.9.1/doc/apidocs/files/Op...
Comment #5
tmcw commentedNow a duplicate of: http://drupal.org/node/743306
Comment #6
chicagomom commentedCan anyone explain how to do this? (redefining the function, or clone it and make a new one) I've read everything I can find on the subject and can't figure this out. It looks like I need to include a custom .js file in a custom module, but what does the .js file need to include to enable me to control the width of the FramedCloud?
This issue seems different than the above-referenced one, which is about tooltips.
Thanks in advance.
Comment #7
Patroclas commentedIt's possible to limit the width of pop-ups with css. As far as I recall without digging into my stylesheets, I limited the width of the elements inside the pop-up so that the balloon does not display too wide.
Comment #8
Dale Baldwin commentedI just used that and it works every time no problem
Comment #9
zzolo commentedYeah, I have been able to target the items within the popup and have it work fine.
Please re-open if there are other questions.
Comment #10
shekhar_juneja commentedIn my case, width autoresizes but height is not autoresizing to desired height. The content overflows beyond the background.
Comment #11
kalidasan commentedI have installed openlayers_plus drupal module.
But still I can't control Width and height of the pop up.
Can any one please tell me how to control width and height of openlayer pop up (#popup_contentDiv) ?
Comment #12
greenskunk@kalidasan
You can control the popup size in your CSS using the class olPopup.
Example
This could be in either your themes CSS or create a new OpenLayers map theme.
Your Theme's CSS
I've setup Omega sub-themes that use the various breakpoint CSS files to set different size Popups.
Creating a new OpenLayers Map Theme
1) You can duplicate the default theme at sites/all/modules/openlayers/themes/default_dark
2) Set the path to your new theme in the settings at admin/structure/openlayers/maps/list/MACHINE_NAME_OF_MAP/edit).
Comment #13
kalidasan commented@greenSkunk
I have tried to control popup size by CSS but no luck.
Below link contains solution to do that. Here problem is, I'm adjusting width and height from core js (modules\contrib\openlayers\plugins\behaviors\openlayers_behavior_popup.js)
http://stackoverflow.com/questions/13522328/updating-resizing-popup-framed-cloud-in-openlayers
But How can I control/ adjust size in my custom js?
Comment #14
kalidasan commentedComment #15
ken-g commented