question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to positionate overlay

See original GitHub issue

How to place popup correctly ? I have a map where every areas (features) are visible on the screen, and I don’t want anyone to move it. So I want the popup to be shown on the map but the popup doesn’t place itself automatically. When I click on some area on the edge of the screen the map gets dragged to the selected area

image

When I move the map, the size change

image

Whenever I click on some feature, on the bottom of the screen, the map is dragging me slowly to the selected area because of the “pointOnSurface” method How can the popup be shown only on visible screen ?

<div class="ol-overlay-container ol-selectable" style="position: absolute; top: 179px; left: 0;">

Top and left values are dynamically changed every one second

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:19 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ghettovoicecommented, Jan 29, 2019

Ok, I got it. In the demo there is additional css styles applied to the overlay container that prevents positioning from property. And also there is a bug in the vl-overlay styles, it always have position: abosulte.

According to the demo code, try to comment out this styles https://github.com/ghettovoice/vuelayers-demo/blob/master/src/App.vue#L761
And add this rules to workaround style bug:

.vl-overlay
    position: relative !important
0reactions
felixdenoixcommented, Jan 30, 2019

Allright everything is working fine now ! Thanks a lot for the plugin 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS Overlay Techniques - Codrops
First, you need to make sure that the overlay is positioned absolutely with respect to the body . So, if the overlay is...
Read more >
How to Overlay One Div Over Another - W3docs
Style the "overlay" class by using the z-index, margin and background properties. .container { width: 150px; height: 150px; position: ...
Read more >
How To Create an Overlay Effect - W3Schools
Learn how to create an overlay effect with CSS. ... Turn on the overlay effect ... Example. #overlay { position: fixed; /* Sit...
Read more >
Position overlay div - css - Stack Overflow
You need to set the parent element using position relative then use position absolute on the element you want to position.
Read more >
Positioning Overlay Content with CSS Grid
Recently, I have been experimenting with CSS Grid and alignment properties to create component layouts that contain multiple overlapping ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found