Abstract: There is provided a technique of operating a real-time locating system (RTLS) in an indoor environment. The technique comprises: obtaining from a UD a timestamped dataset informative of ID of a tagged object registered by the UD in its proximity, of ID of the UD and of ambiguous sample electromagnetic pattern (SEP) registered by the UD; and defining a location of the tagged object at a point-in-time in accordance with the location of the UD, the point-in-time corresponding to a timestamp of the dataset. The location of the UD is defined using a SEP map informative of associations, at point-in-time, between the SEPs and locations thereof. The SEP map is continuously generated by processing timestamped “UD reports” continuously received from a plurality of UDs, each “UD report” comprising data informative of a respectively registered SEP and a unique identification of a reported UD (IDUD).