# \[Google Maps API\] Not getting a location

**URL:** <https://community.particle.io/t/google-maps-api-not-getting-a-location/56047>\
**Category:** Integrations\
**Tags:** electron\
**Created:** [May 7, 2020, 2:30pm UTC](https://community.particle.io/t/google-maps-api-not-getting-a-location/56047 "2020-05-07T14:30:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![spe](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/spe/32/24310_2.png) [@spe](https://community.particle.io/u/spe)\
**Post date:** [May 7, 2020, 2:30pm UTC](https://community.particle.io/t/google-maps-api-not-getting-a-location/56047/1 "2020-05-07T14:30:56Z")

</div>

I’m testing out the Google Maps API integration along with the sample program to see if I can locate my device. Here’s the documentation I’m reading: [https://docs.particle.io/tutorials/integrations/google-maps/](https://docs.particle.io/tutorials/integrations/google-maps/)

I’m trying out the sample firmware. The documentation says this:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/2/0/20b232cf1f151b380bd31ce91f0fb35b60a3d487.png)

but my console is only getting this:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/8/2/82288249f5ce188d001510dcdedfe662e15be43e.png)

So it’s only getting the first “deviceLocator” publishing, and not the location “hook-” publishing

---

<div class="post-metadata">

**Author:** ![spe](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/spe/32/24310_2.png) [@spe](https://community.particle.io/u/spe)\
**Post date:** [May 7, 2020, 3:04pm UTC](https://community.particle.io/t/google-maps-api-not-getting-a-location/56047/2 "2020-05-07T15:04:47Z")

</div>

Figured it out: Looks like the sample app was updated but the documentation wasn’t. The new sample app looks like this:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/8/8/8835f479e36c26b2cd6d97b5a161540159863be2.png)

I didn’t realize the `locationCallback()` function was added there to allow the programmer to do what they want with the location it received back. Adding this code published the location to my Events feed:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/4/e/4e8be0202188dbc5ffe4c3b26d2f16c6d8d2d905.png)
