Skip to content

Commit f3f5a4e

Browse files
authored
fix(Android): Added A11y for Map and Marker (react-native-maps#5091)
1 parent 55ea9ce commit f3f5a4e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

android/src/main/java/com/rnmaps/maps/MapManager.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import androidx.annotation.NonNull;
66
import androidx.annotation.Nullable;
77

8+
import com.facebook.react.R;
89
import com.facebook.react.bridge.Arguments;
910
import com.facebook.react.bridge.ReactApplicationContext;
1011
import com.facebook.react.bridge.ReadableArray;
@@ -329,6 +330,11 @@ public void setKmlSrc(MapView view, String kmlUrl) {
329330
}
330331
}
331332

333+
@ReactProp(name = "accessibilityLabel")
334+
public void setAccessibilityLabel(MapView view, @Nullable String accessibilityLabel) {
335+
view.setTag(R.id.accessibility_label, accessibilityLabel);
336+
}
337+
332338
@Override
333339
public void receiveCommand(@NonNull MapView view, String commandId, @Nullable ReadableArray args) {
334340
int duration;

android/src/main/java/com/rnmaps/maps/MapMarkerManager.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import androidx.annotation.NonNull;
88
import androidx.annotation.Nullable;
99

10+
import com.facebook.react.R;
1011
import com.facebook.react.bridge.ReadableArray;
1112
import com.facebook.react.bridge.ReadableMap;
1213
import com.facebook.react.common.MapBuilder;
@@ -268,6 +269,11 @@ public void setTracksViewChanges(MapMarker view, boolean tracksViewChanges) {
268269
view.setTracksViewChanges(tracksViewChanges);
269270
}
270271

272+
@ReactProp(name = "accessibilityLabel")
273+
public void setAccessibilityLabel(MapMarker view, @Nullable String accessibilityLabel) {
274+
view.setTag(R.id.accessibility_label, accessibilityLabel);
275+
}
276+
271277
@Override
272278
public void addView(MapMarker parent, View child, int index) {
273279
// if an <Callout /> component is a child, then it is a callout view, NOT part of the

0 commit comments

Comments
 (0)