Skip to content

Commit

Permalink
i need to save this
Browse files Browse the repository at this point in the history
  • Loading branch information
Deliner committed Sep 5, 2020
1 parent 0fc7835 commit 92babbc
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 4 deletions.
Binary file added app/src/main/assets/gog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/neyas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/perepel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/teterev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 19 additions & 4 deletions app/src/main/java/com/deliner/mosfauna/fragment/GuideFragment.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.deliner.mosfauna.fragment

import android.graphics.BitmapFactory
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
Expand All @@ -13,14 +14,19 @@ import com.google.android.gms.maps.MapsInitializer
import com.google.android.gms.maps.model.CameraPosition
import com.google.android.gms.maps.model.LatLng
import com.google.android.gms.maps.model.MarkerOptions
import java.io.InputStream


class GuideFragment : Fragment() {

var mMapView: MapView? = null
private var googleMap: GoogleMap? = null

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val rootView: View = inflater.inflate(R.layout.fragment_guide, container, false)
mMapView = rootView.findViewById<View>(R.id.mapView) as MapView
mMapView!!.onCreate(savedInstanceState)
Expand All @@ -31,12 +37,21 @@ class GuideFragment : Fragment() {
e.printStackTrace()
}
mMapView!!.getMapAsync { mMap ->
val sydney = LatLng(55.6524933,37.4646361)
val cameraPosition = CameraPosition.Builder().target(sydney).zoom(14f).build()
val user = LatLng(55.799334, 37.673134)
val cameraPosition = CameraPosition.Builder().target(user).zoom(13f).build()



val inputStream: InputStream = requireActivity().assets.open("gog.png")
val bitmap = BitmapFactory.decodeStream(inputStream)

googleMap = mMap
googleMap!!.addMarker(MarkerOptions().position(sydney).title("").snippet(""))
googleMap!!.addMarker(MarkerOptions().position(LatLng(55.810348, 37.663642)).title("Обыкновенный гоголь").icon(bitmap.) )
googleMap!!.addMarker(MarkerOptions().position(LatLng(55.799162, 37.655170)).title("Ястреб-перепелятник"))
googleMap!!.addMarker(MarkerOptions().position(LatLng(55.807767, 37.684719)).title("Ястреб-тетеревятник"))
googleMap!!.addMarker(MarkerOptions().position(LatLng(55.800969, 37.688343)).title("Серая неясыть"))
googleMap!!.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))

}
return rootView
}
Expand Down
Binary file added app/src/main/res/drawable/gog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/neyas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/perepel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/teterev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 92babbc

Please sign in to comment.