Changing fixed point when resizing map?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Changing fixed point when resizing map?

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.

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.

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

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

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

Users mailing list
[hidden email]