1 (edited by casimps1 2020-10-16 21:09:29)

Topic: Applying position limits to match screen size

I'm trying to display a map full-screen (on a 16:9 display), and allow panning/zooming, but make it so that only the area between a set of min/max latitude/longitude is visible on-screen. However, I don't see any way to make this happen.

As far as I can tell, the map can only be rendered in pixel sizes that are multiple of 256. So, to make the map fullscreen, I have to render it at a multiple-of-256 resolution that's larger than my screen resolution. I'm doing that and rendering as a Tileset for speed, and that works fine... but then when I use Online Maps Limit component (in Border mode), it limits based on the full map resolution, not the screen resolution. So, parts of the limited area never actually end up on screen.

What's the correct way to do this?

Re: Applying position limits to match screen size


Unfortunately, the Online Maps Limits component cannot help you with this.
You will need to implement this yourself.
How to do it:
Subscribe to OnlineMaps.OnChangePosition and OnlineMaps.OnChangeZoom, get coordinates at the corners of the screen, and, if it's outside your range, change the map position so that the corner of the screen is in the available coordinate range.
http://infinity-code.com/doxygen/online … c109e03245