quand clique sur le bouton affichage des point d'interet

master
Bastien OLLIER 2 years ago
parent 2250cf71fa
commit 9d73c6ec19

@ -14,7 +14,7 @@ val httpClient = OkHttpClient()
interface RestaurantAPI {
@GET("nearbySearch/.json?categorySet=7315&key=s6oXlFd9IRM2vgPhNmzJ24HS2hlqcu00")
@GET("nearbySearch/.json?key=s6oXlFd9IRM2vgPhNmzJ24HS2hlqcu00&categorySet=7315&limit=50")
suspend fun getRestaurants(@Query("lat") lat: Double, @Query("lon") lon: Double, @Query("radius") radius: Int): NearbyPOI
}

@ -21,7 +21,7 @@ fun getRestaurants(lat: Double, lon: Double, radius: Int): List<RestaurantData>
}
} catch (Ex: Exception) {
Log.e("Error", Ex.localizedMessage)
Log.e("Error", Ex.toString())
}
}
}

@ -77,8 +77,8 @@ class FirstFragment: Fragment(R.layout.fragment_map_page) {
}
private fun findAndPutRestaurant(){
Log.e("Debug","${locationListener.latitude},${locationListener.latitude}")
listRestaurant = getRestaurants(locationListener.latitude,locationListener.latitude,1000000)
Log.e("Debug","${locationListener.latitude},${locationListener.longitude}")
listRestaurant = getRestaurants(locationListener.latitude,locationListener.longitude,1000)
if(listRestaurant.isEmpty()){
@ -87,9 +87,7 @@ class FirstFragment: Fragment(R.layout.fragment_map_page) {
}
mapView?.getMapAsync { map ->
map.animateCamera(CameraUpdateFactory.newLatLngZoom(
LatLng(locationListener.latitude, locationListener.longitude), 11.0))
map.animateCamera(CameraUpdateFactory.newLatLngZoom(LatLng(locationListener.latitude, locationListener.longitude), 11.0))
map.setStyle(makeStyleUrl()) { style ->
map.uiSettings.setAttributionMargins(15, 0, 0, 15)

Loading…
Cancel
Save