diff --git a/android/src/main/java/com/github/quadflask/react/navermap/RNNaverMapMarker.java b/android/src/main/java/com/github/quadflask/react/navermap/RNNaverMapMarker.java index 5578cd7f..337200dc 100644 --- a/android/src/main/java/com/github/quadflask/react/navermap/RNNaverMapMarker.java +++ b/android/src/main/java/com/github/quadflask/react/navermap/RNNaverMapMarker.java @@ -148,6 +148,10 @@ public void setHeight(int height) { feature.setHeight(height); } + public void setHideCollidedCaptions(boolean isHideCollidedCaptions) { + feature.setHideCollidedCaptions(isHideCollidedCaptions); + } + public void setCaption(String text, int textSize, int color, int haloColor, int offset, Align... aligns) { feature.setCaptionText(text); feature.setCaptionTextSize(textSize); @@ -161,6 +165,17 @@ public void removeCaption() { feature.setCaptionText(""); } + public void setSubCaption(String text, int textSize, int color, int haloColor) { + feature.setSubCaptionText(text); + feature.setSubCaptionTextSize(textSize); + feature.setSubCaptionColor(color); + feature.setSubCaptionHaloColor(haloColor); + } + + public void removeSubCaption() { + feature.setSubCaptionText(""); + } + public void setImage(String uri) { if (uri != null) { OverlayImage overlayImage = OverlayImages.get(uri); diff --git a/android/src/main/java/com/github/quadflask/react/navermap/RNNaverMapMarkerManager.java b/android/src/main/java/com/github/quadflask/react/navermap/RNNaverMapMarkerManager.java index 5dcdb274..14cc4267 100644 --- a/android/src/main/java/com/github/quadflask/react/navermap/RNNaverMapMarkerManager.java +++ b/android/src/main/java/com/github/quadflask/react/navermap/RNNaverMapMarkerManager.java @@ -127,6 +127,11 @@ public void setZIndex(RNNaverMapMarker view, int zIndex) { view.setZIndex(zIndex); } + @ReactProp(name = "isHideCollidedCaptions", defaultBoolean = false) + public void setHideCollidedCaptions(RNNaverMapMarker view, boolean isHideCollidedCaptions) { + view.setHideCollidedCaptions(isHideCollidedCaptions); + } + @ReactProp(name = "caption") public void setCaption(RNNaverMapMarker view, ReadableMap map) { if (map == null || !map.hasKey("text")) { @@ -143,6 +148,20 @@ public void setCaption(RNNaverMapMarker view, ReadableMap map) { view.setCaption(text, textSize, color, haloColor, offset, align); } + @ReactProp(name = "subCaption") + public void setSubCaption(RNNaverMapMarker view, ReadableMap map) { + if (map == null || !map.hasKey("text")) { + view.removeSubCaption(); + return; + } + String text = map.getString("text"); + int textSize = map.hasKey("textSize") ? map.getInt("textSize") : 15; + int color = map.hasKey("color") ? parseColorString(map.getString("color")) : Color.BLACK; + int haloColor = map.hasKey("haloColor") ? parseColorString(map.getString("haloColor")) : Color.WHITE; + + view.setSubCaption(text, textSize, color, haloColor); + } + @Override public void addView(RNNaverMapMarker parent, View child, int index) { parent.setCustomView(child, index);