Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

156
Views
'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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!