[Xastir-Dev] New feature: max/min zoom levels in map chooser

Jack Twilley jmt at twilley.org
Wed Oct 29 01:28:14 EST 2003


WARNING: Unsanitized content follows.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have finally finished this feature, and it is now committed.
Here's some documentation, in Q&A format.

Q: What are max/min zoom levels?

A: Max/min zoom levels are zoom levels above (or below) which specific
   maps will not be displayed.

Q: Doesn't xastir already do that, sort of?

A: For quite some time, xastir has had partial support for this
   feature, but it was undocumented and hard-coded for specific map
   types.  This implementation is generic and will work for all maps
   in the chooser.

Q: How does it work?

A: The map index data structure has two new elements, max_zoom and
   min_zoom.  The user interface has been modified to accommodate
   these new elements, complete with buttons and the like.  The zoom
   levels are checked in map_onscreen_index(), comparing the limits to
   scale_y. 

Q: What about my existing map_index.sys file?

A: Run these commands:
   $ cd ~/.xastir/config
   $ mv map_index.sys map_index.sys-old
   $ awk -F, 'BEGIN { OFS="," } { print $1, $2, $3, $4, "00000", "00000", $5, $6, $7, $8 }' < map_index.sys-old > map_index.sys

   That'll modify your existing map_index.sys to handle the two new
   columns.  When both values are zero, the software behaves exactly
   as it did before the patch.

Q: Can you give me a quick demo?

A: Sure!  Use whatever method you'd like to change the max_zoom from
   "00000" to "00512".  Open up xastir (if you haven't already) at
   zoom level 32.  Notice that everything looks okay.  Zoom up a
   couple of times, observing how long it takes to render everything.
   Above a certain level, the old code's effects can still be observed
   when some files are opened and read but not displayed.  Now, when
   you get to 512, zoom out once more.  Is that not magic?  For the
   other direction, change all the min_zoom values from "00000" to
   "00016", and zoom in.  Isn't it wonderful?

Q: What else is there to do?

A: The next step is to clean up the rest of the map code and remove
   any special case code that displays or not based on zoom level.
   Once that is done, what you see in the chooser will be what you get.
   Also, all the language files need to be modified to support the 
   new columns in the properties screen.  I fixed English as a test
   case, and the changes to other languages are pretty simple.

Special thanks to Curt for his suggestions on some snags I hit and to
Tom Russo for inspiring me to just do it and for testing the final
product.

Jack.
- -- 
Jack Twilley
jmt at twilley dot org
http colon slash slash www dot twilley dot org slash tilde jmt slash
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/n14CGPFSfAB/ezgRAsJyAKCUyvZSLp3BcEKlqM93+uzFVdESwQCgslFC
Geyl0M9dGroS/VqFA4QHdt8=
=Lp8F
-----END PGP SIGNATURE-----



More information about the Xastir-dev mailing list