---
title: "Sencha touch 2 - Display current location on map"  
description: "Sencha touch 2 - Display current location on map"  
author: "Anonymous User"  
published: 2013-05-31  
updated: 2013-06-01  
canonical: https://www.mindstick.com/forum/949/sencha-touch-2-display-current-location-on-map  
category: "sencha touch"  
tags: ["sencha touch"]  
reading_time: 2 minutes  

---

# Sencha touch 2 - Display current location on map

Hi [Expert](https://www.mindstick.com/articles/13120/an-expert-financial-advice-will-improve-your-finances)!\
I want to display my [current location](https://www.mindstick.com/forum/34690/how-to-automatically-fill-our-current-location-in-the-places-textarea-for-my-mvc-application) and get location coordinates to [search](https://www.mindstick.com/articles/65368/best-smo-services-company-in-hyderabad-improve-search-rankings) nearby. [Starting](https://www.mindstick.com/blog/12024/things-you-need-to-know-when-starting-your-own-business) with the [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) below to display my location on the [map](https://yourviews.mindstick.com/view/81351/nepal-parliament-s-approves-new-controversial-map-india-rejects-it-but), but its not working.\
{ xtype: 'map', useCurrentLocation: [true](https://yourviews.mindstick.com/view/81326/boycott-chinese-products-dream-will-come-true)}\
Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!

## Replies

### Reply by AVADHESH PATEL

Hi Jacob!\
My code in that forum did not worked. The code that I was using is as follows:**\****The index.html file looks like this:**

```
<!DOCTYPE html><html><head>    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">    <title>Sample app</title>    <script type="text/javascript" src="lib/touch/sencha-touch-all-debug.js"></script>    <link href="lib/touch/resources/css/sencha-touch.css" rel="stylesheet" type="text/css" />    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>    <script type="text/javascript">        Ext.Loader.setConfig({            enabled : true,            path    : {                PPL : 'ppl.js'            }        });        Ext.setup({            tabletStartupScreen : 'tablet_startup.png',            phoneStartupScreen  : 'phone_startup.png',            icon                : 'phone_startup.png',            onReady             : function() {                Ext.create('PPL.App', {                    fullscreen : true                });            }        })    </script></head><body></body>
```

And my ppl.js looks like this:

```
Ext.define('PPL.App', {extend : 'Ext.Panel',layout : 'vbox',config : {    items  : [{        xtype   : 'toolbar',        title   : 'Sample MAP'                  },{        xtype   : 'panel',        layout  : 'fit',                    items   : [{            xtype   : 'map',            useCurrentLocation : true        }]    }]}});
```

If I change my ppl.js into the following:\

```
Ext.define('PPL.App', {extend : 'Ext.Map',layout : 'fit',config : {    items  : [{        xtype   : 'map',        useCurrentLocation : false    }]}});
```

\
Then it is working! So, I think we need to wait untill next release, in the mean time learn ST2 :-)\
I hope it helpful for you.\


---

Original Source: https://www.mindstick.com/forum/949/sencha-touch-2-display-current-location-on-map

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
