Skip to content

Instantly share code, notes, and snippets.

@osdrv
Created December 30, 2011 10:20
Show Gist options
  • Save osdrv/1539165 to your computer and use it in GitHub Desktop.
Save osdrv/1539165 to your computer and use it in GitHub Desktop.
mercator pacific-placed route maping transformation
Vec2f next_point = Vec2f( lat * 180 / M_PI, lon * 180 / M_PI );
Vec2f tmp_next_point = next_point;
if ( this->via_pacific ) {
if ( next_point.y * current_point.y < 0 ) {
this->shape.moveTo( Mercator::mapLatLon( Vec2f( next_point.x, ( next_point.y > 0 ) ? ( next_point.y - 180 ) : ( next_point.y + 180 ) ) ) );
}
tmp_next_point = Vec2f( next_point.x, ( next_point.y > 0 ) ? ( next_point.y - 180 ) : ( next_point.y + 180 ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment