1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    1
    Vote Rating
    0
    pravinhmhatre is on a distinguished road

      0  

    Default Unanswered: Maps with sencha touch

    Unanswered: Maps with sencha touch


    I am trying to create an application that will display current location on the map. But I am not able to display my current location. I am trying standard map example from sencha examples. When I try it online it works but not on my local system. I am using chrome for testing.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,085
    Vote Rating
    453
    Answers
    3153
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Code?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Sep 2010
    Location
    Netherlands
    Posts
    120
    Vote Rating
    4
    Answers
    3
    aacoro is on a distinguished road

      0  

    Default


    since the topic starter left I will continue this thread:

    I want to show my current location in a sample app.

    My index.html:
    Code:
    <!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>
    </html>
    and the app.js:
    Code:
    Ext.define('PPL.App', {
        extend : 'Ext.Panel',
    
    
        config : {
            items : [{
                xtype      : 'toolbar',
                docked     : 'top',
                title    : 'Sample MAP'                
            },{
                xtype    : 'panel',
                height    : 300,
                width    : 400,
                items    : [{
                    xtype    : 'map',
                    useCurrentLocation : true    
                }]
            }]
        }
    });
    But, sadly nothing happens, I only see the toolbar with the title.
    Did I forgot to use layouts properly?
    Thanks

    EDIT: I think topic started asked question also on Stackoverflow: http://stackoverflow.com/questions/8...364070#8364070
    Last edited by aacoro; 2 Dec 2011 at 3:41 PM. Reason: stackoverflow reference

  4. #4
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,156
    Vote Rating
    4
    Answers
    93
    rdougan is on a distinguished road

      0  

    Default


    There were issues with Map in PR2. A lot of work has been on on Map and GeoLocation for the next release.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  5. #5
    Sencha User
    Join Date
    Sep 2010
    Location
    Netherlands
    Posts
    120
    Vote Rating
    4
    Answers
    3
    aacoro is on a distinguished road

      0  

    Default


    I need this for a test case within one month, 2nd of january.
    Can you define 'next'? Within one month? Week? Year?

    Thanks.

  6. #6
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,156
    Vote Rating
    4
    Answers
    93
    rdougan is on a distinguished road

      0  

    Default


    PR3, next week, hopefully.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  7. #7
    Sencha - Training Team
    Join Date
    Nov 2009
    Location
    Washington, DC
    Posts
    34
    Vote Rating
    0
    Answers
    1
    sdruckerfig is on a distinguished road

      0  

    Default


    There's a workaround -- basically you just need to set all the map properties directly through the Google Maps API:

    HTML Code:
    Ext.define("CrimeFinder.view.crimereport.map.Map", {
        extend: 'Ext.Map',
        xtype: 'crimemap',
    
       config: {
           useCurrentLocation: false
       },
       initialize: function() {
           var me=this;
    
    
        var gMap = this.getMap();
            gMap.setOptions({
                center : new google.maps.LatLng(38.909085, -77.036777),
                zoom : 16,
                mapTypeId : google.maps.MapTypeId.ROADMAP,
                navigationControl : true,
                navigationControlOptions : {
                    style : google.maps.NavigationControlStyle.DEFAULT
                }
            })
       }
    
    
    });

  8. #8
    Sencha User
    Join Date
    Sep 2010
    Location
    Netherlands
    Posts
    120
    Vote Rating
    4
    Answers
    3
    aacoro is on a distinguished road

      0  

    Default


    Quote Originally Posted by sdruckerfig View Post
    There's a workaround -- basically you just need to set all the map properties directly through the Google Maps API:

    HTML Code:
    Ext.define("CrimeFinder.view.crimereport.map.Map", {
        extend: 'Ext.Map',
        xtype: 'crimemap',
    
       config: {
           useCurrentLocation: false
       },
       initialize: function() {
           var me=this;
    
    
        var gMap = this.getMap();
            gMap.setOptions({
                center : new google.maps.LatLng(38.909085, -77.036777),
                zoom : 16,
                mapTypeId : google.maps.MapTypeId.ROADMAP,
                navigationControl : true,
                navigationControlOptions : {
                    style : google.maps.NavigationControlStyle.DEFAULT
                }
            })
       }
    
    
    });
    Thanks sdruckerfig, this week PR3 will hopefully be released, so I will wait for that since I need to use current location

Tags for this Thread