react-native-maps 1.17.2 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,6 +5,7 @@ import android.view.View;
|
|
|
5
5
|
import androidx.annotation.NonNull;
|
|
6
6
|
import androidx.annotation.Nullable;
|
|
7
7
|
|
|
8
|
+
import com.facebook.react.R;
|
|
8
9
|
import com.facebook.react.bridge.Arguments;
|
|
9
10
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
10
11
|
import com.facebook.react.bridge.ReadableArray;
|
|
@@ -329,6 +330,11 @@ public class MapManager extends ViewGroupManager<MapView> {
|
|
|
329
330
|
}
|
|
330
331
|
}
|
|
331
332
|
|
|
333
|
+
@ReactProp(name = "accessibilityLabel")
|
|
334
|
+
public void setAccessibilityLabel(MapView view, @Nullable String accessibilityLabel) {
|
|
335
|
+
view.setTag(R.id.accessibility_label, accessibilityLabel);
|
|
336
|
+
}
|
|
337
|
+
|
|
332
338
|
@Override
|
|
333
339
|
public void receiveCommand(@NonNull MapView view, String commandId, @Nullable ReadableArray args) {
|
|
334
340
|
int duration;
|
|
@@ -7,6 +7,7 @@ import android.view.View;
|
|
|
7
7
|
import androidx.annotation.NonNull;
|
|
8
8
|
import androidx.annotation.Nullable;
|
|
9
9
|
|
|
10
|
+
import com.facebook.react.R;
|
|
10
11
|
import com.facebook.react.bridge.ReadableArray;
|
|
11
12
|
import com.facebook.react.bridge.ReadableMap;
|
|
12
13
|
import com.facebook.react.common.MapBuilder;
|
|
@@ -268,6 +269,11 @@ public class MapMarkerManager extends ViewGroupManager<MapMarker> {
|
|
|
268
269
|
view.setTracksViewChanges(tracksViewChanges);
|
|
269
270
|
}
|
|
270
271
|
|
|
272
|
+
@ReactProp(name = "accessibilityLabel")
|
|
273
|
+
public void setAccessibilityLabel(MapMarker view, @Nullable String accessibilityLabel) {
|
|
274
|
+
view.setTag(R.id.accessibility_label, accessibilityLabel);
|
|
275
|
+
}
|
|
276
|
+
|
|
271
277
|
@Override
|
|
272
278
|
public void addView(MapMarker parent, View child, int index) {
|
|
273
279
|
// if an <Callout /> component is a child, then it is a callout view, NOT part of the
|
package/lib/Geojson.d.ts
CHANGED
|
@@ -5,6 +5,33 @@ import { MapPolygonProps as PolygonProps } from './MapPolygon';
|
|
|
5
5
|
import { MapPolylineProps as PolylineProps } from './MapPolyline';
|
|
6
6
|
import { LatLng } from './sharedTypes';
|
|
7
7
|
export type GeojsonProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Sets the anchor point for the marker.
|
|
10
|
+
* The anchor specifies the point in the icon image that is anchored to the marker's position on the Earth's surface.
|
|
11
|
+
*
|
|
12
|
+
* The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0],
|
|
13
|
+
* where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner.
|
|
14
|
+
*
|
|
15
|
+
* The anchoring point in a W x H image is the nearest discrete grid point in a (W + 1) x (H + 1) grid, obtained by scaling the then rounding.
|
|
16
|
+
* For example, in a 4 x 2 image, the anchor point (0.7, 0.6) resolves to the grid point at (3, 1).
|
|
17
|
+
*
|
|
18
|
+
* @default {x: 0.5, y: 1.0}
|
|
19
|
+
* @platform iOS: Google Maps only. For Apple Maps, see the `centerOffset` prop
|
|
20
|
+
* @platform Android: Supported
|
|
21
|
+
*/
|
|
22
|
+
anchor?: MarkerProps['anchor'];
|
|
23
|
+
/**
|
|
24
|
+
* The offset (in points) at which to display the annotation view.
|
|
25
|
+
*
|
|
26
|
+
* By default, the center point of an annotation view is placed at the coordinate point of the associated annotation.
|
|
27
|
+
*
|
|
28
|
+
* Positive offset values move the annotation view down and to the right, while negative values move it up and to the left.
|
|
29
|
+
*
|
|
30
|
+
* @default {x: 0.0, y: 0.0}
|
|
31
|
+
* @platform iOS: Apple Maps only. For Google Maps, see the `anchor` prop
|
|
32
|
+
* @platform Android: Not supported. See see the `anchor` prop
|
|
33
|
+
*/
|
|
34
|
+
centerOffset?: MarkerProps['centerOffset'];
|
|
8
35
|
/**
|
|
9
36
|
* The pincolor used on markers
|
|
10
37
|
*
|
package/lib/Geojson.js
CHANGED
|
@@ -31,7 +31,7 @@ const MapMarker_1 = __importDefault(require("./MapMarker"));
|
|
|
31
31
|
const MapPolyline_1 = __importDefault(require("./MapPolyline"));
|
|
32
32
|
const MapPolygon_1 = __importDefault(require("./MapPolygon"));
|
|
33
33
|
const Geojson = (props) => {
|
|
34
|
-
const { geojson, strokeColor, fillColor, strokeWidth, color, title, image, zIndex, onPress, lineCap, lineJoin, tappable, tracksViewChanges, miterLimit, lineDashPhase, lineDashPattern, markerComponent, } = props;
|
|
34
|
+
const { anchor, centerOffset, geojson, strokeColor, fillColor, strokeWidth, color, title, image, zIndex, onPress, lineCap, lineJoin, tappable, tracksViewChanges, miterLimit, lineDashPhase, lineDashPattern, markerComponent, } = props;
|
|
35
35
|
const pointOverlays = makePointOverlays(geojson.features);
|
|
36
36
|
const lineOverlays = makeLineOverlays(geojson.features);
|
|
37
37
|
const polygonOverlays = makePolygonOverlays(geojson.features);
|
|
@@ -39,7 +39,7 @@ const Geojson = (props) => {
|
|
|
39
39
|
{pointOverlays.map((overlay, index) => {
|
|
40
40
|
const markerColor = getColor(color, overlay, 'marker-color');
|
|
41
41
|
const pointOverlayTracksViewChanges = overlay.feature.properties?.tracksViewChanges || tracksViewChanges;
|
|
42
|
-
return (<MapMarker_1.default key={index} coordinate={overlay.coordinates} tracksViewChanges={pointOverlayTracksViewChanges} image={image} title={title} pinColor={markerColor} zIndex={zIndex} onPress={() => onPress && onPress(overlay)}>
|
|
42
|
+
return (<MapMarker_1.default key={index} coordinate={overlay.coordinates} tracksViewChanges={pointOverlayTracksViewChanges} image={image} title={title} pinColor={markerColor} zIndex={zIndex} anchor={anchor} centerOffset={centerOffset} onPress={() => onPress && onPress(overlay)}>
|
|
43
43
|
{markerComponent}
|
|
44
44
|
</MapMarker_1.default>);
|
|
45
45
|
})}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"author": "Leland Richardson <leland.m.richardson@gmail.com>",
|
|
7
7
|
"homepage": "https://github.com/react-native-maps/react-native-maps#readme",
|
|
8
|
-
"version": "1.
|
|
8
|
+
"version": "1.18.0",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint . --max-warnings 0",
|