Since a marker is bound to a media id all existing media ids can be kept in an array or something. A new marker will be added only if the media id does not exist in the array.