Skip to content

Commit

Permalink
Add Marker#flat
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuxiang committed Jan 18, 2018
1 parent 1207968 commit 213ea9f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ class BaiduMapMarker(context: Context) : ReactViewGroup(context), BaiduMapOverla
setIcon(BitmapDescriptorFactory.fromResource(drawable))
}

fun setFlat(flat: Boolean) {
options.flat(flat)
marker?.isFlat = flat
}

fun setMarkerView(view: View) {
markerView = view
view.addOnLayoutChangeListener { _, _, _, _, _, _, _, _, _ ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,9 @@ class BaiduMapMarkerManager : ViewGroupManager<BaiduMapMarker>() {
fun setSelected(view: BaiduMapMarker, selected: Boolean) {
view.active = selected
}

@ReactProp(name = "flat")
fun setFlat(view: BaiduMapMarker, flat: Boolean) {
view.setFlat(flat)
}
}
2 changes: 2 additions & 0 deletions src/map-view/marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type Props = {
view?: ComponentType<*>,
title?: string,
selected?: boolean,
flat?: boolean,
} & ViewPropTypes

export default class Marker extends Component<Props> {
Expand All @@ -35,6 +36,7 @@ export default class Marker extends Component<Props> {
image: PropTypes.string,
title: PropTypes.string,
selected: PropTypes.bool,
flat: PropTypes.bool,
}


Expand Down

0 comments on commit 213ea9f

Please sign in to comment.