Steet_View_Markers
alkurop
6
Visit GitHub RepoMaps

Street View Markers

Add clickable markers to android street view.

  1. Layout
<com.github.alkurop.streetviewmarker.StreetMarkerView
        android:id="@+id/marker_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
  1. Code

val focusLocation = LatLng(50.431849329572735, 30.515935972507187)
    marker_view.focusToLocation(focusLocation)
    
marker_view.focusToLocation(focusLocation)

marker_view.onMarkerClickListener = {
    Toast.makeText(this, "$it", Toast.LENGTH_SHORT).show()
}

marker_view.onMarkerLongClickListener = {
    Toast.makeText(this, "$it", Toast.LENGTH_SHORT).show()
}
marker_view.onStreetLoadedSuccess = { loadedSuccess ->
    if (!loadedSuccess) {
        Toast.makeText(this, "No street found at this location", Toast.LENGTH_SHORT).show()
    }
}

marker_view.onCameraUpdateListener = { cameraPosition ->
    Log.d(this.javaClass.canonicalName, "Load new markres list for position $cameraPosition")
}

val markerLocation = LatLng(50.431781340278064, 30.51638161763549)
val marker = PinPlace("1", markerLocation, "title")

marker_view.setMarkers(hashSetOf(marker))

To view an example see https://github.com/alkurop/Steet_View_Markers/blob/master/app/src/main/kotlin/com/alkurop/mystreetplaces/ui/street/StreetFragment.kt

https://play.google.com/store/apps/details?id=com.alkurop.mystreetplaces

Become a better Android Developer
Millions of developers are learning at MindOrks

Online Training Program

Featured Blogs

Our Team

MindOrks is Certainly one of the best online blog to stay on top of all the Android development news, coding and design patterns. Finally a blog I can count on to keep myself updated with latest and greatest things happening in Android world.

Vipul Shah
Android Developer
Microsoft

Become Pro in Android by watching videos

OUR LEARNERS WORK AT