Currently I can set the value game.player.zoom that will change the zoom level. This however works only if player.render_mode is render_mode.game (i.e. map is closed) or render_mode.chart_zoomed_in (i.e. map is open and zoomed in so that the world can be seen).
It is currently not possible to change the zoom level if the render_mode == render_mode.chart.
Motivation explained in another thread.
Changing zoom level in the map view (i.e. when render_mode == render_mode.chart)
Re: Changing zoom level in the map view (i.e. when render_mode == render_mode.chart)
PS In Vanilla map, zooming in and out is relative to the mouse cursor. It would be nice if changing zoom level via script could respect that.
Re: Changing zoom level in the map view (i.e. when render_mode == render_mode.chart)
I would like to second this request (or at least parts of it) for two reasons:
- Completeness: this parameter can be used to control the two other rendering modes, I don't really see any good reason for why it shouldn't work for the regular map if it works for the zoom-to-world-map.
- Hijacking the zoom system through mods: I have a long running mod (Infinizoom) that tries to "remove" the zoom limits from the game. At the release of Factorio 1.0 I did some experiments with, basically, replacing the zoom system with custom scripts. By consuming the (alt-)zoom-in/-out hotkeys it is possible to get it working with reasonable side-effects, except that it is no longer possible to zoom in the map. (player.open_map() is, unfortunately, not an option as it would require the current map position, something a mod simply cannot know)