It's technically possible to pass primary keys through different modules of your system, but from a software engineering point of view, It's totally discouraged.
There's a famous concept called Layered Programming, which you should have heard of it for sure.
The general purpose of this concept is the separation of functionalities or Loosely Coupling and ease of maintenance and further developments management.
The concept introduces 3 general layers for any software solution (mostly data-oriented) :
DAL (Data Access Layer), BLL(Business Logic Layer) and PL (Presentation Layer), which refer to 3 different aspect of the software solution.
Since you're to implement a college project, you don't have to go through the process of layered development, necessarily. But I recommend you to just try a simple methodology of this concept, because it really helps to build a robust foundation and dramatically decreases the rate of errors and code correction and adjustment efforts.
Also , exchanging primary key or any database-native data is totally discouraged.So try to exchange some other identifier. You can try to build an arbitrary identifier for each map marker, based on the primary key.