From: Curt M. <we...@us...> - 2004-03-03 23:06:56
|
Update of /cvsroot/xastir/xastir/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13254 Modified Files: map_geo.c Log Message: Toporama map speedups made possible by Steve Dimse's changes on the server. Index: map_geo.c =================================================================== RCS file: /cvsroot/xastir/xastir/src/map_geo.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** map_geo.c 2 Mar 2004 17:56:00 -0000 1.27 --- map_geo.c 3 Mar 2004 22:54:04 -0000 1.28 *************** *** 255,295 **** // requested map scale. // ! if (toporama_flag == 50) { ! if (scale_y > 32) { ! my_screen_width = (int)(screen_width * (scale_y/32)); ! my_screen_height = (int)(screen_height * (scale_y/32)); ! my_zoom = 1.0; ! } ! else if (scale_y <= 16) { ! my_screen_width = (int)(screen_width / 2); ! my_screen_height = (int)(screen_height / 2); ! my_zoom = 1.0; ! } ! else { ! my_screen_width = (int)screen_width; ! my_screen_height = (int)screen_height; ! my_zoom = 1.0; ! } } ! else { // toporama_flag == 250 ! if (scale_y > 128) { ! my_screen_width = (int)(screen_width * (scale_y/128)); ! my_screen_height = (int)(screen_height * (scale_y/128)); ! my_zoom = 1.0; ! } ! else if (scale_y <= 64) { ! my_screen_width = (int)(screen_width / 2); ! my_screen_height = (int)(screen_height / 2); ! my_zoom = 1.0; ! } ! else { ! my_screen_width = (int)screen_width; ! my_screen_height = (int)screen_height; ! my_zoom = 1.0; ! } } xastir_snprintf(fileimg, sizeof(fileimg), ! "http://mm.aprs.net/toporama.cgi?set=%d|lat=%f|lon=%f|width=%d|height=%d|zoom=%0.1f", toporama_flag, // Scale, 50 or 250 lat_center, --- 255,282 ---- // requested map scale. // ! my_screen_width = (int)screen_width; ! my_screen_height = (int)screen_height; ! ! if (toporama_flag == 50) { // 1:50k ! ! my_zoom = 32.0 / scale_y; ! ! if (scale_y <= 16) ! my_zoom = 2.0; } ! else { // toporama_flag == 250 (1:250k) ! ! my_zoom = 128.0 / scale_y; ! ! if (scale_y <= 64) ! my_zoom = 2.0; } + + // Set a max zoom limit so we don't tax the server too much. + if (my_zoom < 0.02) + my_zoom = 0.02; xastir_snprintf(fileimg, sizeof(fileimg), ! "http://mm.aprs.net/toporama.cgi?set=%d|lat=%f|lon=%f|width=%d|height=%d|zoom=%0.3f", toporama_flag, // Scale, 50 or 250 lat_center, |