/*
 * Copyright 2018 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.android.gnd.ui.map;

import android.annotation.SuppressLint;
import androidx.fragment.app.Fragment;
import com.google.android.gnd.model.feature.Feature;
import com.google.android.gnd.model.feature.Point;
import com.google.common.collect.ImmutableSet;
import io.reactivex.Observable;
import io.reactivex.Single;

/** Common interface for various map provider libraries. */
public interface MapProvider {
  void restore(Fragment fragment);

  Fragment getFragment();

  Single<MapAdapter> getMapAdapter();

  /**
   * Interface defining map interactions and events. This a separate class from {@link MapProvider}
   * so that it can be returned asynchronously by {@link MapProvider#getMapAdapter()} if necessary.
   */
  interface MapAdapter {

    Observable<MapMarker> getMarkerClicks();

    Observable<Point> getDragInteractions();

    Observable<Point> getCameraPosition();

    void enable();

    void disable();

    void moveCamera(Point point);

    void moveCamera(Point point, float zoomLevel);

    Point getCenter();

    float getCurrentZoomLevel();

    @SuppressLint("MissingPermission")
    void enableCurrentLocationIndicator();

    void updateMarkers(ImmutableSet<Feature> features);
  }
}

@@ -1405,279 +1405,1012 @@
     
-Observable%3CPoint%3E getDragInteractions();%0A%0A    Observable%3CPoint%3E getCameraPosition();%0A%0A    void enable();%0A%0A    void disable();%0A%0A    void moveCamera(Point point);%0A%0A    void moveCamera(Point point, float zoomLevel);%0A%0A    Point getCenter();%0A%0A    float getCurrentZoomLevel();%0A
+/**%0A     * Returns a stream that emits the new viewport center each time the map is dragged by the user.%0A     */%0A    Observable%3CPoint%3E getDragInteractions();%0A%0A    /** Returns a stream that emits the viewport center on each camera movement. */%0A    Observable%3CPoint%3E getCameraPosition();%0A%0A    /** Enables map gestures like pan and zoom. */%0A    void enable();%0A%0A    /** Disables all map gestures like pan and zoom. */%0A    void disable();%0A%0A    /**%0A     * Repositions the viewport centered around the specified point without changing the current%0A     * zoom level.%0A     */%0A    void moveCamera(Point point);%0A%0A    /**%0A     * Repositions the viewport centered around the specified point while also updating the current%0A     * zoom level.%0A     */%0A    void moveCamera(Point point, float zoomLevel);%0A%0A    /** Returns the current center of the viewport. */%0A    Point getCenter();%0A%0A    /** Returns the current map zoom level. */%0A    float getCurrentZoomLevel();%0A%0A    /** Displays user location indicator on the map. */
 %0A   
@@ -2497,25 +2497,81 @@
     
-void updateMarker
+/** Update the vector features visible on the map. */%0A    void setFeature
 s(Im

Add Javadoc