Thank you very much for your ideas, I'll try to implement most of it into the next versions. Very much appreciated.zorg wrote: ↑Fri Apr 07, 2017 2:25 pmA questions:
The init function has a few parameters, but it's somewhat unclear what they really do.
The file is of course self-explanatory, the region limits are there, i assume, because one might download a bigger map, and may only want part of it to be used in-game at a time, for example.
The width and height will be the canvas properities, i suppose.
So, if you define the usable area in terms of the input area, and the usable area in terms of the output graphic, what does the zoom parameter do? Or rather, which other parameter(s) will it modify?
To answer your questions:
I am going to move the drawing logic (region, width, height, zoom etc.) out of the init code.
Region is there as you correctly understand to crop displayed map to smaller region from larger geoJSON file. This helps in terms of processing efficiency as it completely ignores structures out of the defined region.
Width & Height are canvas properties, correct.
Zoom is going to clip map to part of it, effectively similar to zooming in in Google maps or similar (although the zoomed in region is currently quite random - around the center and to the lower left of the map). So, effectively it modifies region it's going to draw - which I guess can be completely handled by the region setting itself :-)