Ejemplo n.º 1
0
int   roadmap_square_cross_pos (RoadMapPosition *position) {

	/* return the equivalent edge on the next square */
   int scale = roadmap_square_current_scale_factor ();
   RoadMapArea *edges = &RoadMapSquareActive->Square[RoadMapSquareCurrentSlot]->edges;

   if (position->latitude < edges->south + scale) {
      position->latitude -= scale;
      return ROADMAP_DIRECTION_NORTH;
   }
   if (position->latitude > edges->north - scale) {
      position->latitude += scale;
      return ROADMAP_DIRECTION_SOUTH;
   }
   if (position->longitude < edges->west + scale) {
      position->longitude -= scale;
      return ROADMAP_DIRECTION_EAST;
   }
   if (position->longitude > edges->east - scale) {
      position->longitude += scale;
      return ROADMAP_DIRECTION_WEST;
   }

   return -1;
}
Ejemplo n.º 2
0
void roadmap_shape_get_position (int shape, RoadMapPosition *position) {

   int scale_factor = roadmap_square_current_scale_factor ();
   position->longitude += (int)RoadMapShapeActive->Shape[shape].delta_longitude * scale_factor;
   position->latitude  += (int)RoadMapShapeActive->Shape[shape].delta_latitude * scale_factor;
}