|
|
|
@ -16,6 +16,7 @@ import androidx.core.content.res.ResourcesCompat
|
|
|
|
|
import androidx.fragment.app.Fragment
|
|
|
|
|
import com.google.gson.JsonParser
|
|
|
|
|
import com.mapbox.mapboxsdk.Mapbox
|
|
|
|
|
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory
|
|
|
|
|
import com.mapbox.mapboxsdk.geometry.LatLng
|
|
|
|
|
import com.mapbox.mapboxsdk.maps.MapView
|
|
|
|
|
import com.mapbox.mapboxsdk.plugins.annotation.Symbol
|
|
|
|
@ -79,12 +80,17 @@ class FirstFragment: Fragment(R.layout.fragment_map_page) {
|
|
|
|
|
Log.e("Debug","${locationListener.latitude},${locationListener.latitude}")
|
|
|
|
|
listRestaurant = getRestaurants(locationListener.latitude,locationListener.latitude,1000000)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(listRestaurant.isEmpty()){
|
|
|
|
|
Toast.makeText(requireContext(), "Pas de restaurants trouver", Toast.LENGTH_SHORT).show()
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mapView?.getMapAsync { map ->
|
|
|
|
|
|
|
|
|
|
map.animateCamera(CameraUpdateFactory.newLatLngZoom(
|
|
|
|
|
LatLng(locationListener.latitude, locationListener.longitude), 11.0))
|
|
|
|
|
|
|
|
|
|
map.setStyle(makeStyleUrl()) { style ->
|
|
|
|
|
map.uiSettings.setAttributionMargins(15, 0, 0, 15)
|
|
|
|
|
// Add an icons ("classic" and "selected") to the map style.
|
|
|
|
|