Changing fixed point when resizing map?
(too old to reply)
João Rodrigues
2017-08-05 18:15:21 UTC
Hi! :)

In an OpenLayers 3 map, when I resize the window, the fixed point of the
map is its center.

By fixed point, I mean the point that will always be visible, even if you
shrink the map to 50x50 pixels.

In the image url below, the fixed point (blue dot) is somewhere in the
Iberian Peninsula.

IMAGE 1 <Loading Image...>

Now, if I resize (in this case: shrink) the window (from whatever side of
corner), the map will resize, too. The center of the map (blue dot) is
fixed and is exactly at the same place, relative to the window.

IMAGE 2 <Loading Image...>

What I want is to change that fixed point to the top-left corner of the map
(red dot).

IMAGE 3 <Loading Image...>

I want that point to be always visible, even if I resize the map to 20x20

IMAGE 4 <Loading Image...>

In this case, resizing the map would sort of crop it on the right and
bottom sides.

I posted this on StackOverflow
in case you prefer to read it there.

How could I achieve this?


João Rodrigues

Continue reading on narkive: