Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

157
Vistas
'React Native' select location using native maps

I need user to select location of an event.

Now what already works is opening the native maps (at least on android) - I can open the native maps through { Linking } from "react-native"; geo:24.669026,24.699024?z=6

However what I can't find how to make native maps prompt user to set some location and after some kind of confirmation?

I imagined something like return_url with some sort of backlink to my application.

Or is this ONLY possible through embeding maps and using Google Maps API?

(I am trying to avoid billing, since all I want to do is to help user to find the coordinates and put them back to application, the application doesn't use the coordinates to do anything besides sending user to display them on they native maps)

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

so if I understood you correctly you want to show the user's current location on the map without paying to any third party, if that's the case you need to do the followings.

  1. Get user latitude and longitude.
  2. Show those latitudes and longitudes on the map using some marker.

1. Get user latitude and longitude.

You can follow the below article for getting user latitude and longitude.

  • ReactNative: https://aboutreact.com/react-native-geolocation/
  • Expo: https://docs.expo.dev/versions/latest/sdk/location

2. Show those latitudes and longitudes on the map using some marker.

So in this step, we will be using react-native-maps and OpenStreetMap.

Note: Do not change urlTemplate in the UrlTile

Here is the reference for custom map tile from react-native-maps

https://github.com/react-native-maps/react-native-maps#tile-overlay-using-tile-server

import MapView, { UrlTile, Marker } from "react-native-maps";

const { width, height } = props;
const ASPECT_RATIO = width / height;
const LATITUDE_DELTA = 8; //Very high zoom level
const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO;
const userCoords={{
   latitude: number,
   longitude: number
}};
<MapView
  initialRegion={{
    latitude: 51.1657,
    longitude: 10.4515,
    latitudeDelta: LATITUDE_DELTA,
    longitudeDelta: LONGITUDE_DELTA,
  }}
  loadingEnabled
  minZoomLevel={3}
  maxZoomLevel={10}
  showsIndoors={false}
  showsTraffic={false}
  showsBuildings={false}
  showsScale={true}
>
  <UrlTile
    /**
     * The url template of the tile server. The patterns {x} {y} {z} will be replaced at runtime
     * For example, http://c.tile.openstreetmap.org/{z}/{x}/{y}.png
     */
    urlTemplate={"http://c.tile.openstreetmap.org/{z}/{x}/{y}.png"}
    /**
     * The maximum zoom level for this tile overlay. Corresponds to the maximumZ setting in
     * MKTileOverlay. iOS only.
     */
    maximumZ={10}
    /**
     * flipY allows tiles with inverted y coordinates (origin at bottom left of map)
     * to be used. Its default value is false.
     */
    flipY={false}
  />
  <Marker coordinate={userCoords}>
    /**
     * Your custom marker here 
    */
  </Marker>
</MapView>;
about 4 years ago · Juan Pablo Isaza Denunciar

0

You currently can't do that with react-native, you have to add your own map. You can use react-native-maps

about 4 years ago · Juan Pablo Isaza Denunciar
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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda