addRefToEntry_(featureUid, entry) {
    const currentRef = this.uidToRef_.get(featureUid);

    // the ref starts at 1 to distinguish from white color (no feature)
    const ref =
      currentRef || this.freeGlobalRef_.pop() || ++this.globalCounter_;
    entry.ref = ref;
    if (!currentRef) {
      this.refToFeature_.set(ref, entry.feature);
      this.uidToRef_.set(featureUid, ref);
    }
    return entry;
  }
@param {string} featureUid Feature uid
@param {GeometryBatchItem} entry The entry to add
@return {GeometryBatchItem} the added entry
@private