react-native-maps 1.17.3 → 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.
- package/lib/Geojson.d.ts +27 -0
- package/lib/Geojson.js +2 -2
- package/package.json +1 -1
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",
|