Skip to content
-
Mind and Script Mind and Script Mind and Script

Deep Thoughts, Clean Thoughts

Mind and Script Mind and Script Mind and Script

Deep Thoughts, Clean Thoughts

  • Home
  • Life
    • Lifestyle
    • Mental Health
    • Personal Growth
    • Philosophy
    • Professional Growth
    • Psychology
  • Books
  • Writing
    • AI Writing
    • Technical Writing
  • Movies
  • Travel
    • Day Trips
    • Food
    • Itineraries
    • World
  • Technology
  • Home
  • Life
    • Lifestyle
    • Mental Health
    • Personal Growth
    • Philosophy
    • Professional Growth
    • Psychology
  • Books
  • Writing
    • AI Writing
    • Technical Writing
  • Movies
  • Travel
    • Day Trips
    • Food
    • Itineraries
    • World
  • Technology
Close

Search

Mind and Script Mind and Script Mind and Script

Deep Thoughts, Clean Thoughts

Mind and Script Mind and Script Mind and Script

Deep Thoughts, Clean Thoughts

  • Home
  • Life
    • Lifestyle
    • Mental Health
    • Personal Growth
    • Philosophy
    • Professional Growth
    • Psychology
  • Books
  • Writing
    • AI Writing
    • Technical Writing
  • Movies
  • Travel
    • Day Trips
    • Food
    • Itineraries
    • World
  • Technology
  • Home
  • Life
    • Lifestyle
    • Mental Health
    • Personal Growth
    • Philosophy
    • Professional Growth
    • Psychology
  • Books
  • Writing
    • AI Writing
    • Technical Writing
  • Movies
  • Travel
    • Day Trips
    • Food
    • Itineraries
    • World
  • Technology
Close

Search

Ionic 3 for Nearby Places

February 10, 2019 2 Min Read
0
1*G13Ha tja3uAyINlhMIFrQ

In the process of developing an App, which has a feature of Nearby Places, I tried out Ionic 3 Native-Geolocation and Google Maps APIs. Lot of us, must be trying to do something like this in their App. Here in this story, I’ll try to explain you that.

To start with, install the dependencies and packages required.

First you need to install the Cordova Plugin for Geolocation.

You can refer to ionic documentation . (I’m using Ionic 3)

ionic cordova plugin add cordova-plugin-geolocation — variable GEOLOCATION_USAGE_DESCRIPTION=”To locate you”

Then install the Package :

npm install — save @ionic-native/geolocation@4

Add this plugin to your app.module.ts file ::

import { Geolocation } from ‘@ionic-native/geolocation’;
providers: [
…
Geolocation,
…
]

Create a provider for the Location Service::
ionic generate provider locations

In location.ts, add the following code.

1*XlAJNn4nS2rJnoN4klMVSw
Code snippet of location.ts

Import location service to the page’s ts file you want to show the Map. (For me nearby.ts)

1*EXfyqPa923YfE95C1P4Irg
Code snippet of the .ts file

Now you have got the Latitude and Longitude of the current location. Now you need to call the loadMap() to initiate the map.

Here the nearbyCenters array holds all the Lat-Lng of the places I want to pin.

If you need to pin certain places, use Google Maps Geocode API to get the Lat-Lng of those address.

In HTML page, just add <div #map id=”map”></div>

Annnndddd.. its done..!!

Bonus TIP:: 
To test your App in real devices, let it be Android or iOS, download Ionic DevApp. Trust me, to know its benefits, try it yourself.

Follow step-by-step. And at any point if you are stuck or need any help in implementing this, feel free to contact me or even if any change/correction is required. Just drop a mail with your query at [email protected]

💡 Mind and Script Weekly

Join other engineers and writers. No spam, just substance.

Disclaimer: This post may contain affiliate links. If you click and buy, we may receive a small commission at no extra cost to you. Read our full disclosure here.

Tags:

Google MapsGoogle Maps APIIonic3
Author

Rajesh Mishra

I'm a developer who loves sharing insights, technical how-tos, and lessons learned from the world of code. While much of what I write may not be groundbreaking, I believe in documenting for future me—and for anyone else who might find it useful. Beyond tech, I also dive into life's experiences and moments, reflecting on personal growth and sharing stories that resonate. Whether you're here for practical tips or a fresh perspective on life, I hope you find something meaningful.

Follow Me
Other Articles
Previous

Dynamically Add or Remove Fields using jQuery or JavaScript

Next

The 3 Magical Words…!! ;)

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Hyderabad Traffic
  • 5 Best Books to Read After a Breakup
  • 5 Movies to Stream This Valentine’s Day If You’re Single
  • Self-Care: A Guide to Solo Valentine’s Day
  • Using GitHub Actions for Google Cloud Run

Recent Comments

  1. Sneha on Smartphones: Friend or Foe?

Important Links

  • Affiliate Disclosure
  • Privacy Policy
  • Terms of Use
© Copyright 2026 — Mind and Script. All rights reserved.