# MyLocation button

**URL:** <https://community.cesium.com/t/mylocation-button/14264>\
**Category:** CesiumJS\
**Created:** [July 1, 2021, 12:12am UTC](https://community.cesium.com/t/mylocation-button/14264 "2021-07-01T00:12:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cloudatlas](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/cloudatlas/32/4425_2.png) [@cloudatlas](https://community.cesium.com/u/cloudatlas)\
**Post date:** [July 1, 2021, 12:12am UTC](https://community.cesium.com/t/mylocation-button/14264/1 "2021-07-01T00:12:13Z")

</div>

Hi Community.

Is there a MyLocation button available to show the users location with a blue dot on the map?  
(like in Google Maps)

I searched everything, maybe i miss the right search term?

Thanks for your help!!!

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [July 1, 2021, 4:49pm UTC](https://community.cesium.com/t/mylocation-button/14264/2 "2021-07-01T16:49:44Z")

</div>

@cloudatlas

Great question! [This post](https://community.cesium.com/t/how-to-get-current-location/10683/2) suggests that you can use the [browser’s geolocation API](https://www.w3schools.com/html/html5_geolocation.asp) to get a users location. However, we currently do not have a “MyLocation” feature in [our API](https://cesium.com/docs/cesiumjs-ref-doc/).

-Sam

---

<div class="post-metadata">

**Author:** ![cloudatlas](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/cloudatlas/32/4425_2.png) [@cloudatlas](https://community.cesium.com/u/cloudatlas)\
**Post date:** [July 2, 2021, 9:24am UTC](https://community.cesium.com/t/mylocation-button/14264/3 "2021-07-02T09:24:11Z")

</div>

Hi Sam. How are you doing?

Yes, we are already using the geolocation API and it works perfectly.  
Here is the link: [HTML Geolocation API](https://www.w3schools.com/html/html5_geolocation.asp)  
And here is the code in action: [PWA-SPA-LOGIN-MAINSCREEN-MENU-Starter-Kit/CesiumMap.tsx at main · worldpeaceenginelabs/PWA-SPA-LOGIN-MAINSCREEN-MENU-Starter-Kit · GitHub](https://github.com/worldpeaceenginelabs/PWA-SPA-LOGIN-MAINSCREEN-MENU-Starter-Kit/blob/main/src/Components/views/CesiumMap.tsx)

For now, fetching the location and moving the camera, runs on start, or on tapping the home button.  
We will change the home button symbol to a location symbol and remove the “move camera on start to users location”. Voila, that’s it.

But I thought more about a Cesium myLocation button class, that I maybe miss in the documentation?  
Kind of a ready-to-use “Google Maps location button” with interchangeable style.

And if not, that would be a great feature request, actually wondering, why this is missing?  
There should be a location button integrated in Cesium, like duh 😂

Thanks for your time.  
Best regards

Bo
