Placing an infobox (overlay) manually near a pointer (overlay) on OpenStreetMaps
up vote
1
down vote
favorite
I am using some "advanced" pointers and infoboxes on my OpenStreetMap. Those markers and infoboxes is made as overlayes containing HTML. It is all working fine :-) But I am having a problem. I am always showing the infoboxes below the pointer (using lat and long for the pointer), but when a pointer i places near the top of the map, then I need to show the infoBox below the pointer. I have tried to solve that issue by multiplying the latitude with a number, but the number is depended on zoom level and latitude.
So my question is, is there a way to calculate a point, so it is always placed in the same visual distance from the pointer, on behalf of a given lat and long (the pointer)?
javascript typescript maps openlayers openstreetmap
|
show 5 more comments
up vote
1
down vote
favorite
I am using some "advanced" pointers and infoboxes on my OpenStreetMap. Those markers and infoboxes is made as overlayes containing HTML. It is all working fine :-) But I am having a problem. I am always showing the infoboxes below the pointer (using lat and long for the pointer), but when a pointer i places near the top of the map, then I need to show the infoBox below the pointer. I have tried to solve that issue by multiplying the latitude with a number, but the number is depended on zoom level and latitude.
So my question is, is there a way to calculate a point, so it is always placed in the same visual distance from the pointer, on behalf of a given lat and long (the pointer)?
javascript typescript maps openlayers openstreetmap
I thing If ypu change the zoom level may solve your problem
– LDS
Nov 20 at 10:15
Thanks for you reply. The problem appears when the user use the zoom function?
– PNR
Nov 20 at 10:45
on the click event of the marker to display the infobox
– LDS
Nov 20 at 10:47
I am really sorry, but I don't understand the solution you are suggesting.
– PNR
Nov 22 at 7:41
I mean on the click event of the marker change the zoom level
– LDS
Nov 22 at 8:12
|
show 5 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am using some "advanced" pointers and infoboxes on my OpenStreetMap. Those markers and infoboxes is made as overlayes containing HTML. It is all working fine :-) But I am having a problem. I am always showing the infoboxes below the pointer (using lat and long for the pointer), but when a pointer i places near the top of the map, then I need to show the infoBox below the pointer. I have tried to solve that issue by multiplying the latitude with a number, but the number is depended on zoom level and latitude.
So my question is, is there a way to calculate a point, so it is always placed in the same visual distance from the pointer, on behalf of a given lat and long (the pointer)?
javascript typescript maps openlayers openstreetmap
I am using some "advanced" pointers and infoboxes on my OpenStreetMap. Those markers and infoboxes is made as overlayes containing HTML. It is all working fine :-) But I am having a problem. I am always showing the infoboxes below the pointer (using lat and long for the pointer), but when a pointer i places near the top of the map, then I need to show the infoBox below the pointer. I have tried to solve that issue by multiplying the latitude with a number, but the number is depended on zoom level and latitude.
So my question is, is there a way to calculate a point, so it is always placed in the same visual distance from the pointer, on behalf of a given lat and long (the pointer)?
javascript typescript maps openlayers openstreetmap
javascript typescript maps openlayers openstreetmap
asked Nov 20 at 9:15
PNR
1222415
1222415
I thing If ypu change the zoom level may solve your problem
– LDS
Nov 20 at 10:15
Thanks for you reply. The problem appears when the user use the zoom function?
– PNR
Nov 20 at 10:45
on the click event of the marker to display the infobox
– LDS
Nov 20 at 10:47
I am really sorry, but I don't understand the solution you are suggesting.
– PNR
Nov 22 at 7:41
I mean on the click event of the marker change the zoom level
– LDS
Nov 22 at 8:12
|
show 5 more comments
I thing If ypu change the zoom level may solve your problem
– LDS
Nov 20 at 10:15
Thanks for you reply. The problem appears when the user use the zoom function?
– PNR
Nov 20 at 10:45
on the click event of the marker to display the infobox
– LDS
Nov 20 at 10:47
I am really sorry, but I don't understand the solution you are suggesting.
– PNR
Nov 22 at 7:41
I mean on the click event of the marker change the zoom level
– LDS
Nov 22 at 8:12
I thing If ypu change the zoom level may solve your problem
– LDS
Nov 20 at 10:15
I thing If ypu change the zoom level may solve your problem
– LDS
Nov 20 at 10:15
Thanks for you reply. The problem appears when the user use the zoom function?
– PNR
Nov 20 at 10:45
Thanks for you reply. The problem appears when the user use the zoom function?
– PNR
Nov 20 at 10:45
on the click event of the marker to display the infobox
– LDS
Nov 20 at 10:47
on the click event of the marker to display the infobox
– LDS
Nov 20 at 10:47
I am really sorry, but I don't understand the solution you are suggesting.
– PNR
Nov 22 at 7:41
I am really sorry, but I don't understand the solution you are suggesting.
– PNR
Nov 22 at 7:41
I mean on the click event of the marker change the zoom level
– LDS
Nov 22 at 8:12
I mean on the click event of the marker change the zoom level
– LDS
Nov 22 at 8:12
|
show 5 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53389681%2fplacing-an-infobox-overlay-manually-near-a-pointer-overlay-on-openstreetmaps%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I thing If ypu change the zoom level may solve your problem
– LDS
Nov 20 at 10:15
Thanks for you reply. The problem appears when the user use the zoom function?
– PNR
Nov 20 at 10:45
on the click event of the marker to display the infobox
– LDS
Nov 20 at 10:47
I am really sorry, but I don't understand the solution you are suggesting.
– PNR
Nov 22 at 7:41
I mean on the click event of the marker change the zoom level
– LDS
Nov 22 at 8:12