Created
January 6, 2019 08:59
-
-
Save mizutori/b4e9bcfe51c5db5ee031284ef4dc4b4a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun drawUserPositionMarker(location: Location) { | |
val latLng = LatLng(location.latitude, location.longitude) | |
if (this.userPositionMarkerBitmapDescriptor == null) { | |
userPositionMarkerBitmapDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.user_position_point) | |
} | |
userPositionMarker?.let{ | |
it.setPosition(latLng) | |
} ?: run{ | |
userPositionMarker = map.addMarker( | |
MarkerOptions() | |
.position(latLng) | |
.flat(true) | |
.anchor(0.5f, 0.5f) | |
.icon(this.userPositionMarkerBitmapDescriptor) | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment