• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

153
Vistas
Lugares cercanos de Google muestra 23 lugares, pero el mapa solo muestra 12

Llamo a lugares de Google y obtengo los lugares correctos, pero cuando voy a mostrarlos en el mapa, solo se muestra la mitad de los lugares devueltos. Sé que hay un límite de 20 lugares por "pantalla" que Google permite, pero ¿por qué no alcanza al menos 20 lugares?

 const urlCafe = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=" + latitude + "," + longitude + "&radius=" + radMetter + "&type=" + cafeKeyword + "&keyword=" + coffeeKeyword + "&key=" + config.API_KEY; let cafePlaces = await fetch(urlCafe) .then(res => { return res.json(); }) .then(res => { for (let googlePlace of res.results) { if ( googlePlace && googlePlace.opening_hours && googlePlace.business_status && googlePlace.business_status != "CLOSED_TEMPORARILY" ) { let place = {}; let lat = googlePlace.geometry.location.lat; let lng = googlePlace.geometry.location.lng; let coordinate = { latitude: lat, longitude: lng, }; place["placeType"] = "cafe"; place["vicinity"] = googlePlace.vicinity; place["open"] = googlePlace.opening_hours.open_now; place["placeTypes"] = googlePlace.types; place["rating"] = googlePlace.rating; place["coordinate"] = coordinate; place["placeId"] = googlePlace.place_id; place["user_ratings_total"] = googlePlace.user_ratings_total; place["placeName"] = googlePlace.name; placesArray.push(place); } } return placesArray; }); <MapView ref={mapRef} onMapReady={() => { if (mapRef.current) { mapRef.current.fitToCoordinates( placesArray.map(location => location.coordinate), { edgePadding: { top: 10, right: 10, bottom: 10, left: 10, }, animated: true, } ); } }} style={styles.map} showsUserLocation={true} onRegionChange={e => onRegionChange(e)} > {placesArray && placesArray.length > 0 ? placesArray.map((marker, key) => { if (marker == undefined) return null; return ( <Marker coordinate={marker.coordinate} title={marker.placeName} key={key} ....
almost 3 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda