- coord = vik_viewport_get_center ( viewport );
- vik_coord_to_latlon ( coord, &ll );
+ // Use the provided position otherwise use center of the viewport
+ if ( vc )
+ vik_coord_to_latlon ( vc, &ll );
+ else {
+ const VikCoord *coord = NULL;
+ coord = vik_viewport_get_center ( viewport );
+ vik_coord_to_latlon ( coord, &ll );
+ }