Skip to content

Commit

Permalink
style(components-rn): Map types error
Browse files Browse the repository at this point in the history
  • Loading branch information
Manjiz committed Jul 25, 2019
1 parent 87be1e6 commit 98fad95
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/taro-components-rn/src/components/Map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO
/**
* 标记点气泡 callout
*/
type Callout = {
type Callouts = {
content?: string;
color?: string;
fontSize?: number;
Expand Down Expand Up @@ -96,7 +96,7 @@ type Marker = {
alpha?: number;
// width?: number;
// height?: number;
callout?: Callout;
callout?: Callouts;
// label?: Label;
anchor?: { x: number, y: number };
}
Expand Down Expand Up @@ -157,8 +157,8 @@ type Region = {
}

export interface Props {
longitude?: number;
latitude?: number;
longitude: number;
latitude: number;
scale?: number;
markers?: Array<Marker>;
polyline?: Array<Polyline>;
Expand Down Expand Up @@ -195,6 +195,8 @@ export interface State {

class _Map extends React.Component<Props, State> {
static defaultProps: Props = {
longitude: 0,
latitude: 0,
scale: 16,
markers: [],
polyline: [],
Expand Down Expand Up @@ -253,7 +255,7 @@ class _Map extends React.Component<Props, State> {
const {id, callout} = marker
if (!callout) return null
return (
<MapView.Callout
<Callout
onPress={() => {
onCalloutClick && onCalloutClick(id)
}}
Expand All @@ -277,7 +279,7 @@ class _Map extends React.Component<Props, State> {
{callout.content}
</Text>
</View>
</MapView.Callout>
</Callout>
)
}

Expand Down Expand Up @@ -334,7 +336,7 @@ class _Map extends React.Component<Props, State> {
longitude: marker.longitude
}}
title={marker.title}
image={marker.iconPath}
image={{ uri: marker.iconPath }}
rotation={marker.rotate}
opacity={marker.alpha}
anchor={marker.anchor}
Expand Down

0 comments on commit 98fad95

Please sign in to comment.