void roadmap_square_set_screen_scale (int scale) { if (scale < 0) { scale = 0; } if (scale > roadmap_tile_get_max_scale ()) { scale = roadmap_tile_get_max_scale (); } RoadMapScaleCurrent = scale; }
static void roadmap_square_get_tiles (RoadMapArea *area, int min_scale) { RoadMapPosition position; RoadMapPosition corner; RoadMapPosition origin; int scale; int step; int max_scale = roadmap_tile_get_max_scale (); corner.longitude = area->west; corner.latitude = area->south; if (max_scale > min_scale + 1) { max_scale = min_scale + 1; } for (scale = min_scale; scale <= max_scale; scale++) { roadmap_tile_get_origin (scale, &corner, &origin); step = roadmap_tile_get_size (scale); for (position.longitude = origin.longitude; position.longitude <= area->east; position.longitude += step) { for (position.latitude = origin.latitude; position.latitude <= area->north; position.latitude += step) { roadmap_tile_request (roadmap_tile_get_id_from_position (scale, &position), ROADMAP_TILE_STATUS_PRIORITY_NONE, 0, NULL); } } } }
int roadmap_tile_get_scale (int tile) { int max = roadmap_tile_get_max_scale (); int i; for (i = 1; i <= max; i++) { if (ScaleData[i].base_index > tile) break; } return i - 1; }
void roadmap_square_adjust_scale (int zoom_factor) { int scale; int max_scale; max_scale = roadmap_tile_get_max_scale (); for (scale = 1; scale <= max_scale && roadmap_tile_get_scale_factor (scale) <= zoom_factor; scale++) ; roadmap_square_set_screen_scale (scale - 1); }
int roadmap_square_get_num_scales (void) { return roadmap_tile_get_max_scale () + 1; }