-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to positionate overlay #80
Comments
It does exactly the same on the demo app. When you zoom in and click on the circle area, the map is being dragged. While it should just display the popup on the left side instead. |
Hi @rSammy , Also you can use
I can't reproduce auto dragging on the demo. Are you experience this behavior with the demo fork? |
Try zoom in the map like this, then if you click on the circle it will auto drag |
I don't know why, on my app the width of the div is too large. While my code looks like this
|
I have autopan enabled, I don't think that's the problem as it does the same on the demo app. |
I did this, here is screen cast https://drive.google.com/file/d/1UY7tAWCU6ZqRY0V2sY8qvFHTH-nI_W2C/view
Probably you should use absolute width because overlay div position is absolute |
Yes, and OpenLayers ol.Overlay component too, so there is autoPan option that is an easy work around. openlayers/openlayers#2181 |
You can try to listen map click event and dynamically compute |
I tried with google chrome, indeed i'm not being dragged, but with firefox it does
Yup, I put style="position:absolute" on template element it did the trick and stopped dragging the map |
Now I see. Very strange bug. |
On Firefox, when I set auto-pan to true, the map is getting dragged even when I set position absolute. When I set auto-pan off, I need to set position absolute, otherwise map get dragged. I still can't manage to position the popup correctly, it is always at the right of the feature |
Sorry for the late response. export const OVERLAY_POSITIONING = {
BOTTOM_LEFT: 'bottom-left',
BOTTOM_CENTER: 'bottom-center',
BOTTOM_RIGHT: 'bottom-right',
CENTER_LEFT: 'center-left',
CENTER_CENTER: 'center-center',
CENTER_RIGHT: 'center-right',
TOP_LEFT: 'top-left',
TOP_CENTER: 'top-center',
TOP_RIGHT: 'top-right',
} |
- upgrade to OpenLayers v5 (#66) - drop out support of OpenLayers v4 (for v4 there is v0.10.x branch) - change distribution package structure [BREAKING] Now the VueLayers provide only ES build for production/development environment and UMD build for a quick usage, so compiled ES source code should be imported simply from `/lib` directory (`/lib/_esm` was before). - fix jerking vl-overlay (#80) - vl-source-vector: handle `changefeature` event
- upgrade to OpenLayers v5 (#66) - drop out support of OpenLayers v4 (for v4 there is v0.10.x branch) - change distribution package structure [BREAKING] Now the VueLayers provide only ES build for production/development environment and UMD build for a quick usage, so compiled ES source code should be imported simply from `/lib` directory (`/lib/_esm` was before). - fix jerking vl-overlay (#80) - vl-source-vector: handle `changefeature` event - Update links in documentation (#88)
- fix jerking vl-overlay (#80) - vl-source-vector: handle `changefeature` event
Please try v0.11.0-rc.1 that is based on OpenLayers 5
or v0.10.15 that also contains the bugfix
|
fixed in the latest versions |
Hi @ghettovoice, it seems that the issue is not fixed yet on the example app you provide. <vl-overlay id="overlay" :position="overlayCoordinate" positioning="center-top">
<template slot-scope="scope">
<div class="overlay-content">
Hello world!<br>
Position: {{ scope.position }}
</div>
</template>
</vl-overlay> but not in the demo app when used in this line like so: <vl-overlay class="feature-popup" v-for="feature in select.features" :key="feature.id" :id="feature.id"
:position="pointOnSurface(feature.geometry)" :auto-pan="true" :auto-pan-animation="{ duration: 300 }" positioning="center-center"> any idea of how to solve the issue ? |
Hi @felixdenoix , What are showing in the devtool? Is it shows |
@ghettovoice thanks for the quick response ! <vl-overlay class="feature-popup" v-for="feature in select.features" :key="feature.id" :id="feature.id" :position="pointOnSurface(feature.geometry)" positioning="center-center"> So it seems that the |
Ok, I got it. According to the demo code, try to comment out this styles https://github.com/ghettovoice/vuelayers-demo/blob/master/src/App.vue#L761 .vl-overlay
position: relative !important |
Allright everything is working fine now ! Thanks a lot for the plugin :) |
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
When I move the map, the size change
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
The text was updated successfully, but these errors were encountered: