MapzenMap { public void setStyleAndLabelLevelAsync(@NonNull ThemedMapStyle themedMapStyle, int labelLevel, @NonNull OnStyleLoadedListener listener) { setStyleLabelLevelLodThemeColorAsync(themedMapStyle, labelLevel, themedMapStyle.getDefaultLod(), themedMapStyle.getDefaultColor(), listener); } MapzenMap(MapView mapView, MapController mapController, OverlayManager overlayManager,
      MapStateManager mapStateManager, LabelPickHandler labelPickHandler,
      BitmapMarkerManager bitmapMarkerManager, SceneUpdateManager sceneUpdateManager, Locale locale,
      MapzenManager mapzenManager, ImportYamlGenerator yamlGenerator); @NonNull MapController getMapController(); @NonNull OverlayManager getOverlayManager(); void setStyleAsync(@NonNull MapStyle mapStyle, @NonNull OnStyleLoadedListener listener); void setStyle(@NonNull MapStyle mapStyle); void setStyleAndLabelLevelAsync(@NonNull ThemedMapStyle themedMapStyle, int labelLevel,
      @NonNull OnStyleLoadedListener listener); void setStyleAndLabelLevel(@NonNull ThemedMapStyle themedMapStyle, int labelLevel); void setStyleAndLodAsync(@NonNull ThemedMapStyle themedMapStyle, int detailLevel,
      @NonNull OnStyleLoadedListener listener); void setStyleAndLod(@NonNull ThemedMapStyle themedMapStyle, int detailLevel); void setStyleAndThemeColorAsync(@NonNull ThemedMapStyle themedMapStyle,
      @NonNull ThemeColor color, @NonNull OnStyleLoadedListener listener); void setStyleAndThemeColor(@NonNull ThemedMapStyle themedMapStyle,
      @NonNull ThemeColor color); void setStyleLabelLevelLodThemeColorAsync(@NonNull ThemedMapStyle themedMapStyle,
      int labelLevel, int detailLevel, @NonNull ThemeColor color,
      @NonNull OnStyleLoadedListener listener); void setStyleLabelLevelLodThemeColor(@NonNull ThemedMapStyle themedMapStyle,
      int labelLevel, int detailLevel, @NonNull ThemeColor color); void setZoom(float zoom); void setZoom(float zoom, int duration); void setZoom(float zoom, int duration, @NonNull EaseType easeType); float getZoom(); void setPosition(@NonNull LngLat lngLat); void setPosition(@NonNull LngLat lngLat, int duration); void setPosition(@NonNull LngLat lngLat, int duration, @NonNull EaseType easeType); @NonNull LngLat getPosition(); void setRotation(float radians); void setRotation(float radians, int duration); void setRotation(float radians, int duration, @NonNull EaseType easeType); float getRotation(); void setTilt(float radians); void setTilt(float radians, int duration); void setTilt(float radians, int duration, @NonNull EaseType easeType); float getTilt(); void setCameraType(@NonNull CameraType type); @NonNull CameraType getCameraType(); void setMyLocationEnabled(boolean enabled); boolean isMyLocationEnabled(); void setCompassOnClickListener(@Nullable View.OnClickListener listener); void setFindMeOnClickListener(@Nullable View.OnClickListener listener); void setZoomInOnClickListener(@Nullable View.OnClickListener listener); void setZoomOutOnClickListener(@Nullable View.OnClickListener listener); @NonNull MapData addMarker(@NonNull Marker marker); void removeMarker(); @NonNull MapData addPolyline(@NonNull Polyline polyline); void removePolyline(); @NonNull MapData addPolygon(@NonNull Polygon polygon); void removePolygon(); @NonNull LngLat screenPositionToLngLat(@NonNull PointF position); @NonNull PointF lngLatToScreenPosition(@NonNull LngLat lngLat); void setTapResponder(@Nullable TouchInput.TapResponder tapResponder); @Nullable TouchInput.TapResponder getTapResponder(); void setDoubleTapResponder(@Nullable TouchInput.DoubleTapResponder doubleTapResponder); @Nullable TouchInput.DoubleTapResponder getDoubleTapResponder(); void setLongPressResponder(@Nullable TouchInput.LongPressResponder longPressResponder); @Nullable TouchInput.LongPressResponder getLongPressResponder(); void setPanResponder(@Nullable TouchInput.PanResponder panResponder); @Nullable TouchInput.PanResponder getPanResponder(); void setRotateResponder(@Nullable TouchInput.RotateResponder rotateResponder); @Nullable TouchInput.RotateResponder getRotateResponder(); void setScaleResponder(@Nullable TouchInput.ScaleResponder scaleResponder); @Nullable TouchInput.ScaleResponder getScaleResponder(); void setShoveResponder(@Nullable TouchInput.ShoveResponder shoveResponder); @Nullable TouchInput.ShoveResponder getShoveResponder(); void setSimultaneousGestureAllowed(@NonNull TouchInput.Gestures first,
      @NonNull TouchInput.Gestures second, boolean allowed); boolean isSimultaneousGestureAllowed(@NonNull TouchInput.Gestures first,
      @NonNull TouchInput.Gestures second); void setFeaturePickListener(@Nullable final FeaturePickListener listener); void setLabelPickListener(@Nullable final LabelPickListener listener); void setMarkerPickListener(@Nullable final MarkerPickListener listener); void setViewCompleteListener(@Nullable final ViewCompleteListener listener); void queueEvent(@NonNull Runnable r); @Deprecated void queueSceneUpdate(@NonNull String componentPath, @NonNull String value); @Deprecated void applySceneUpdates(); void setZoomButtonsEnabled(boolean enabled); void setCompassButtonEnabled(boolean enabled); void drawRoutePins(@NonNull LngLat start, @NonNull LngLat end); void clearRoutePins(); void drawDroppedPin(@NonNull LngLat point); void clearDroppedPins(); void drawSearchResult(@NonNull LngLat point); void drawSearchResult(@NonNull LngLat point, boolean active); void drawSearchResults(@NonNull List<LngLat> points); void drawSearchResults(@NonNull List<LngLat> points, int... activeIndexes); void clearSearchResults(); void drawRouteLocationMarker(@NonNull LngLat point); void clearRouteLocationMarker(); void drawRouteLine(@NonNull List<LngLat> points); void clearRouteLine(); void drawTransitRouteLine(@NonNull List<LngLat> points, @Nullable List<LngLat> stations,
      @NonNull String hexColor); void clearTransitRouteLine(); void setPersistMapData(boolean persistOnRecreation); void setPersistMapState(boolean persistStateOnRecreation); void setTransitOverlayEnabled(boolean transitOverlayEnabled); void setBikeOverlayEnabled(boolean bikeOverlayEnabled); void setPathOverlayEnabled(boolean pathOverlayEnabled); void setOverlaysEnabled(boolean transitOverlayEnabled, boolean bikeOverlayEnabled,
      boolean pathOverlayEnabled); void setHttpHandler(@NonNull MapzenMapHttpHandler handler); BitmapMarker addBitmapMarker(MarkerOptions markerOptions); @NonNull BitmapMarker addBitmapMarker(@NonNull BitmapMarkerOptions markerOptions);  }
@Test public void setStyleAndLabelLevelAsync_shouldCallLoadYamlWithCorrectValues() throws Exception { when(mapzenManager.getApiKey()).thenReturn("apiKey"); RefillStyle refillStyle = new RefillStyle(); map.setStyleAndLabelLevelAsync(refillStyle, 8, null); assertThat(mapStateManager.getThemeColor()).isEqualTo(refillStyle.getDefaultColor()); assertThat(mapStateManager.getLabelLevel()).isEqualTo(8); assertThat(mapStateManager.getLod()).isEqualTo(refillStyle.getDefaultLod()); String yaml = yamlGenerator.getImportYaml(refillStyle, 8, mapStateManager.getLod(), mapStateManager.getThemeColor()); String resourceRoot = refillStyle.getStyleRootPath(); List<SceneUpdate> sceneUpdates = new ArrayList<>(); sceneUpdates.add(new SceneUpdate(STYLE_GLOBAL_VAR_API_KEY, "apiKey")); sceneUpdates.add(new SceneUpdate(STYLE_GLOBAL_VAR_LANGUAGE, "en_us")); sceneUpdates.add(new SceneUpdate(STYLE_GLOBAL_VAR_TRANSIT_OVERLAY, "false")); sceneUpdates.add(new SceneUpdate(STYLE_GLOBAL_VAR_BIKE_OVERLAY, "false")); sceneUpdates.add(new SceneUpdate(STYLE_GLOBAL_VAR_PATH_OVERLAY, "true")); verify(mapController).loadSceneYamlAsync(eq(yaml), eq(resourceRoot), argThat( new SceneUpdatesMatcher(sceneUpdates))); }
@Test public void setStyleAndLabelLevelAsync_shouldCallListenerOnSceneLoaded() throws Exception { when(mapzenManager.getApiKey()).thenReturn("apiKey"); int sceneId = 8; when(mapController.loadSceneYamlAsync(anyString(), anyString(), anyList())).thenReturn(sceneId); TestOnStyleLoadedListener listener = new TestOnStyleLoadedListener(); RefillStyle refillStyle = new RefillStyle(); map.setStyleAndLabelLevelAsync(refillStyle, 8, listener); map.internalSceneLoadListener.onSceneReady(sceneId, null); assertThat(listener.loaded).isTrue(); }
@Test(expected = IllegalArgumentException.class) public void setStyleAndLabelLevelAsync_shouldVerifyLowValue() throws Exception { map.setStyleAndLabelLevelAsync(new RefillStyle(), -10, null); }
@Test(expected = IllegalArgumentException.class) public void setStyleAndLabelLevelAsync_shouldVerifyHighValue() throws Exception { map.setStyleAndLabelLevelAsync(new RefillStyle(), 12, null); }